View Full Version : Convert NSString to KeyCode.
Apr 12, 2008, 12:02 PM
I use function CGPostKeyboardEvent for Keyboard Event. I need to convert NSString in KeyCode. What offers?
Apr 12, 2008, 12:17 PM
Are you trying to convert it to a CGKeyCode? CGKeyCode is just an unsigned short essentially, so NSString's intValue may work (typecasted of course), but it depends what the NSString value is. Can you give an example?
Apr 13, 2008, 09:50 AM
I have a variable of type NSString *sStr = "password". Each letter I enter by means of CGPostKeyboardEvent. The letter "p" and following must to convert in CGKeyCode.
Apr 13, 2008, 10:15 AM
Check out the keyCodeForKeyString() function here:
Apr 13, 2008, 01:39 PM
If there are no other variants, it is necessary to use this simple function keyCodeForKeyString.:rolleyes: Thank!!!
Aug 11, 2008, 07:14 AM
What CGKeyCode do the capital letters have?