Keyboard question...

Started by the2bears, February 24, 2007, 23:11:46

Previous topic - Next topic

the2bears

Hey, I might be missing something but is there a way to find out if *nothing* is pressed?  In my loop, I simply poll the keyboard then check for the keys I'm interested in.  But I'm also interested in knowing when no key at all is pressed.  Other than check all the keys, is there a simple way to do this?

Thanks as always,

Bill
the2bears - the indie shmup blog

Matzon


the2bears

Quote from: Matzon on February 24, 2007, 23:13:21
just check for events ?

Thank-you.

Hmmm... yes, but then I'll need to consume the events each time through the game loop, right?  Yes, should work without breaking the isKeyDown(...) code I have.  Confirmed, still works.

So, should one be consuming the keyboard events regardless if they're being used or not?

Bill
the2bears - the indie shmup blog

Matzon

well, events will be put in the buffer and flipped - so it will just keep overwriting events  - regardless of whether you read them or not.

the2bears

Quote from: Matzon on February 25, 2007, 11:17:06
well, events will be put in the buffer and flipped - so it will just keep overwriting events  - regardless of whether you read them or not.

Thanks, that's what I figured since to this point I've been ignoring them and nothing exploded.  At least in the code ;)

Bill
the2bears - the indie shmup blog