Skip to content

Commit

Permalink
fix: KP_0 - KP_9 could not input
Browse files Browse the repository at this point in the history
  • Loading branch information
tumuyan committed Jul 21, 2022
1 parent 0572618 commit 53b22c3
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion app/src/main/java/com/osfans/trime/ime/enums/Keycode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ enum class Keycode {
reverseMap[_8] = "8"
reverseMap[_9] = "9"

reverseMap[KP_0] = "0"
reverseMap[KP_1] = "1"
reverseMap[KP_2] = "2"
reverseMap[KP_3] = "3"
reverseMap[KP_4] = "4"
reverseMap[KP_5] = "5"
reverseMap[KP_6] = "6"
reverseMap[KP_7] = "7"
reverseMap[KP_8] = "8"
reverseMap[KP_9] = "9"
reverseMap[KP_8] = "8"
reverseMap[KP_9] = "9"

reverseMap[exclam] = "!"
reverseMap[quotedbl] = "\""
reverseMap[dollar] = "$"
Expand All @@ -107,7 +120,11 @@ enum class Keycode {
}

fun hasSymbolLabel(keycode: Int): Boolean {
return keycode >= A.ordinal && keycode < values().size
if (keycode < 0 || keycode > values().size)
return false

return keycode >= A.ordinal ||
(keycode >= KP_0.ordinal && keycode <= KP_9.ordinal)
}

fun getSymbolLabell(keycode: Keycode): String {
Expand Down

0 comments on commit 53b22c3

Please sign in to comment.