1
0
mirror of https://github.com/kepler155c/opus synced 2025-11-11 13:03:04 +00:00

tweaks + Anavrins disk usage system module

This commit is contained in:
kepler155c@gmail.com
2019-07-02 10:19:08 -04:00
parent aec5ac0121
commit 1dcb6d67b7
7 changed files with 200 additions and 54 deletions

View File

@@ -78,16 +78,12 @@ local modifiers = Util.transpose {
keys.leftAlt, keys.rightAlt,
}
kernel.hook({ 'key', 'key_up', 'char', 'paste' }, function(event, eventData)
kernel.hook({ 'key', 'char', 'paste' }, function(event, eventData)
local code = eventData[1]
-- maintain global keyboard modifier state
if modifiers[code] then
if event == 'key' then
keyboard.state[code] = true
elseif event == 'key_up' then
keyboard.state[code] = nil
end
if event == 'key' and modifiers[code] then
keyboard.state[code] = true
end
-- and fire hotkeys
@@ -99,6 +95,14 @@ kernel.hook({ 'key', 'key_up', 'char', 'paste' }, function(event, eventData)
end
end)
kernel.hook('key_up', function(_, eventData)
local code = eventData[1]
if modifiers[code] then
keyboard.state[code] = nil
end
end)
kernel.hook({ 'mouse_click', 'mouse_up', 'mouse_drag' }, function(event, eventData)
local button = eventData[1]
if event == 'mouse_click' then