mirror of
https://github.com/kepler155c/opus
synced 2025-01-03 20:30:28 +00:00
input rework - again
This commit is contained in:
parent
310879a801
commit
82ec4db50f
@ -92,28 +92,32 @@ function input:translate(event, code, p1, p2)
|
|||||||
return { code = ch }
|
return { code = ch }
|
||||||
end
|
end
|
||||||
elseif code then
|
elseif code then
|
||||||
self.state[code] = true
|
--self.fired = true
|
||||||
self.fired = false
|
local ch = input:toCode(keys.getName(code), code)
|
||||||
|
if #ch ~= 1 then
|
||||||
|
return { code = ch }
|
||||||
|
end
|
||||||
|
-- self.state[code] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif event == 'char' then
|
elseif event == 'char' then
|
||||||
local combo = isCombo()
|
local combo = isCombo()
|
||||||
if not self.fired then
|
--if not self.fired then
|
||||||
if combo or not (keyboard.state[keys.leftCtrl] or keyboard.state[keys.rightCtrl]) then
|
if combo or not (keyboard.state[keys.leftCtrl] or keyboard.state[keys.rightCtrl]) then
|
||||||
self.fired = not combo
|
self.fired = not combo
|
||||||
return { code = event, ch = code }
|
return { code = event, ch = code }
|
||||||
end
|
--end
|
||||||
-- return { code = event, ch = input:toCode(code) }
|
-- return { code = event, ch = input:toCode(code) }
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif event == 'key_up' then
|
elseif event == 'key_upx' then
|
||||||
if not self.fired then
|
if not self.fired then
|
||||||
if self.state[code] then
|
--if self.state[code] then
|
||||||
self.fired = true
|
self.fired = true
|
||||||
local ch = input:toCode(keys.getName(code), code)
|
local ch = input:toCode(keys.getName(code), code)
|
||||||
self.state[code] = nil
|
self.state[code] = nil
|
||||||
return { code = ch }
|
return { code = ch }
|
||||||
end
|
--end
|
||||||
end
|
end
|
||||||
self.state[code] = nil
|
self.state[code] = nil
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user