mirror of
https://github.com/kepler155c/opus
synced 2025-01-03 20:30:28 +00:00
keyboard handling when not using opus os
This commit is contained in:
parent
47cb7d0fd7
commit
6e6d4b81cd
@ -10,6 +10,17 @@ local modifiers = Util.transpose {
|
|||||||
keys.leftAlt, keys.rightAlt,
|
keys.leftAlt, keys.rightAlt,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not keyboard then -- not running under Opus OS
|
||||||
|
keyboard = { state = { } }
|
||||||
|
|
||||||
|
local Event = require('opus.event')
|
||||||
|
Event.on({ 'key', 'key_up' }, function(event, code)
|
||||||
|
if modifiers[code] then
|
||||||
|
keyboard.state[code] = event == 'key'
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
local input = { }
|
local input = { }
|
||||||
|
|
||||||
function input:modifierPressed()
|
function input:modifierPressed()
|
||||||
|
Loading…
Reference in New Issue
Block a user