Re: LMSetKey[Rep]Thresh
Re: LMSetKey[Rep]Thresh
- Subject: Re: LMSetKey[Rep]Thresh
- From: Jean-Daniel Dupas <email@hidden>
- Date: Mon, 18 May 2009 09:32:54 +0200
Le 18 mai 09 à 08:27, Eric Schlegel a écrit :
On May 17, 2009, at 9:37 PM, Christopher Hansen wrote:
First of all, I want to be able to set them, so I primarily need
the setters, but I also want the getters because I want to be able
to restore the previous values when my app exits or is swapped out.
LMSetKeyRepThresh turns into this:
NXEventHandle handle = NXOpenEventStatus();
NXSetKeyRepeatThreshold( handle, inValue );
NXCloseEventStatus( handle );
which I believe is all public API (if poorly/un-documented).
However, I'm not sure if this has any effect if you're not running
as root; you'll have to try it.
Second, my goal is to move entirely to Cocoa since, as I understand
it, support for Carbon is being frozen with the release of Snow
Leopard. So, I'm currently in the process of removing all of my
Carbon dependencies. However, I'm just fine with C APIs, and, in
fact, I'm retaining all of my CGL code since it would completely
break my platform independent architecture -- which separates the
rendering layer from the application/event handling layer -- to use
Cocoa for my rendering.
In this particular case, I'd almost recommend sticking with
LMSetKeyRepThresh. The NX-level APIs are nearly as deprecated as
Carbon API in this case. Probably a good idea to file a bug
requesting a Cocoa-level API to do this.
IIRC, you can also query these values using lower level functions (but
I dont know if the setter works):
kern_return_t kr =
IOServiceGetMatchingServices(kIOMasterPortDefault,
IOServiceMatching(kIOHIDSystemClass), &iter);
service = IOIteratorNext(iter);
kr = IOServiceOpen(service, mach_task_self(),
kIOHIDParamConnectType, &sSystemService);
kr = IOHIDGetParameter(service, CFSTR(kIOHIDKeyRepeatKey),
(IOByteCount)sizeof(value), &value, &size);
_______________________________________________
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