Quote:
Originally Posted by Thorham
Another way is to use IDCMP messages from a window. In a full screen game you'd open a screen, open an invisible window the size of the screen, and use a wait message loop to get the IDCMP messages. You can also get mouse input etc like that.
Has one big drawback: You'll need multi threading.
|
Thanks Thorham. I've manged to use keyboard.device to read keypresses now. More particularly I'm reading the keyboard with KBD_READMATRIX and getting the status of individual keys from that. This works really well although I'm still getting stray keypresses. I assume it's because they're being buffered and the backlog builds up during play.
I think I will need to open some kind of invisible window to "soak them up". Samurai_Crow mentioned a RAW: device, which I read is a variation of the console which has unbuffered keypresses so I'm hoping that will work. EDIT: I just found some code in the RKM that might help - "Using the Console Device Without a Window".
In other news, I used a RastPort for the first time to write a make-shift scoreboard. That one turned out to be dead easy. At times learning this stuff has been like wading through treacle, so It's great when that happens!