From 7796c63291b88fe3aa49d2b5e1e3d2aaed2320d4 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 11 Jan 2024 12:19:33 -0500 Subject: [PATCH] Change for the search keyboard layout (#262) --- CHANGELOG.md | 1 + .../Screens/SearchScreen/SearchScreen.bs | 6 + .../src/config/search-keyboard-layout.json5 | 171 ++++++++++++++++++ 3 files changed, 178 insertions(+) create mode 100644 playlet-lib/src/config/search-keyboard-layout.json5 diff --git a/CHANGELOG.md b/CHANGELOG.md index abfa2aab..daf019f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Bookmarks are now added to the top of the list +- The search screen keyboard to make it easier to clear the search field ## [0.19.0] - 2024-01-10 diff --git a/playlet-lib/src/components/Screens/SearchScreen/SearchScreen.bs b/playlet-lib/src/components/Screens/SearchScreen/SearchScreen.bs index ff4d2ee3..5e336a2c 100644 --- a/playlet-lib/src/components/Screens/SearchScreen/SearchScreen.bs +++ b/playlet-lib/src/components/Screens/SearchScreen/SearchScreen.bs @@ -21,6 +21,8 @@ function Init() m.rowList.screen = m.top + m.keyboard.keyGrid.keyDefinitionUri = "libpkg:/config/search-keyboard-layout.json5" + textEditBox = m.keyboard.textEditBox textEditBox.voiceEntryType = "generic" textEditBox.voiceEnabled = true @@ -301,6 +303,10 @@ function OnkeyEvent(key as string, press as boolean) as boolean if m.currentNavigtionNode.isSameNode(m.suggestions) OnSearchButtonFocused() end if + if m.currentNavigtionNode.isSameNode(m.keyboard) + ' First section, grid, row and key + m.keyboard.keyGrid.jumpToKey = [0, 0, 0, 0] + end if return true end if return false diff --git a/playlet-lib/src/config/search-keyboard-layout.json5 b/playlet-lib/src/config/search-keyboard-layout.json5 new file mode 100644 index 00000000..c4e90c11 --- /dev/null +++ b/playlet-lib/src/config/search-keyboard-layout.json5 @@ -0,0 +1,171 @@ +// This is a copy of the MiniKeyboard definition found here +// https://developer.roku.com/en-ca/docs/references/scenegraph/dynamic-voice-keyboard-nodes/key-definition-file.md#minikeyboard +// The last row of keys was moved to be the first row. +{ + keyboardWidthFHD: 576, + keyboardHeightFHD: 630, + keyboardWidthHD: 384, + keyboardHeightHD: 420, + sections: [ + { + grids: [ + { + rows: [ + { + keys: [ + { + icon: "theme:DKB_ClearKeyBitmap", + focusIcon: "theme:DKB_ClearKeyFocusBitmap", + strOut: "clear", + }, + { + icon: "theme:DKB_SpaceKeyBitmap", + focusIcon: "theme:DKB_SpaceKeyFocusBitmap", + strOut: "space", + }, + { + icon: "theme:DKB_DeleteKeyBitmap", + focusIcon: "theme:DKB_DeleteKeyFocusBitmap", + autoRepeat: 1, + strOut: "backspace", + }, + ], + }, + { + keys: [ + { + label: "a", + }, + { + label: "b", + }, + { + label: "c", + }, + { + label: "d", + }, + { + label: "e", + }, + { + label: "f", + }, + ], + }, + { + keys: [ + { + label: "g", + }, + { + label: "h", + }, + { + label: "i", + }, + { + label: "j", + }, + { + label: "k", + }, + { + label: "l", + }, + ], + }, + { + keys: [ + { + label: "m", + }, + { + label: "n", + }, + { + label: "o", + }, + { + label: "p", + }, + { + label: "q", + }, + { + label: "r", + }, + ], + }, + { + keys: [ + { + label: "s", + }, + { + label: "t", + }, + { + label: "u", + }, + { + label: "v", + }, + { + label: "w", + }, + { + label: "x", + }, + ], + }, + { + keys: [ + { + label: "y", + }, + { + label: "z", + }, + { + label: "1", + }, + { + label: "2", + }, + { + label: "3", + }, + { + label: "4", + }, + ], + }, + { + keys: [ + { + label: "5", + }, + { + label: "6", + }, + { + label: "7", + }, + { + label: "8", + }, + { + label: "9", + }, + { + label: "0", + }, + ], + }, + ], + }, + ], + }, + ], +}