add inactive touch zones around buttons on Kindle Voyage

This should fix #1801.
This commit is contained in:
chrox
2016-07-01 23:47:29 +08:00
parent 30a9f73bb2
commit dee65a7999
2 changed files with 44 additions and 0 deletions

View File

@@ -159,10 +159,22 @@ function Input:registerEventAdjustHook(hook, hook_params)
end
end
function Input:registerGestureAdjustHook(hook, hook_params)
local old = self.gestureAdjustHook
self.gestureAdjustHook = function(this, ges)
old(this, ges)
hook(this, ges, hook_params)
end
end
function Input:eventAdjustHook(ev)
-- do nothing by default
end
function Input:gestureAdjustHook(ges)
-- do nothing by default
end
-- catalogue of predefined hooks:
function Input:adjustTouchSwitchXY(ev)
if ev.type == EV_ABS then
@@ -363,6 +375,7 @@ function Input:handleTouchEv(ev)
self.MTSlots = {}
if touch_ges then
--DEBUG("ges", touch_ges)
self:gestureAdjustHook(touch_ges)
return Event:new("Gesture",
self.gesture_detector:adjustGesCoordinate(touch_ges)
)
@@ -427,6 +440,7 @@ function Input:handleTouchEvPhoenix(ev)
local touch_ges = self.gesture_detector:feedEvent(self.MTSlots)
self.MTSlots = {}
if touch_ges then
self:gestureAdjustHook(touch_ges)
return Event:new("Gesture",
self.gesture_detector:adjustGesCoordinate(touch_ges)
)
@@ -495,6 +509,7 @@ function Input:waitEvent(timeout_us)
-- Do we really need to clear all setTimeout after
-- decided a gesture? FIXME
self.timer_callbacks = {}
self:gestureAdjustHook(touch_ges)
return Event:new("Gesture",
self.gesture_detector:adjustGesCoordinate(touch_ges)
)