From 6fd7fc07e1a272c772db8ba9946e19e263ac54fc Mon Sep 17 00:00:00 2001 From: payonel Date: Sun, 4 Feb 2018 18:42:54 -0800 Subject: [PATCH] require exact modifier key presses for key combos in /bin/edit --- .../assets/opencomputers/loot/openos/bin/edit.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua index 55860887e..90cd2e9ba 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua @@ -556,7 +556,7 @@ getKeyBindHandler = function(code) if type(keybinds) == "table" and keyBindHandlers[command] then for _, keybind in ipairs(keybinds) do if type(keybind) == "table" then - local alt, control, shift, key + local alt, control, shift, key = false, false, false for _, value in ipairs(keybind) do if value == "alt" then alt = true elseif value == "control" then control = true @@ -564,9 +564,9 @@ getKeyBindHandler = function(code) else key = value end end local keyboardAddress = term.keyboard() - if (not alt or keyboard.isAltDown(keyboardAddress)) and - (not control or keyboard.isControlDown(keyboardAddress)) and - (not shift or keyboard.isShiftDown(keyboardAddress)) and + if (alt == not not keyboard.isAltDown(keyboardAddress)) and + (control == not not keyboard.isControlDown(keyboardAddress)) and + (shift == not not keyboard.isShiftDown(keyboardAddress)) and code == keyboard.keys[key] and #keybind > resultWeight then