bugfix: include shift keys in modifier_down
[?]
May 29, 2022, 6:01 AM
3HDWCPDIQ2R7N63GQIABVE5L63U42CLKNLVJQFKBOZH4BMJQA5XACDependencies
- [2]
G6OYAYHUpaste in text with M-v - [3]
6LJZN727handle chords - [4]
AVTNUQYRbasic test-enabled framework
Change contents
- edit in keychord.lua at line 2
Modifiers = {'lctrl', 'rctrl', 'lalt', 'ralt', 'lshift', 'rshift', 'lgui', 'rgui'} - replacement in keychord.lua at line 6
if key == 'lctrl' or key == 'rctrl' or key == 'lalt' or key == 'ralt' or key == 'lshift' or key == 'rshift' or key == 'lgui' or key == 'rgui' thenif array.find(Modifiers, key) then - replacement in keychord.lua at line 33
local down = love.keyboard.isDownreturn down('lctrl') or down('rctrl') or down('lalt') or down('ralt') or down('lgui') or down('rgui')return array.any(Modifiers, love.keyboard.isDown)endarray = {}function array.find(arr, elem)for i,x in ipairs(arr) doif x == elem thenreturn iendendreturn nilendfunction array.any(arr, f)for i,x in ipairs(arr) dolocal result = f(x)if result thenreturn resultendendreturn false