• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: virtual keycode to character
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: virtual keycode to character


  • Subject: Re: virtual keycode to character
  • From: "email@hidden" <email@hidden>
  • Date: Thu, 30 Apr 2009 14:34:37 -0700

At 7:22 PM -0500 4/29/09, Ken Thomases wrote:
On Apr 29, 2009, at 6:40 PM, email@hidden wrote:

thank you. this solved my problem.

You're welcome. I'm glad I could help.

and (i think) you've helped again. thanx. (see below)



and for the archives (to help anyone in the future), here is my code:

UInt32 deadKeyState = 0;
UniCharCount actualCount = 0;
UniChar baseChar;
TISInputSourceRef sourceRef = TISCopyCurrentKeyboardLayoutInputSource();
CFDataRef keyLayoutPtr = (CFDataRef)TISGetInputSourceProperty( sourceRef, kTISPropertyUnicodeKeyLayoutData);
CFRelease( sourceRef);
UCKeyTranslate( (UCKeyboardLayout*)CFDataGetBytePtr(keyLayoutPtr),
[theEvent keyCode],
kUCKeyActionDown,
0,
LMGetKbdLast(),

Why LMGetKbdLast rather than LMGetKbdType? I think that the "Last" in LMGetKbdLast means "former". That is, if the keyboard is switched at some point, then LMGetKbdType gives the current keyboard type and LMGetKbdLast gives the previous keyboard type.

the documentation for LMGetKbdLast says:
The last physical keyboard type used.
i read that to mean the keyboard last used/typed on by the user, i.e., the keyboard used that triggered the current keyboard event. i'm assuming that you are correct and i've changed my code appropriately.


thanx,
ken
_______________________________________________

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


References: 
 >virtual keycode to character (From: "email@hidden" <email@hidden>)
 >Re: virtual keycode to character (From: Ken Thomases <email@hidden>)
 >Re: virtual keycode to character (From: "email@hidden" <email@hidden>)
 >Re: virtual keycode to character (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: create object from class name held in String?
  • Next by Date: Making sounds
  • Previous by thread: Re: virtual keycode to character
  • Next by thread: Need guidance on data structure
  • Index(es):
    • Date
    • Thread