mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
mod: handle shift and alt key events in adjustKeyEvents()
This commit is contained in:
14
inputbox.lua
14
inputbox.lua
@@ -98,14 +98,10 @@ function InputBox:input(ypos, height, title, d_text)
|
||||
end
|
||||
|
||||
local ev = input.waitForEvent()
|
||||
ev.code = adjustKeyEvents(ev)
|
||||
if ev.type == EV_KEY and ev.value == EVENT_VALUE_KEY_PRESS then
|
||||
ev.code = adjustFWKey(ev.code)
|
||||
--local secs, usecs = util.gettime()
|
||||
if ev.code == KEY_SHIFT then
|
||||
Keys.shiftmode = true
|
||||
elseif ev.code == KEY_ALT then
|
||||
Keys.altmode = true
|
||||
elseif ev.code == KEY_FW_UP then
|
||||
if ev.code == KEY_FW_UP then
|
||||
elseif ev.code == KEY_FW_DOWN then
|
||||
elseif ev.code == KEY_A then
|
||||
self:addChar("a")
|
||||
@@ -198,12 +194,6 @@ function InputBox:input(ypos, height, title, d_text)
|
||||
--local nsecs, nusecs = util.gettime()
|
||||
--local dur = (nsecs - secs) * 1000000 + nusecs - usecs
|
||||
--print("E: T="..ev.type.." V="..ev.value.." C="..ev.code.." DUR="..dur)
|
||||
elseif ev.type == EV_KEY and ev.value == EVENT_VALUE_KEY_RELEASE
|
||||
and ev.code == KEY_SHIFT then
|
||||
Keys.shiftmode = false
|
||||
elseif ev.type == EV_KEY and ev.value == EVENT_VALUE_KEY_RELEASE
|
||||
and ev.code == KEY_ALT then
|
||||
Keys.altmode = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user