diff --git a/components/keyboards/IntegerKeyboard.bs b/components/keyboards/IntegerKeyboard.bs new file mode 100644 index 000000000..2f50a8999 --- /dev/null +++ b/components/keyboards/IntegerKeyboard.bs @@ -0,0 +1,81 @@ +sub init() + m.top.keyGrid.keyDefinitionUri = "pkg:/components/keyboards/IntegerKeyboardKDF.json" +end sub + +function onKeyEvent(key as string, press as boolean) as boolean + if key = "back" + m.top.escape = key + return true + end if + + if not press then return false + + if key = "left" + if m.top.textEditBox.hasFocus() + m.top.escape = key + return true + else if m.top.focusedChild.keyFocused = "1" + m.top.escape = key + return true + else if m.top.focusedChild.keyFocused = "4" + m.top.escape = key + return true + else if m.top.focusedChild.keyFocused = "7" + m.top.escape = key + return true + else if m.top.focusedChild.keyFocused = "backspace" + m.top.escape = key + return true + end if + end if + + if key = "right" + if m.top.textEditBox.hasFocus() + m.top.escape = key + return true + else if m.top.focusedChild.keyFocused = "3" + m.top.escape = key + return true + else if m.top.focusedChild.keyFocused = "6" + m.top.escape = key + return true + else if m.top.focusedChild.keyFocused = "9" + m.top.escape = key + return true + else if m.top.focusedChild.keyFocused = "submit" + m.top.escape = key + return true + end if + end if + + if key = "up" + if m.top.textEditBox.hasFocus() + m.top.escape = key + return true + end if + end if + + if key = "down" + if m.top.focusedChild.keyFocused = "0" + m.top.escape = key + return true + else if m.top.focusedChild.keyFocused = "backspace" + m.top.escape = key + return true + else if m.top.focusedChild.keyFocused = "submit" + m.top.escape = key + return true + end if + end if + + return false +end function + +function keySelected(key as string) as boolean + if key = "submit" + m.top.submit = true + return true + end if + + return false +end function diff --git a/components/keyboards/IntegerKeyboard.xml b/components/keyboards/IntegerKeyboard.xml new file mode 100644 index 000000000..dd72c68b5 --- /dev/null +++ b/components/keyboards/IntegerKeyboard.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/components/keyboards/IntegerKeyboardKDF.json b/components/keyboards/IntegerKeyboardKDF.json new file mode 100644 index 000000000..e79ceb17c --- /dev/null +++ b/components/keyboards/IntegerKeyboardKDF.json @@ -0,0 +1,73 @@ +{ + "keyboardWidthFHD": 495, + "keyboardHeightFHD": 300, + "keyboardWidthHD": 324, + "keyboardHeightHD": 200, + "sections": [ + { + "grids": [ + { + "rows": [ + { + "keys": [ + { + "label": "1" + }, + { + "label": "2" + }, + { + "label": "3" + } + ] + }, + { + "keys": [ + { + "label": "4" + }, + { + "label": "5" + }, + { + "label": "6" + } + ] + }, + { + "keys": [ + { + "label": "7" + }, + { + "label": "8" + }, + { + "label": "9" + } + ] + }, + { + "keys": [ + { + "icon": "theme:DKB_DeleteKeyBitmap", + "focusIcon": "theme:DKB_DeleteKeyFocusBitmap", + "autoRepeat": 1, + "strOut": "backspace" + }, + { + "label": "0" + }, + { + "icon": "pkg:/images/icons/check_white.png", + "focusIcon": "pkg:/images/icons/check_black.png", + "strOut": "submit" + } + ] + } + ] + } + ] + } + ] +} diff --git a/components/settings/settings.xml b/components/settings/settings.xml index f35a6aa02..b34a4139c 100644 --- a/components/settings/settings.xml +++ b/components/settings/settings.xml @@ -35,7 +35,7 @@ - + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2f8166801..38749f00d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,6 @@ "@rokucommunity/bslib": "0.1.1", "bgv": "npm:button-group-vert@1.0.2", "brighterscript-formatter": "1.6.34", - "intKeyboard": "npm:integer-keyboard@1.0.12", "log": "npm:roku-log@0.11.1", "sob": "npm:slide-out-button@1.0.1" }, @@ -2206,12 +2205,6 @@ "sanitize-html": "^1.13.0" } }, - "node_modules/intKeyboard": { - "name": "integer-keyboard", - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/integer-keyboard/-/integer-keyboard-1.0.12.tgz", - "integrity": "sha512-DSLyd/PvtEBfc4grICTxSLu94Yo/Vm6rNerRZRbbzRrP0HQ9pYaquoY2RD9x6gAmica43gsFimScNpuRYVe54w==" - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", diff --git a/package.json b/package.json index 854df4f72..b94b6cad8 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "@rokucommunity/bslib": "0.1.1", "bgv": "npm:button-group-vert@1.0.2", "brighterscript-formatter": "1.6.34", - "intKeyboard": "npm:integer-keyboard@1.0.12", "log": "npm:roku-log@0.11.1", "sob": "npm:slide-out-button@1.0.1" },