support for num pad
[?]
Jul 8, 2023, 1:40 AM
TICN4RV7ZJPMNPITDLLG7A4XWP2VDWFZKHASDZAZ2RFYFJQVM4OACDependencies
- [2]
3HDWCPDIbugfix: include shift keys in modifier_down - [*]
6LJZN727handle chords - [*]
AVTNUQYRbasic test-enabled framework
Change contents
- edit in keychord.lua at line 15[5.1731][4.881]
if love.keyboard.isModifierActive then -- waiting for LÖVE v12if key:match('^kp') thenkey = App.translate_numlock(key)endend - edit in keychord.lua at line 61
-- mappings only to non-printable keys; leave out mappings that textinput will handleNumlock_off = {kp0='insert',kp1='end',kp2='down',kp3='pagedown',kp4='left',-- numpad 5 translates to nothingkp6='right',kp7='home',kp8='up',kp9='pageup',['kp.']='delete',-- LÖVE handles keypad operators in textinput-- what's with the `kp=` and `kp,` keys? None of my keyboards have one.-- Hopefully LÖVE handles them as well in textinput.kpenter='enter',kpdel='delete',}Numlock_on = {kpenter='enter',kpdel='delete',}function App.translate_numlock(key)if love.keyboard.isModifierActive('numlock') thenreturn Numlock_on[key] or keyelsereturn Numlock_off[key] or keyendreturn keyend