mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Better-than-nothing key repeat handling.
Mainly aimed at the Forma. Still fairly terrible, as these things goes ;p.
This commit is contained in:
@@ -228,6 +228,20 @@ function InputContainer:onKeyPress(key)
|
||||
end
|
||||
end
|
||||
|
||||
-- NOTE: Currently a verbatim copy of onKeyPress ;).
|
||||
function InputContainer:onKeyRepeat(key)
|
||||
for name, seq in pairs(self.key_events) do
|
||||
if not seq.is_inactive then
|
||||
for _, oneseq in ipairs(seq) do
|
||||
if key:match(oneseq) then
|
||||
local eventname = seq.event or name
|
||||
return self:handleEvent(Event:new(eventname, seq.args, key))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function InputContainer:onGesture(ev)
|
||||
for _, tzone in ipairs(self._ordered_touch_zones) do
|
||||
if tzone.gs_range:match(ev) and tzone.handler(ev) then
|
||||
|
||||
Reference in New Issue
Block a user