|
|
@ -62,6 +62,8 @@ an interface to get input events
|
|
|
|
local Input = {
|
|
|
|
local Input = {
|
|
|
|
-- this depends on keyboard layout and should be overridden:
|
|
|
|
-- this depends on keyboard layout and should be overridden:
|
|
|
|
event_map = {},
|
|
|
|
event_map = {},
|
|
|
|
|
|
|
|
-- adapters are post processing functions that transform a given event to another event
|
|
|
|
|
|
|
|
event_map_adapter = {},
|
|
|
|
|
|
|
|
|
|
|
|
group = {
|
|
|
|
group = {
|
|
|
|
Cursor = { "Up", "Down", "Left", "Right" },
|
|
|
|
Cursor = { "Up", "Down", "Left", "Right" },
|
|
|
@ -266,8 +268,8 @@ function Input:handleKeyBoardEv(ev)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if type(keycode) == "function" then
|
|
|
|
if self.event_map_adapter[keycode] then
|
|
|
|
return keycode(ev)
|
|
|
|
return self.event_map_adapter[keycode](ev)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- take device rotation into account
|
|
|
|
-- take device rotation into account
|
|
|
|