3

There's a way to convert a character (@"A") to CGKeyCode (cocoa development)? I've already tried a lot of "solutions", but none worked.

I already implemented the keyCodeForKeyString method, but it is really short and don't include all of the characters in a keyboard.

  • 2
    This is a tricky problem, since there can be many ways to get the same character. Different keys, different key combinations, even different input devices. It might be better to redefine the problem in the other direction: When the user enters the key they want to use, capture the code, and translate it to a character only for display. – Peter Hosey Dec 28 '12 at 07:43

1 Answers1

1

This question appears to answer the same (or very similar) question: How to convert ASCII character to CGKeyCode?

Community
  • 1
  • 1
stephenhouser
  • 325
  • 3
  • 13