Add mod1 (alt) support for key hooks
This commit is contained in:
parent
591b153dce
commit
f7bf7279c3
14
base.lua
14
base.lua
|
@ -109,13 +109,15 @@ local function activateKeyboard(data)
|
||||||
if (not (data._internal.private_data.enable_keyboard == false)) and data.visible == true then
|
if (not (data._internal.private_data.enable_keyboard == false)) and data.visible == true then
|
||||||
capi.keygrabber.run(function(mod, key, event)
|
capi.keygrabber.run(function(mod, key, event)
|
||||||
for k,v in pairs(data._internal.filter_hooks or {}) do --TODO modkeys
|
for k,v in pairs(data._internal.filter_hooks or {}) do --TODO modkeys
|
||||||
if k.key == "Mod4" and (key == "End" or key == "Super_L") then
|
if (k.key == "Mod4" or k.key == "Mod1") and (key == "End" or key == "Super_L" or key == "Alt_L") then
|
||||||
local found = false
|
local found = false
|
||||||
for k3,v3 in ipairs(mod) do
|
for k3,v3 in ipairs(mod) do
|
||||||
if v3 == "Mod4" and event == k.event then
|
for k4,v4 in ipairs({"Mod4","Mod1"})do
|
||||||
local retval,self = v(data,mod)
|
if v3 == v4 and event == k.event then
|
||||||
if self and type(self) == "table" then
|
local retval,self = v(data,mod)
|
||||||
data = self
|
if self and type(self) == "table" then
|
||||||
|
data = self
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -140,7 +142,7 @@ local function activateKeyboard(data)
|
||||||
if data.sub_menu_on == module.event.BUTTON1 then
|
if data.sub_menu_on == module.event.BUTTON1 then
|
||||||
item_mod.execute_sub_menu(data,data._current_item)
|
item_mod.execute_sub_menu(data,data._current_item)
|
||||||
else
|
else
|
||||||
data._current_item.button1()
|
data._current_item.button1(data,data._current_item)
|
||||||
data.visible = false
|
data.visible = false
|
||||||
end
|
end
|
||||||
elseif key == 'Escape' or (key == 'Tab' and data.filter_string == "") then
|
elseif key == 'Escape' or (key == 'Tab' and data.filter_string == "") then
|
||||||
|
|
Loading…
Reference in New Issue