Add key event handler for keyboard
This commit is contained in:
parent
fc121adcb8
commit
dff74ce8b4
@ -480,6 +480,19 @@ local PAGES = {
|
|||||||
|
|
||||||
local keyboardList = Padding:new{
|
local keyboardList = Padding:new{
|
||||||
onClick = ignoreClick,
|
onClick = ignoreClick,
|
||||||
|
onKey = function(elem, keyCode, held)
|
||||||
|
if keyCode == keys.backspace then
|
||||||
|
pageState.filter = fitText(pageState.filter, math.max(0, #pageState.filter - 1))
|
||||||
|
pageState.reloadState()
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end,
|
||||||
|
onChar = function(elem, charCode)
|
||||||
|
pageState.filter = pageState.filter..charCode
|
||||||
|
pageState.reloadState()
|
||||||
|
return true
|
||||||
|
end,
|
||||||
bgColor = KEYBOARD_BG_COLOR,
|
bgColor = KEYBOARD_BG_COLOR,
|
||||||
left = KEYBOARD_HPAD,
|
left = KEYBOARD_HPAD,
|
||||||
right = KEYBOARD_HPAD,
|
right = KEYBOARD_HPAD,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user