mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
move fake event handling to ui.lua
inputevent.lua now only forwards events
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user