Detecting Fn key (as modifier)

  • 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]
    previous month january 2012 next month
    MTWTFSS
                1
    2 3 4 5 6 7 8
    9 10 11 12 13 14 15
    16 17 18 19 20 21 22
    23 24 25 26 27 28 29
    30 31          
    Go to today