[14 Sep 2009] In case of OnKeyUp
Posted: Sat Jun 13, 2020 5:32 pm
Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 14 Sep 2009 15:43:37 +0100
Hi!
Here is a bit of script that can show that OnKeyUp event not addressing every control key by its name. Instead of "SPACE" and "ENTER" I have to use ascii codes of these keys and change to Switch Asc(msg.key). What is the concept for such behaviour? I know that enter and space are displayable, so it has ascii codes, but IsKeyDown() can handle them by name. At least a bit of info in the guide would clarify the situation for newbies.
Hi!
Here is a bit of script that can show that OnKeyUp event not addressing every control key by its name. Instead of "SPACE" and "ENTER" I have to use ascii codes of these keys and change to Switch Asc(msg.key). What is the concept for such behaviour? I know that enter and space are displayable, so it has ascii codes, but IsKeyDown() can handle them by name. At least a bit of info in the guide would clarify the situation for newbies.
Code: Select all
Function p_key(msg)
Switch msg.key
Case "UP":
Print("up")
Case "DOWN":
Print("down")
Case "SPACE":
Print("space")
Case "ESC":
Print("esc")
Case "ENTER":
Print("enter")
EndSwitch
EndFunction
InstallEventHandler({Onkeyup=p_key})
Repeat
WaitEvent
Forever