Assign key press to close system messages / windows.


Abonniere unseren Kanal auf WhatsApp (klicke hier zum abonnieren).
  • Does anyone know if it's possible to assign a key to the window?


    I mean the 'X' in the top right of the message that pops up giving instructions, faults and so on .. circled in the photo below:



    I like to drive using my control panel :



    And hence don't want to have to use the mouse, as i have almost every control i need to use assigned to a lever or joystick button, and i can assign keyboard keypresses too in the arduino that is inside my control panel... but i can't seem to find a 'close menu / message' key stroke in the game.

  • Sichtweise angepasst.
    Überarbeitete Version inkl eingehen auf die Frage des Users.
    Und dezentes Ignorieren der Meinung von Lemaster und Amisia.


    @'gazz'
    First of all, I share my opinion, for me your problem is a "luxury problem".
    Especially if you still have such a great console.
    I have to get along with the ancient Raildriver, and I have to work with the mouse as well.




    And since it has not worked out with the lotto again, the own driver's cab remains a dream.
    It's not meant to be mean. I like to be very direct, so some specific users are not clear with this attitude.



    In order to get back to your problem, I can only close windows in Windows,
    either with the mouse or the keyboard shortcut Alt + F4, then, if a
    question comes up, confirm with Enter.


    Maybe you try out, if the window closes with the usual Windows key combination Alt + F4.
    If so, then you only need to program one of the keys with this combination if it is possible.
    Of course it can happen that Windows thinks you want to close the TS, but you just want to close the window.


    Evt you can also tell the support page of DTG a keyboard shortcut, if it is installed at all.

    3 Mal editiert, zuletzt von Berliner079 ()

  • Well, i start the scenario using the mouse... but then i like to drive using the control desk, i don't need to use the mouse for anything except to close the instruction and fault windows,


    i have the real driving desk from a BR111 wittenberget steuerwagen that i am slowly converting the controls to work with the computer, i am going for the total imersion feeling.. as i i am really driving a train, and having to use a mouse to click away those windows kind of ruins it :)

  • Lieber @Berliner079 , ich denke wir haben den Zeitpunkt erreicht wo Schweigen Gold ist, somit bitte ich dich mehr als höflich die Finger aus diesem Thread zu lassen. Vielen vielen Dank und nichts für ungut!

  • Werter @Matthias J.
    Ich habe meinen fehler erkannt und meine Sichtweise angepasst.
    Siehe Post 2.


    Ich denke mal, auch ein sturkopf wie ich hat eine chance der korrektur verdient, wenn der User das schon so aufwendig mittelks melden-funktion machen muss.

    Einmal editiert, zuletzt von Berliner079 ()

  • I'm cool with the response i got... to most people having to use the mouse is not a problem, as they probably use it to control some of the loco controls anyway, and likely to look around the cab... i have altered the cab camera views to show all the gauges, lights etc needed to see when driving the trains tho.


    i'm just weird that i am building my own simulator style set ups using real controls and going for total immersion... i know there are major limitation in the base game, and maybe Zusi would be better for me, but i have spent money on train simulator, so want ti keep using that.


    the 's bahn driver' control unit shown, i use when in bed, sat on an over bed table (i have disabilities, and i am stuck in bed a lot sometimes)


    i made that item from scratch ... the power / brake lever i made from of a disc of aluminum and some delrin on the lathe, the top was laser cut at my local hackspace, the switches are real ones from german train / trams, i had some spare from my main control desk as i got extra's when i bought the wittenberger steuerwagens driving desk.
    It is rall working using an arduino for the levers potentiometers, (the reversing switch is seen as a lever in this game, so had a potentiometer under it), and a minimus usb board running KADE works all the buttons... and the 'raildriver joystick interface' program allows it to operate the in game controls.... all except the 'close instruction window button of course' :p


    i only wish i had made an extra lever for brakes, but when i made that i was going through a phase of driving mostly multiple units of the 42x series.




    i have another simulator set up for Omsi .. with a MAN NG272 bus dashboard, steering wheel, IBIS, almex ticket machine, paytable and coin changer... all connected to the computer


    There was a problem there too... the mouse was needed to 'take the customers money' as there was no key press for that... but it was fixed when omsi2 came out, and keys were assigned to those tasks as it needed to be hard coded in the games program.

  • Well, I have to say, respect.
    And you have changed my point of view.
    I would like to apologize again for my initial statement.
    Excuse me.


    To get back to your topic.
    Yes,
    the TS really has some limitations, which is probably due to the fact
    that it has not really been developed since the takeover by DTG of Kuju.


    However, the further development of the graphics programs has increased the
    texture sizes of assets and vehicles more and more, more details were
    possible, which of course requires more and more RAM.


    If a DTG 101 needs maybe 500MB of RAM, the VR EL 101 is over 1GB.


    If there is still a high detailed Route like Koblenz-Trier or Freiburg-Basel, of just under 2GB, the 3.7GB are reached quickly, which brought the 32 bit exe to crash.


    The soon following Version TS 2019, as 64bit version can be called a milestone.



    The one problem is solved, but we all do not know how the TS and the whole
    vehicle will react, etc., we know when the 64bit time comes.


    To your problem, I have to then synonymous leave, because I have no idea of programming.
    Evt can be found here in the forum someone who knows if there is a keyboard shortcut, if you can create one, etc.


    In that sense, respecting your driver's desk, and have fun with it.

  • If anyone is interested, i have found a way to do this...


    i am using Auto Hot Key and a little script that when a button is pressed (in my case the media key with the X to close windows) it moves the mouse cursor from where ever it is... to the exact place the close X is on the pop up windows in train simulator, clicks the X, then returns the mouse cursor back to it's original position... this happens in a few milliseconds,


    The auto hot keys script is:

    The top bits for x and y are the position of the close window X box, this is right for me on my screen, it may be different for other screen resolutions though,


    The 'sc168::' is the keyboard scan code for my particular media button key... this could be changed to say 'M::' to use the keyboards M key, or any key you want... it will eventually be a joystick button i use for this task.


    I hope this is of use to someone else, i know it's not really an issue to move the mouse to click the close button, but i want to get away from using the mouse with my controlers that i drive the trains with.

  • you will definately need to alter the X and Y positions for the mouse.... i put this on my desktop pc running TS2019, i run that in DSR mode, where it upscales the screen to 4k resolution, then back down to 1080p resolution, and the co-ordinates were way off for where the mouse clicked,


    i just altered the X position, re-loaded the script and looked where the mouse cursor moved to when i pressed the button to trigger it... and manually altered the position in the autohotkey script untill it landed on the X properly,


    EDIT:
    I just noticed that sometimes the text boxes are different sizes.... so i've altered the script to make the mouse click in 2 different positions now... if there's no X there it wont do anything at all.. but if there is, it'll close the window, to make it look easier, i changed the key pressed to 'm' as i believe that does nothing in most trains... but that can be any key you like... a numberpad key might be an idea if no media keys on your keyboard etc.


    Just keep adding the 'mouseclick' lines for all positions you want it to left click in (there is probably a better code to do this that recognised the text box and searches for the button its self, but for me this works ok so far)


    Code
    m::
     {
       mousegetpos, start_x, start_y
       mouseclick, left,2580, 590, 1, 0
       mouseclick, left,2980, 290, 1, 0
       mousemove, %start_x%, %start_y%, 0
     }
    return