Recognising enter/return button
Posted: Wed Jun 08, 2016 8:01 am
Hey, what code would i have to use in order for livecode to recognize that when someone presses the enter/return button in order to make my game change cards
Questions and answers about the LiveCode platform.
https://forums.livecode.com/
Hi,17rag01l wrote:Hey, what code would i have to use in order for livecode to recognize that when someone presses the enter/return button in order to make my game change cards
Code: Select all
on rawkeyup k
put k
end rawkeyup
Code: Select all
on returnInField
go to next
end returnInField
Code: Select all
65307,SEL,Escape
65293,RET,Return
65421,ENT,Enter
65362,AUP,Arrow Up
65364,ADN,Arrow Down
65361,ALF,Arrow Left
65363,ART,Arrow Right
Code: Select all
on rawkeydown tC -- check for custom commands:
get item 2 of line lineoffset(tC & ",", the RawKeyVals of this stack) of the RawKeyVals of this stack
if it is empty then -- not in list, nothing to do
pass rawkeydown
else
-- here: Call command for the key-shortcut (or error handler)
exit rawkeydown
end if
end rawkeydown