move fake event handling to ui.lua

inputevent.lua now only forwards events
pull/2/merge
Qingping Hou 12 years ago
parent 68cc9b9cf4
commit 55b2813b32

@ -390,18 +390,9 @@ function Input:waitEvent(timeout_us, timeout_s)
keycode = self.rotation_map[self.rotation][keycode]
end
if keycode == "IntoSS" then
Device:intoScreenSaver()
return
elseif keycode == "OutOfSS" then
Device:outofScreenSaver()
return
elseif keycode == "Charging" then
Device:usbPlugIn()
return
elseif keycode == "NotCharging" then
Device:usbPlugOut()
return
if keycode == "IntoSS" or keycode == "OutOfSS"
or keycode == "Charging" or keycode == "NotCharging" then
return keycode
end
-- handle modifier keys

@ -205,7 +205,17 @@ function UIManager:run()
-- delegate input_event to handler
if input_event then
DEBUG(input_event)
self:sendEvent(input_event)
if input_event == "IntoSS" then
Device:intoScreenSaver()
elseif input_event == "OutOfSS" then
Device:outofScreenSaver()
elseif input_event == "Charging" then
Device:usbPlugIn()
elseif input_event == "NotCharging" then
Device:usbPlugOut()
else
self:sendEvent(input_event)
end
end
end
end

Loading…
Cancel
Save