mod: handle shift and alt key events in adjustKeyEvents()

This commit is contained in:
Qingping Hou
2012-03-02 18:38:34 +08:00
parent 1713e2ab0b
commit 6614bbe33d
6 changed files with 34 additions and 70 deletions

View File

@@ -167,13 +167,9 @@ function SelectMenu:choose(ypos, height)
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)
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
prevItem()
elseif ev.code == KEY_FW_DOWN then
nextItem()
@@ -205,12 +201,6 @@ function SelectMenu:choose(ypos, height)
elseif ev.code == KEY_BACK then
return nil
end
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