Re: Keys and remapping them (was Re: Daydreaming)
Re: Keys and remapping them (was Re: Daydreaming)
- Subject: Re: Keys and remapping them (was Re: Daydreaming)
- From: Ben Byer <email@hidden>
- Date: Thu, 22 Nov 2007 02:44:19 -0800
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)
This email sent to email@hidden