I'm not able to send any keystroke to the game from a C# program. I've tried many different methods. The game just doesn't recognize them. I've used SendKeys, Keyb_event, and Input Simulator and none of them are recognized by Skyrim but they are by other games/programs. I've also tried, with SendKeys. to send them directly to the Skyrim Window and still got nothing. Does anyone have an idea what I'm doing wrong? I have another program, GlovePie, that sends keystrokes to Skyrim successfully, which has added to my confusion more. Voice Macro also does it just fine, so I assume it's something I'm doing wrong. Here are the different C# codes I've tried (I have a mod that checks if Backslash is pressed down every second and, as i said before, GlovePie has no problem with holding down the slash key to be detected)
1.) SendKeys.SendWait("{\\}"); //Looped every 1 ms for 1 second
2.) keybd_event((byte)Key.BACKSLASH, (int)Key.DOWN, 0, 0); //Key.DOWN is pressing the key down
Wait 1s
keybd_event((byte)Key.BACKSLASH, (int)Key.UP, 0, 0); //Key.UP is releasing the keyI know the code is correct because it works for other program but maybe I need something extra for it to send to Skyrim?