It'll only work after LÖVE v12 comes out.
TICN4RV7ZJPMNPITDLLG7A4XWP2VDWFZKHASDZAZ2RFYFJQVM4OAC
-- mappings only to non-printable keys; leave out mappings that textinput will handle
Numlock_off = {
kp0='insert',
kp1='end',
kp2='down',
kp3='pagedown',
kp4='left',
-- numpad 5 translates to nothing
kp6='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') then
return Numlock_on[key] or key
else
return Numlock_off[key] or key
end
return key
end