Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keys and remapping them (was Re: Daydreaming)




On Nov 21, 2007, at 7:56 PM, Anton Rang wrote:


On Nov 21, 2007, at 4:50 AM, Ben Byer wrote:

There's an easy way to answer these questions ("What information do we have available to us for each keystroke event?")

Actually, that answers the question "If I use Carbon Events, what information do I have available?"


There don't appear to be public APIs to distinguish left & right keys, but I do have some Mac OS X games which do, presumably via the HID. Whether or not this would work for X, I'm not sure.


WTF Carbon events.

Cocoa events actually give more info. I just assumed that they gave the same events as Carbon events -- Cocoa events are what we are using.

See /System/Library/Frameworks/IOKit.framework/Versions/A/Headers/ hidsystem/IOLLEvent.h:

* Masks for the bits in event.flags */

/* device-independent */

#define NX_ALPHASHIFTMASK       0x00010000
#define NX_SHIFTMASK            0x00020000
#define NX_CONTROLMASK          0x00040000
#define NX_ALTERNATEMASK        0x00080000
#define NX_COMMANDMASK          0x00100000
#define NX_NUMERICPADMASK       0x00200000
#define NX_HELPMASK             0x00400000
#define NX_SECONDARYFNMASK      0x00800000

/* device-dependent (really?) */

#define NX_DEVICELCTLKEYMASK    0x00000001
#define NX_DEVICELSHIFTKEYMASK  0x00000002
#define NX_DEVICERSHIFTKEYMASK  0x00000004
#define NX_DEVICELCMDKEYMASK    0x00000008
#define NX_DEVICERCMDKEYMASK    0x00000010
#define NX_DEVICELALTKEYMASK    0x00000020
#define NX_DEVICERALTKEYMASK    0x00000040
#define NX_DEVICERCTLKEYMASK    0x00002000


It looks like Carbon Events don't get passed the latter set of bits; too bad there's not an example out there that just uses Cocoa events.
--
Ben Byer
CoreOS / BSD Technology Group, XDarwin maintainer


_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/x11-users/email@hidden

This email sent to email@hidden
References: 
 >Daydreaming (was: Re: 1.3a1) (From: "Ambrose Li" <email@hidden>)
 >Re: Daydreaming (was: Re: 1.3a1) (From: "Jordan K. Hubbard" <email@hidden>)
 >Re: Daydreaming (was: Re: 1.3a1) (From: "Ambrose Li" <email@hidden>)
 >Re: Daydreaming (From: Harald Hanche-Olsen <email@hidden>)
 >Re: Daydreaming (From: Derek Fawcus <email@hidden>)
 >Re: Daydreaming (From: "Nathaniel Gray" <email@hidden>)
 >Keys and remapping them (was Re: Daydreaming) (From: William Mortensen <email@hidden>)
 >Re: Keys and remapping them (was Re: Daydreaming) (From: Ben Byer <email@hidden>)
 >Re: Keys and remapping them (was Re: Daydreaming) (From: Anton Rang <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.