Key codes and characters in NSEvents
Key codes and characters in NSEvents
- Subject: Key codes and characters in NSEvents
- From: Darrin Cardani <email@hidden>
- Date: Thu, 18 Mar 2004 14:06:30 -0600
In my application, I would like to allow the user to change the key
combinations associated with certain functions. So I have a dialog
where the user can click on a button to change a "key combination to
function" mapping. It prompts them to enter the new key combination.
Once they've pressed a key combo, it then displays the combination
they just chose.
This is working for the most part, but there seem to be a few
glitches. The way I prompt the user to enter a new combination is by
displaying a modal window, which has a custom window controller. In
the window controller's -keyDown: method, I extract the key
information by calling [ theEvent charactersIgnoringModifiers ]. The
problem is that the character for non-printing keys is not what I
want to display. For example, left arrow comes back as an Asian
character.
If I use [ theEvent keyCode ], I can get the key code. But how do I
convert the key code into a character I can display to the user?
I'm also having a problem getting command key combinations. If the
user is pressing the command key, my window controller never gets the
event. Is there a way to also get those events?
Thanks,
Darrin
--
Darrin Cardani - email@hidden
President, Buena Software, Inc.
<
http://www.buena.com/>
Video, Image and Audio Processing Development
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.