• 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: Command-Key modified cursor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Command-Key modified cursor


  • Subject: Re: Command-Key modified cursor
  • From: Ricky Sharp <email@hidden>
  • Date: Sat, 5 Jan 2008 14:20:37 -0600


On Jan 5, 2008, at 2:08 PM, John Nairn wrote:

I implemented tracking rects and used mouseMove to change the cursor depending on modifier keys. In this case holding command key is zoom in while command and option is zoom out. It works OK, but pressing the command key does not get the correct curser until the mouse physically moves again. I tried to find an event for key press, but could not find one (command key or option key alone do not generate keyDown event). I didn't try cursor rects, but found no indication that cursor tracking would update correctly on command or option key presses.

Where does one trap an event to change the cursor whenever the mouse is within some rectangle and whenever the command or option key are pressed or released while in that rectangle?


Don't know how to do that with Cocoa APIs, but in Carbon you can listen for modifier key changes (see kEventRawKeyModifiersChanged in CarbonEvents.h).

Note that it's safe to add carbon event handlers to your Cocoa app. I do this myself to listen for Ink (handwriting recognition) events.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Command-Key modified cursor (From: John Nairn <email@hidden>)

  • Prev by Date: Command-Key modified cursor
  • Next by Date: Re: how to implement 2 tableViews in a class
  • Previous by thread: Command-Key modified cursor
  • Next by thread: Re: Command-Key modified cursor
  • Index(es):
    • Date
    • Thread