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
Solved

OS X Convert Scan Code to Unicode

Posted on 2008-06-12
2
1,493 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
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

If you other experts are anything like me you are always looking into and testing out new features. While I was doing some research one day I ran across an app that I installed on my Mac and used as a security system. Mac OS X: SecureHome uses your …
In this article we will discuss some EI Capitan Mail app issues and provide some manual process to resolve them.
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.

839 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