Re: Keyboard State
Re: Keyboard State
- Subject: Re: Keyboard State
- From: Matthew Formica <email@hidden>
- Date: Wed, 25 Sep 2002 14:55:17 -0700
One idea is to test for -keyUp: as well as -keyDown: and maintain the state
of the keys you care about yourself with a struct of Booleans or something.
Then you can say, "the fire key is still down, and now he's pressing the
move key too."
- Matthew
On 9/25/02 1:45 PM, "Richard Dodd" <email@hidden> wrote:
>
As a means to teach myself Cocoa programming, I am writing a simple game. So
>
far everything as gone together better than I could have hoped. At the
>
moment, he only thing that could be better is using the keyboard to control
>
the game action. I am currently having one of my custom views receive
>
keyDown events. This works fine as long as the player only needs to use one
>
key at time. If the player tries to move and fire at the same time, the
>
second key press stops the first until it is released and pressed again.
>
>
Is there a way, in Cocoa to test the state of the keyboard or for the
>
program to 'see' more than one key press at a time?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.