This commit is contained in:
zb
2023-08-27 09:27:18 +02:00
parent 877daf15eb
commit bf94132c1c
5 changed files with 33 additions and 3 deletions

View File

@@ -14,5 +14,7 @@ enum class Command {
RIGHT,
LEFT,
RECORD,
TRANSCRIBE
TRANSCRIBE,
BACK,
HOME
}

View File

@@ -18,5 +18,6 @@ enum class Key(val code: Char) {
LEFT('c'),
RIGHT('d'),
SELECT('e'),
DELETE('f')
DELETE('f'),
BACK('g'),
}

View File

@@ -12,6 +12,7 @@ class KeyCodeMapping(
companion object {
val basic = mapOf(
4 to Key.BACK,
7 to Key.N0,
8 to Key.N1,
9 to Key.N2,

View File

@@ -27,6 +27,7 @@ class KeyCommandResolver (
fun getBasic(): KeyCommandResolver {
return KeyCommandResolver(
onShort = HashMap(mapOf(
Key.BACK to Command.BACK,
Key.N0 to Command.SPACE,
Key.N1 to Command.CHARACTER,
@@ -50,6 +51,8 @@ class KeyCommandResolver (
)),
onLong = HashMap(mapOf(
Key.BACK to Command.HOME,
Key.N0 to Command.NUMBER,
Key.N1 to Command.NUMBER,
Key.N2 to Command.NUMBER,
@@ -66,6 +69,7 @@ class KeyCommandResolver (
)),
afterShort = HashMap(mapOf(
Key.BACK to Command.BACK,
Key.POUND to Command.SHIFT_MODE,
)),