Keyboard issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mirkosha
    New Member
    • Apr 2016
    • 1

    #1

    Keyboard issue

    Good day, enthusiasts!

    Well, this is my first post, I came accross an issue that I don't know how to solve.
    Some time ago I've made a control desk for Microsoft Train Simulator, for a friend.

    The moving the accelerator and brakes are interpreted by a Microchip PIC18F25J50, running a framework which emulates a n USB keyboard. No additional driver was needed, since PIC uses standard keyboard protocol. The PIC sends corresponding pressed keys over USB to the computer. As an example, when the accelerator is rotated one step to the right, PC receives "D" key pressed once and the indicator rises by one step.
    In Windows, everything works fine. In Notepad, all keys are pressed accordingly. Also in Microsoft Train Simulator, it all works great, as one can see in the movie.

    When my friend tried Open Rails, the key pressed from the PIC are no longer interpreted properly. About one in 30 or more commands from the PIC works, all others are ignored. As an example, when I turn the accelerator up, about one in 30 "D" keys pressed reaches the game. Any other keyboard works just fine.
    I really don't understand what's the problem. Does't this game use the same Windows driver as Microsoft Train Simulator? Can anyone please suggest a work around this problem? Have any of you guys came across keyboard issues in Open Rails?

    Thank you for reading this, and I'm looking forward for a solution.
  • ckawahara
    Senior Member
    • Aug 2002
    • 827

    #2
    Did you check the keyboard configuration? Not all keyboard options may be set equally between OR and MSTS. See the manual for greater detail.

    Comment

    • moelarrycurly4
      New Member
      • Oct 2012
      • 9

      #3
      Ahhh someone else with this issue. we have a simulator with a real control stand that has been wired to use keyboard commands in the same manner in which you describe except ours is using mechanical relays and x-keys programmable keyboard emulator. When running MSTS all keyboard commands work fine, when attempting to run ORTS i have the same issue that you are having, the keyboard commands are not making it to ORTS. This is not an issue with the keyboard configuration layout in ORTS as I have reset it to match what is going in in MSTS. So I have determined that there is a keyboard driver issue between x-keys and ORTS.

      Now the rail driver controller is made by the manufacturers of X-keys and according to ORTS documentation you can use it woth ORTS. So I am going to load the drivers for Rail driver and see if that fixes my issue.

      Comment

      • MYR37
        New Member
        • May 2016
        • 3

        #4
        Thanks for replying to my problem. It is a bit frustrating that having it all working for MSTS and in OR not, not knowing sure why. I wish you guessed the problem and if you are about to install those drivers for Rail Driver, please send me some feedback on how it behaves.

        Comment

        • moelarrycurly4
          New Member
          • Oct 2012
          • 9

          #5
          Ok sorry for the long delay. work projects got in the way and I have just returned to this issue.
          I started programming a arduino pro micro to use as new controller for our simulator for use with open rails.
          I had the same issue that you had with the pic, Then I realized that I was using wrong function in the code.

          I was using the function keyboard.Write('d') which would produce a "d" on notepad and other programs. I switched to keyboard.Press('d');

          Keyboard press is what signal open rails is looking for, so check you code on your PIC and see.

          Comment

          Working...