• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Keyboard State
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Keyboard State (From: Richard Dodd <email@hidden>)

  • Prev by Date: RE: building & distributing frameworks
  • Next by Date: Re: building & distributing frameworks
  • Previous by thread: Keyboard State
  • Next by thread: launching tasks as root
  • Index(es):
    • Date
    • Thread