Hungarian layout v2
This commit is contained in:
@@ -17,16 +17,16 @@ namespace LanguageGenerator
|
|||||||
{
|
{
|
||||||
private static readonly char[,] smallCharacters = new char[4, 8]
|
private static readonly char[,] smallCharacters = new char[4, 8]
|
||||||
{
|
{
|
||||||
{'k', 's', 'i', 'n', 'e', 'l', 'a', 't'},
|
{'k', 'l', 's', 'n', 'e', 'i', 'a', 't'},
|
||||||
{'g', 'b', 'm', 'o', 'z', 'r', 'y', 'v'},
|
{'b', 'r', 'm', 'y', 'g', 'v', 'o', 'z'},
|
||||||
{'x', 'p', 'f', 'd', 'j', 'c', 'u', 'h'},
|
{'c', 'f', 'p', 'x', 'h', 'j', 'u', 'd'},
|
||||||
{'q', '?', '!', 'w', '@', ',', '.', '\''}
|
{'q', '?', '!', 'w', '@', ',', '.', '\''}
|
||||||
};
|
};
|
||||||
private static readonly char[,] capitalCharacters = new char[4, 8]
|
private static readonly char[,] capitalCharacters = new char[4, 8]
|
||||||
{
|
{
|
||||||
{'K', 'S', 'I', 'N', 'E', 'L', 'A', 'T'},
|
{'K', 'L', 'S', 'N', 'E', 'I', 'A', 'T'},
|
||||||
{'G', 'B', 'M', 'O', 'Z', 'R', 'Y', 'V'},
|
{'B', 'R', 'M', 'Y', 'G', 'V', 'O', 'Z'},
|
||||||
{'X', 'P', 'F', 'D', 'J', 'C', 'U', 'H'},
|
{'C', 'F', 'P', 'X', 'H', 'J', 'U', 'D'},
|
||||||
{'Q', '-', '_', 'W', '*', '/', ':', '\"'}
|
{'Q', '-', '_', 'W', '*', '/', ':', '\"'}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -111,13 +111,34 @@ namespace LanguageGenerator
|
|||||||
generatedOutput.Append(keyboardActionsString);
|
generatedOutput.Append(keyboardActionsString);
|
||||||
}
|
}
|
||||||
|
|
||||||
using var writer = File.CreateText(fileName);
|
using (var writer = File.CreateText(fileName))
|
||||||
|
{
|
||||||
writer.Write("<keyboardActionMap>" + Environment.NewLine);
|
writer.Write("<keyboardActionMap>" + Environment.NewLine);
|
||||||
writer.Write(generatedOutput);
|
writer.Write(generatedOutput);
|
||||||
writer.Write(File.ReadAllText("append.xml"));
|
writer.Write(File.ReadAllText("append.xml"));
|
||||||
writer.Write(Environment.NewLine + "</keyboardActionMap>");
|
writer.Write(Environment.NewLine + "</keyboardActionMap>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var lowerCaseBuilder = new StringBuilder();
|
||||||
|
var upperCaseBuilder = new StringBuilder();
|
||||||
|
foreach (var column in new int[] { 2, 4, 6, 0 })
|
||||||
|
{
|
||||||
|
for (var i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
lowerCaseBuilder.Append(smallCharacters[i, column]);
|
||||||
|
lowerCaseBuilder.Append(smallCharacters[i, column + 1]);
|
||||||
|
|
||||||
|
upperCaseBuilder.Append(capitalCharacters[i, column]);
|
||||||
|
upperCaseBuilder.Append(capitalCharacters[i, column + 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var lowerCaseDisplay = lowerCaseBuilder.ToString();
|
||||||
|
var upperCaseDisplay = upperCaseBuilder.ToString();
|
||||||
|
Console.WriteLine(lowerCaseDisplay);
|
||||||
|
Console.WriteLine(upperCaseDisplay);
|
||||||
|
}
|
||||||
|
|
||||||
private static KeyboardAction CharToKeyboardAction(char chr, int circle, int line)
|
private static KeyboardAction CharToKeyboardAction(char chr, int circle, int line)
|
||||||
{
|
{
|
||||||
var movementActions = PositionToMovementSequenceEdges(circle, line);
|
var movementActions = PositionToMovementSequenceEdges(circle, line);
|
||||||
@@ -126,20 +147,7 @@ namespace LanguageGenerator
|
|||||||
{
|
{
|
||||||
var c when c >= 'a' && c <= 'z' => new KeyboardAction(new KeyCodeContent(c, circle, line), movementActions),
|
var c when c >= 'a' && c <= 'z' => new KeyboardAction(new KeyCodeContent(c, circle, line), movementActions),
|
||||||
var c when c >= 'A' && c <= 'Z' => new KeyboardAction(new KeyCodeContent(c, circle, line), movementActions, upperCaseFlags),
|
var c when c >= 'A' && c <= 'Z' => new KeyboardAction(new KeyCodeContent(c, circle, line), movementActions, upperCaseFlags),
|
||||||
/* var c when c == '?' => new KeyboardAction(new StringContent("?"), movementActions),
|
|
||||||
var c when c == '!' => new KeyboardAction(new StringContent("!"), movementActions),
|
|
||||||
var c when c == '@' => new KeyboardAction(new StringContent("@"), movementActions),
|
|
||||||
var c when c == ',' => new KeyboardAction(new StringContent(","), movementActions),
|
|
||||||
var c when c == '.' => new KeyboardAction(new StringContent("."), movementActions),
|
|
||||||
var c when c == '\'' => new KeyboardAction(new StringContent("\'"), movementActions),
|
|
||||||
var c when c == '-' => new KeyboardAction(new StringContent("?"), movementActions),
|
|
||||||
var c when c == '_' => new KeyboardAction(new StringContent("!"), movementActions),
|
|
||||||
var c when c == '*' => new KeyboardAction(new StringContent("@"), movementActions),
|
|
||||||
var c when c == '/' => new KeyboardAction(new StringContent(","), movementActions),
|
|
||||||
var c when c == ':' => new KeyboardAction(new StringContent("."), movementActions),
|
|
||||||
var c when c == '\"' => new KeyboardAction(new StringContent("\'"), movementActions), */
|
|
||||||
var c => new KeyboardAction(new StringContent(c.ToString()), movementActions)
|
var c => new KeyboardAction(new StringContent(c.ToString()), movementActions)
|
||||||
//_ => throw new ArgumentException($"Unknown character: '{chr}' ({(int)chr})")
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,7 +266,7 @@ namespace LanguageGenerator
|
|||||||
public int Line { get; }
|
public int Line { get; }
|
||||||
|
|
||||||
public string GetContent() => $"<inputKey>{KeyCodeText}</inputKey>";
|
public string GetContent() => $"<inputKey>{KeyCodeText}</inputKey>";
|
||||||
public string GetActionType() =>"INPUT_KEY";
|
public string GetActionType() => "INPUT_KEY";
|
||||||
}
|
}
|
||||||
|
|
||||||
public class StringContent : IKeyboardContent
|
public class StringContent : IKeyboardContent
|
||||||
|
|||||||
Reference in New Issue
Block a user