love.keypressed: problem with lshift/rshift/ralt
Posted: Tue Dec 01, 2015 6:53 am
Hi,
I'm having a problem with the order and combination of pressed keys:
Both shift keys doesn't combine with the keypad-keys, but the holded shift key triggers keypressed again right after releasing the keypad key.
For better understanding I made a simple test script:
Pressing the key in following order:
lshift down, right arrow down and up, kp5 down and up, lshift up
I would expect the following output:
lshift +lshift
right +lshift
kp5 +lshift
But instead that, I get the following:
lshift +lshift
right +lshift
kp5
lshift +lshift
I am playing around with a rougue-like game, and shift+direction should let my character run. Am I missing something?
And another question: when I press ralt, the script outputs 'ralt +lctrl +ralt'. Is there a reason, that pressing ralt triggers lctrl?
I have tested this on 0.9.2win64 and 0.10.0win32 (windows7x64 with german locale/keyboard).
I'm having a problem with the order and combination of pressed keys:
Both shift keys doesn't combine with the keypad-keys, but the holded shift key triggers keypressed again right after releasing the keypad key.
For better understanding I made a simple test script:
Code: Select all
io.stdout:setvbuf( 'no' );
function love.keypressed( key, isrepeat )
keys = key;
if isrepeat then keys = keys .. ' (repeat)'; end;
if love.keyboard.isDown( 'lshift' ) then keys = keys .. ' +lshift'; end;
if love.keyboard.isDown( 'rshift' ) then keys = keys .. ' +rshift'; end;
if love.keyboard.isDown( 'lctrl' ) then keys = keys .. ' +lctrl'; end;
if love.keyboard.isDown( 'rctrl' ) then keys = keys .. ' +rctrl'; end;
if love.keyboard.isDown( 'lalt' ) then keys = keys .. ' +lalt'; end;
if love.keyboard.isDown( 'ralt' ) then keys = keys .. ' +ralt'; end;
print( keys );
end
lshift down, right arrow down and up, kp5 down and up, lshift up
I would expect the following output:
lshift +lshift
right +lshift
kp5 +lshift
But instead that, I get the following:
lshift +lshift
right +lshift
kp5
lshift +lshift
I am playing around with a rougue-like game, and shift+direction should let my character run. Am I missing something?
And another question: when I press ralt, the script outputs 'ralt +lctrl +ralt'. Is there a reason, that pressing ralt triggers lctrl?
I have tested this on 0.9.2win64 and 0.10.0win32 (windows7x64 with german locale/keyboard).