Menu

#535 Escape key for closing MediaInfo window

User_interface
open
nobody
5
2021-01-27
2019-01-04
No

Is it possible to add Escape key as the shortcut for closing MediaInfo window?
Thank You.

Discussion

  • GodzillaXP

    GodzillaXP - 2020-02-05

    This would really improve my user experiance.

     

    Last edit: GodzillaXP 2020-02-05
  • Andreas Hardcastle

    Ooh, that would be somewhat of a wet dream, indeed!

     
  • Jon W

    Jon W - 2021-01-27

    You can manually set this up with AutoHotkey pretty easily.
    esc:: ; assigns the escape key
    If WinActive ahk_exe MediaInfo.exe ; or ahk_class MediaInfo
    sendinput {^F4} ; Alt + F4 to close the window
    return

    IfWinNotActive ahk_exe MediaInfo.exe (or ifWinNotExist might be better here)
    sendinput {esc} ; sends escape normally
    return

    That above won't work (it's not the actual script it needs proper bracketing) but there's enough search terms there for you to figure it out based off of that, or you could go to AutoHotkey forum and ask and someone to help you. If it's a wet dream for you, this should be a small amount of work for a big reward at the end.

    The downside to this, is that the script needs to run at startup of Windows and run at all times. But you can hide the icon in the system tray, or you can give it your own custom icon.. or add more customization to other programs. It uses extremely low resources for a script like this. And you're free to change the buttons around to suit whatever remove control or keyboard you're using. Or add more things for other programs. What the above does is remap the esc button to close window by sending Alt+F4, but only when MediaInfo is the active window. There's also a way to do it without using Alt-F4.. sending the actual close window command directly that MediaInfo uses. Using the SendMessage command but that is a little more advanced and you need the proper ID number that MediaInfo uses. MPC-BE or HC tell you these command numbers when you assign the keys in Options > Player > Keys. I'm not sure if it's so easy to find them with MediaInfo, but since this is open source, you could dig around inside the code and find it. In MPC it's in the resource.h file that is in the apps > mcplayerc folder. The line is #define ID_FILE_EXIT 816.

    So you would use "SendMessage,0x0111,816,,,ahk_class MPC-BE" (without the quotes) and it will close the program without sending any keyboard inputs at all. You could even have it send this command, and also send the regular escape key input at the same time. It would be a little bit more neat and tidy. Both ways would work very well though. Finally, you could set it up to open and close MediaInfo on the same button, as a toggle on and toggle off. There's many options.

     

    Last edit: Jon W 2021-01-27

Log in to post a comment.

MongoDB Logo MongoDB