|
|
|
@ -265,6 +265,10 @@ function Input:handleKeyBoardEv(ev)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if type(keycode) == "function" then
|
|
|
|
|
return keycode(ev)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- take device rotation into account
|
|
|
|
|
if self.rotation_map[self.device.screen:getRotationMode()][keycode] then
|
|
|
|
|
keycode = self.rotation_map[self.device.screen:getRotationMode()][keycode]
|
|
|
|
@ -275,15 +279,6 @@ function Input:handleKeyBoardEv(ev)
|
|
|
|
|
return keycode
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Kobo sleep cover
|
|
|
|
|
if keycode == "Power_SleepCover" then
|
|
|
|
|
if ev.value == EVENT_VALUE_KEY_PRESS then
|
|
|
|
|
return "SleepCoverClosed"
|
|
|
|
|
else
|
|
|
|
|
return "SleepCoverOpened"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if keycode == "Power" then
|
|
|
|
|
-- Kobo generates Power keycode only, we need to decide whether it's
|
|
|
|
|
-- power-on or power-off ourselves.
|
|
|
|
@ -300,10 +295,6 @@ function Input:handleKeyBoardEv(ev)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if ev.value == EVENT_VALUE_KEY_RELEASE and keycode == "Light" then
|
|
|
|
|
return keycode
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- handle modifier keys
|
|
|
|
|
if self.modifiers[keycode] ~= nil then
|
|
|
|
|
if ev.value == EVENT_VALUE_KEY_PRESS then
|
|
|
|
@ -538,6 +529,14 @@ function Input:cleanAbsxy()
|
|
|
|
|
self:setCurrentMtSlot("abs_y", nil)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Input:isEvKeyPress(ev)
|
|
|
|
|
return ev.value == EVENT_VALUE_KEY_PRESS
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Input:isEvKeyRelease(ev)
|
|
|
|
|
return ev.value == EVENT_VALUE_KEY_RELEASE
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- main event handling:
|
|
|
|
|
|
|
|
|
|