Alright, I am working on a mini game, basically the player is prompted which arrow key to press by a view with a changestate. I am attempting to use a handleEvent method in the room script and it seems to be working... just not for the arrow keys.
(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
(super handleEvent: pEvent)
(Print addText: "event" init:)
(switch (pEvent type?)
(evJOYSTICK
(switch (pEvent message?)
(JOY_UP
(Print addText: "up" init:)
)
(JOY_DOWN
(Print addText: "down" init:)
)
(JOY_LEFT
(Print addText: "left" init:)
)
(JOY_RIGHT
(Print addText: "right" init:)
)
)
(pEvent claimed: TRUE)
)
(evKEYBOARD
(switch (pEvent message?)
(KEY_TAB
(Print addText: "tab" init:)
)
(KEY_SPACE
(Print addText: "space" init:)
)
(KEY_8
(Print addText: "8" init:)
)
(KEY_UP
(Print addText: "up" init:)
)
(KEY_LEFT
(Print addText: "left" init:)
)
(KEY_DOWN
(Print addText: "down" init:)
)
(KEY_RIGHT
(Print addText: "right" init:)
)
)
(pEvent claimed: TRUE)
)
(else (pEvent claimed: TRUE))
)
(return)
); ends method
); ends instance
When I run the game, I can press space, and tab and both of them print out two messages, one letting me know an event took place, and a second letting me know the button was pressed. However when I click on an arrow button, I get no response, not even the event has happened message
From the keys.sh file KEY_NUMPAD8 and KEY_UP are defined the same $4800... I tried them both with no response.
What is it that am I missing here?
*The same behavior can be seen in the titlescreen script, any keyboard event should trigger the window... and most do, but not the arrows