Solved

OS X Convert Scan Code to Unicode

Posted on 2008-06-12
2
1,498 Views
Last Modified: 2013-12-26
I'm working in OSX and I've got an event handler on an OpenGL window. When a key is pressed, I end up with a scancode when I do GetEventParameter(event, kEventParamKeyCode, ...). I want to convert this scancode into unicode based on the keyboard profile. How can I do this?

Thanks.
0
Comment
Question by:Evlich
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
clausbroch earned 500 total points
ID: 21811228
If you use kEventParamUnicodes instead of kEventParamKeyCode you will get the unicode character directly. Mac OS X will automatically take the current keyboard layout into account.

For more information you can have a look at this Q&A from Apple:
http://developer.apple.com/qa/qa2005/qa1446.html
0
 
LVL 1

Author Comment

by:Evlich
ID: 21817279
Excellent, this is exactly what I'm looking for. Is there a way to discriminate the function keys? They seem to all report Unicode #16.

Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question