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: insertText: without a NSWindow/NSView (or: Unicode input without NSView/Window)



On Jan 30, 2008, at 2:05 AM, Adam Zegelin wrote:

I can do single keys fine, I just send the [[event characters] characterAtIndex:0] off to the game engine. But things composite characters like option-e + e (é) do not work. [[event characters] characterAtIndex:0] just returns "e". Non-composite keys like option- w (∑) do work correctly.

Why do you not process all of the characters in the event? In other words, [[even characters] length] may be greater than 1. There should be a COMBINING ACUTE ACCENT (u0301) character following the "e".


If the game engine needs precomposed characters, then you can call - [NSString precomposedStringWithCanonicalMapping] on the string, first. Note that this is orthogonal to my previous point. It is _not_ guaranteed to reduce the length to 1.


Also, since I'm only inspecting the event stream, other systems of input such as the Character Palette don't work with the application.

I don't know the solution to this. However, most input sources other than the keyboard would be unavailable in full-screen mode, anyway. Right? So, you should be able to get by with the ordinary NSWindow/ NSView methods.



-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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >insertText: without a NSWindow/NSView (or: Unicode input without NSView/Window) (From: Adam Zegelin <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.