Better-than-nothing key repeat handling.

Mainly aimed at the Forma.
Still fairly terrible, as these things goes ;p.
This commit is contained in:
NiLuJe
2019-01-11 16:39:00 +01:00
parent cd4181ba49
commit 81b255cb85
2 changed files with 37 additions and 0 deletions

View File

@@ -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