Simplify code

key.key is always defined
This commit is contained in:
Grumph 2022-02-14 23:36:39 +01:00
parent 9c4f781979
commit c101859897
1 changed files with 1 additions and 3 deletions

View File

@ -523,12 +523,10 @@ function keygrabber:add_keybinding(key, _keycode, _callback, _description)
description = _description,
on_press = _callback
}
else
_keycode = key.key
end
self._private.keybindings[key.key] = self._private.keybindings[key.key] or {}
table.insert(self._private.keybindings[_keycode], key)
table.insert(self._private.keybindings[key.key], key)
if self.export_keybindings then
add_root_keybindings(self, {key})