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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user