I've made an interface to a NES Controller with an atxmega, which send the keys through serial. The problem lies in the program that reads the input and sends keybd_events accordingly.
if(szBuff[0] & BTN_LEFT) {
keybd_event(VkKeyScan('j'), 0, 0, 0);
keybd_event(VkKeyScan('j'), 0, KEYEVENTF_KEYUP, 0);
}
Problem is, it fails to get recognized as a 'j' in a NES emulator, while it does so in say a browser. Any ideas?