• 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
SOLVED: Determine pressed keys while dragging FROM OTHER application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SOLVED: Determine pressed keys while dragging FROM OTHER application


  • Subject: SOLVED: Determine pressed keys while dragging FROM OTHER application
  • From: Dominik Pich <email@hidden>
  • Date: Sat, 15 Sep 2007 03:05:51 +0200

Solved it using GetKeys from carbon.

#define keyArrowLeft 0x7b
#define keyArrowRight 0x7c
#define IsKeyDown(keyMap, theKey) (((unsigned char *)(keyMap)) [(theKey) / 8] & 1 << ((theKey) % 8))
BOOL isTranslatedKeyDown(KeyMap map, unichar key); //for space and similar characters from GT category


//thanks to Pierre-Olivier Latour and Jonathan Grynspan

Regards,
Dominik

On 14.09.2007, at 14:06, Dominik Pich wrote:

Hi,
I need to check if a specific key is pressed while receiving a drag.
When drags come from inside the process a keydown event is generated as currentEvent and I can get that but for drags from other applications I dont get such an event. I tried getKeys from the carbon layer. I tried the following category on http:// www.ghosttiger.com/?p=136 and I can detect presses of CHARACTERS just fine. A b C d <<SPACE>> as the keycodes get translated to unichars for me.


What I cant do is detecting arrow keys.
The cateogry returns wrong unichar values for it.... Well all arrow keys translate to the same unichar for me...
And I dont know how to interpret what getKeys tells me...... sure I can just take the raw codes from the KeyMap but those seem to be different for different keyboards. (not to mention architectures!?)


So... how does one go about detecting these keys (Is getKeys the correct way?). All the Hotkey tools do it!?

Regards,
Dominik
_______________________________________________

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

_______________________________________________

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: 
 >Determine pressed keys while dragging FROM OTHER application (From: Dominik Pich <email@hidden>)

  • Prev by Date: Re: NSTextView, partial views of NSTextStorage
  • Next by Date: Re: Singletons and Threads
  • Previous by thread: Determine pressed keys while dragging FROM OTHER application
  • Next by thread: NSTextView, partial views of NSTextStorage
  • Index(es):
    • Date
    • Thread