For shift we'll mostly rely on love.textinput. For the rest I've created a simple driver.
6LJZN727CRPYR34LV75CQF55YZI3E7MGESYZSFSYAE73SNEZE3FAC function love.keypressed(key, scancode, isrepeat)if key == 'return' then
function love.textinput(t)lines[#lines] = lines[#lines]..tendfunction keychord_pressed(chord)-- Don't handle any keys here that would trigger love.textinput above.if chord == 'return' then
elseif key == 'space' thenlines[#lines] = lines[#lines]..' 'elseif key == 'lctrl' or key == 'rctrl' then-- do nothingelseif key == 'lalt' or key == 'ralt' then-- do nothingelseif key == 'lshift' or key == 'rshift' then-- do nothingelseif love.keyboard.isDown('lctrl') or love.keyboard.isDown('rctrl') thenif key == 'r' thenlines[#lines+1] = eval(lines[#lines])[1]lines[#lines+1] = ''endelselines[#lines] = lines[#lines]..key
elseif chord == 'C-r' thenlines[#lines+1] = eval(lines[#lines])[1]lines[#lines+1] = ''
-- Keyboard driverfunction love.keypressed(key, scancode, isrepeat)if key == 'lctrl' or key == 'rctrl' or key == 'lalt' or key == 'ralt' or key == 'lshift' or key == 'rshift' or key == 'lgui' or key == 'rgui' then-- do nothing when the modifier is pressedend-- include the modifier(s) when the non-modifer is pressedkeychord_pressed(combine_modifiers(key))endfunction combine_modifiers(key)local result = ''local down = love.keyboard.isDownif down('lctrl') or down('rctrl') thenresult = result..'C-'endif down('lalt') or down('ralt') thenresult = result..'M-'endif down('lgui') or down('rgui') thenresult = result..'S-'endresult = result..keyreturn resultend