08-16-2011 11:59 PM
Hello all
I have a vi that gives virtual key codes to the Call Library Function Node, to control the cursor keys. The codes are: 37(left), 38(up) and 39(right), which are the ASCII (decimal) values. Using this output I want to control any kind of game running on windows. However, the program is able to move the cursor keys on applications such as MsWord and Notepad, it is not able to control cursor keys for game.
So here is my question: Do games, like nfs all have different key codes, or do they have common key codes? Since games do not accept ASCII values, then what are the key codes that they use? Any urgent help would be appreciated.
Regards,
Ashutosh
08-17-2011 02:43 AM - edited 08-17-2011 02:45 AM
Hi ashu,
first: 37-39 (left to right) are not ASCII values of the keys (37=%, 38=&, 39=')! These numbers seem to be scancodes of the keyboard (although mine gives different values for the cursor keys, while 37-39 corresponds to K-Ö on a German keyboard). The operating system translates scancodes to corresponding chars using the currently used keyboard setting (keyboard layout).
second: Games often don't use OS routines for input devices. So they read the scancode with their own routines and kindly ignore OS wishes...