keyboard handling when not using opus os

This commit is contained in:
kepler155c@gmail.com 2019-08-03 08:33:32 -06:00
parent 47cb7d0fd7
commit 6e6d4b81cd
1 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,17 @@ local modifiers = Util.transpose {
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 = { }
function input:modifierPressed()