This is the code I am using:
next_action = rb.actions.ACTION_KBD_RIGHT
up_action = rb.actions.ACTION_KBD_UP
prev_action = rb.actions.ACTION_KBD_LEFT
down_action = rb.actions.ACTION_KBD_DOWN
select_action = rb.actions.ACTION_KBD_SELECT
safe_exit_action = rb.actions.ACTION_KBD_LEFT
----
----
----
local action = rb.get_action(rb.contexts.CONTEXT_KEYBOARD, -1)
if action == select_action then
printf("S")
elseif action == down_action then
printf("D")
elseif action == up_action then
printf("U")
elseif action == next_action then
printf("N")
elseif action == prev_action then
bRun = false
end
But only "S" or "N" gets printed as soon as the keys are pressed.
"D" and "U" does not display immediately. They only appear after "S" or "N" are pressed.
So for example if I press D twice and then press N then the output will be
D
D
N