| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Marco, you'll want to look at the new TextInputSource (TIS) API avaiiable in Leopard HIToolbox (TextInputSources.h). The TIS API supercedes the deprecated KL API and will be available in 64bit. Hope the following snippet helps: TISInputSourceRef kbInputSourceRef = (TSMInputSourceRef) TISCopyCurrentKeyboardLayoutInputSource(); // Get the 'uchr' data CFDataRef uchrDataRef = (CFDataRef)TISGetInputSourceProperty( kbInputSourceRef, kTISPropertyUnicodeKeyLayoutData ); Boolean existsUchr = ( (uchrDataRef != NULL) && (CFDataGetBytePtr(uchrDataRef) != NULL) && (CFDataGetLength(uchrDataRef) != 0) ); if (existsUchr) { UInt32 modifiers = 0; // If you're getting this from a CarbonEvent, you'll want to right-shift... i.e., modifiers >> 8 below UInt32 deadKeyState = 0; UniChar *uCharsOut = malloc( ... ); UniCharCount numUCharsOut; OSStatus status = UCKeyTranslate( (const UCKeyboardLayout *)CFDataGetBytePtr( uchrDataRef ), keyCode, kUCKeyActionDown, modifiers, LMGetKbdType(), kUCKeyTranslateNoDeadKeysMask /*or kNilOptions*/, &deadKeyState, maxUnicodeStrLength, &numUCharsOut, uCharsOut ); } CFRelease(kbInputSourceRef); Michael Grady On Jun 20, 2007, at 8:36 AM, Marco Piovanelli wrote:
|
_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden This email sent to email@hidden
| References: | |
| >Stripping modifier keys (From: "Marco Piovanelli" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.