• 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
Detecting Fn key (as modifier)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Detecting Fn key (as modifier)


  • Subject: Detecting Fn key (as modifier)
  • From: David Reitter <email@hidden>
  • Date: Thu, 19 Jan 2012 11:43:37 -0500

Hi,

What is the correct way to detect the Fn key in combination with other keys, given an NSEvent?

NSFunctionKeyMask is set in the modifier flags for the Fn key, but it is also set for a range of "function keys", such as arrow keys, PageUp/Down, Home, End, Delete, Help, etc., and it seems impossible to distinguish, e.g., PageUp from Fn-PageUp.

I noticed that my laptop keyboard will let me distinguish Fn-UpArrow from UpArrow via NSNumericPadKeyMask, but that's about it (it won't apply to other function keys present on external keyboards).

According to [1], kCGEventFlagMaskSecondaryFn won't let me do this either.

The attendant question then is how to correctly implement something like NSEvent's charactersIgnoringModifiers, which does not interpret the Fn key as a modifier either (Fn-LeftArrow still gives me Home).

Thanks
 - David

[1] http://lists.apple.com/archives/quartz-dev/2008/Jan/msg00019.html_______________________________________________

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

  • Prev by Date: Re: Controlling iOS scrolling
  • Next by Date: Re: AppleScript recording
  • Previous by thread: Andreas Grosam <email@hidden>
  • Next by thread: Embedded Library in Cocoa App
  • Index(es):
    • Date
    • Thread