I'm currently writing a little joystick-to-shifter program for LFS.
I got it to read X, Y values from the joystick using DirectInput and determine the gear.
I'm trying to use SendKeys.SendWait() to send a key to LFS for use with the gears.
For example:
Process proc = Process.GetProcessesByName("LFS")[0]; SetForegroundWindow(proc.MainWindowHandle); SendKeys.SendWait("5");
My issue is that it doesn't seem to work when mapping the shifter buttons in LFS, however it DOES work when I press "T" in LFS to enter text it the chat because I see a "5" being written into the box.
What would be the best way to get around this and make LFS treat the keys from my program as keyboard keys?
Another idea would be to override the physical controller keys and emulate them being pressed whenever I need them to be (if that's even possible).
Any tips or ideas?
Cheers.
EDIT: Figured it out myself. I needed to import the native function:
Gaming-Solutions.com is currently holding a 40%-off sale on server hosting.
This includes LFS server hosting and any other game available on our website. Insim hosting is also available (Airio, LFSLapper or any custom insim system you send us).
The 40%-off is a recurring sale and you will be charged the same amount for ever.
This promotion is valid on any billing cycle (1 month, 3 months, 6 months, 1 year).
All you have to do is enter the promotion code on checkout: XMASPARTY
Note: The promotion code is only valid in December.