From 79a53769de7848618847e062f6e8b18f7c6cbea9 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 28 Apr 2009 22:48:24 +0200 Subject: [PATCH] awful.key: fix modifiers matching Signed-off-by: Julien Danjou --- lib/awful/key.lua.in | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/awful/key.lua.in b/lib/awful/key.lua.in index c961ab5eb..e0d777c62 100644 --- a/lib/awful/key.lua.in +++ b/lib/awful/key.lua.in @@ -45,22 +45,18 @@ function match(key, pressed_mod, pressed_key) if pressed_key ~= key.key then return false end -- Then, compare mod local mod = key.modifiers - local nbmod = 0 -- For each modifier of the key object, check that the modifier has been -- pressed. for _, m in ipairs(mod) do -- Has it been pressed? - if util.table.hasitem(pressed_mod, m) then - -- Yes, the number of modifier correctly pressed++ - nbmod = nbmod + 1 - else + if not util.table.hasitem(pressed_mod, m) then -- No, so this is failure! return false end end -- If the number of pressed modifier is ~=, it is probably >, so this is not -- the same, return false. - if nbmod ~= #mod then + if #pressed_mod ~= #mod then return false end return true