Merge pull request #1080 from houqp/fix

fix kobo aura hd input handling
pull/1085/head
Huang Xin 10 years ago
commit 62eef02c86

@ -155,10 +155,15 @@ end
-- catalogue of predefined hooks:
function Input:adjustTouchSwitchXY(ev)
if ev.type == EV_ABS then
if ev.code == ABS_X then ev.code = ABS_Y end
if ev.code == ABS_Y then ev.code = ABS_X end
if ev.code == ABS_MT_POSITION_X then ev.code = ABS_MT_POSITION_Y end
if ev.code == ABS_MT_POSITION_Y then ev.code = ABS_MT_POSITION_X end
if ev.code == ABS_X then
ev.code = ABS_Y
elseif ev.code == ABS_Y then
ev.code = ABS_X
elseif ev.code == ABS_MT_POSITION_X then
ev.code = ABS_MT_POSITION_Y
elseif ev.code == ABS_MT_POSITION_Y then
ev.code = ABS_MT_POSITION_X
end
end
end
function Input:adjustTouchScale(ev, by)
@ -172,17 +177,15 @@ function Input:adjustTouchScale(ev, by)
end
end
function Input:adjustTouchMirrorX(ev, width)
if ev.type == EV_ABS then
if ev.code == ABS_X or ev.code == ABS_MT_POSITION_X then
ev.value = width - ev.value
end
if ev.type == EV_ABS
and (ev.code == ABS_X or ev.code == ABS_MT_POSITION_X) then
ev.value = width - ev.value
end
end
function Input:adjustTouchMirrorY(ev, height)
if ev.type == EV_ABS then
if ev.code == ABS_Y or ev.code == ABS_MT_POSITION_Y then
ev.value = height - ev.value
end
if ev.type == EV_ABS
and (ev.code == ABS_Y or ev.code == ABS_MT_POSITION_Y) then
ev.value = height - ev.value
end
end
function Input:adjustTouchTranslate(ev, by)

@ -76,7 +76,7 @@ function Kobo:init()
-- it's called KOBO_TOUCH_MIRRORED in defaults.lua, but what it
-- actually did in its original implementation was to switch X/Y.
if self.touch_switch_xy and not KOBO_TOUCH_MIRRORED
if self.touch_switch_xy and not KOBO_TOUCH_MIRRORED
or not self.touch_switch_xy and KOBO_TOUCH_MIRRORED
then
self.input:registerEventAdjustHook(self.input.adjustTouchSwitchXY)

@ -98,12 +98,13 @@ function Screensaver:show()
-- first check book cover image
if KOBO_SCREEN_SAVER_LAST_BOOK then
local lastfile = G_reader_settings:readSetting("lastfile")
local data = DocSettings:open(lastfile)
local exclude = data:readSetting("exclude_screensaver")
if not exclude then
self.suspend_msg = self:getCoverImage(lastfile)
if lastfile then
local data = DocSettings:open(lastfile)
local exclude = data:readSetting("exclude_screensaver")
if not exclude then
self.suspend_msg = self:getCoverImage(lastfile)
end
end
end
-- then screensaver directory or file image
if not self.suspend_msg then

Loading…
Cancel
Save