VOGONS


First post, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

This question is about a convenience feature, not anything that's required for use with games, so I don't expect the devs to read beyond this first sentence.

I've been trying to figure out how to use a key-combination to open the DOSBox Win32 system menu (the icon at the upper left of the window with Minimize, Maximize, Move, etc.). It might be convenient to use the keyboard only to access this menu when you want to minimize a window or move the window around the screen.

The system menu of Wndows apps normally opens when you press Alt-Space. That would not be a good idea in DOSBox, since DOS apps (and perhaps some games) use the Alt-Space key-combination for other purposes, and DOSBox rightly does not support this key-combination for opening the system menu.

The closest I've got to solving this are some old posts in game and SDL forums that tell how to prevent SDL from intercepting Alt-Space so that it can go the OS and open the system menu. But doesn't solve the problem. What might be useful would be some way to use (for example) Ctrl-Alt-Space to open the system menu.

I've been studying sdlmain.cpp for a possible way to do this, but it's far beyond my abilities. If anyone has a suggestion, I'd be very grateful, and I think it might be useful for other custom projects.

Reply 1 of 4, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

I'm not sure that this is worth adding in Dosbox itself. If the default doesn't work because it conflicts with in app keystrikes assigning it another key won't help confused people.
I know you are doing this mostly for yourself so the confused people is not really a good reason 😉
But maybe try another approach and instead of doing it with sdl or dosbox sources, try autoit or autohotkey to script it.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 4, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
Dominus wrote:

But maybe try another approach and instead of doing it with sdl or dosbox sources, try autoit or autohotkey to script it.

Actually, that's an excellent alternative, and I wish I had thought of it.

The WordPerfect system that I put together has a compiled AutoIt script running in the background (for sending print files to the printer, creating PDFs, exchanging data with the clipboard, etc.), and it shouldn't be hard to script it so that a specified keystroke opens the DOSBox system menu when it's running in a window. It should take about five lines of code at most.

I had hoped to be able to bake it into DOSBox, but there's no real need to do so.

Thanks again for looking at this from a different perspective - which provided an answer.

Reply 4 of 4, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

Now that I've done this (via Autoscript), I see why I should NOT have done it.

I didn't think it through - if you use the keyboard to open the system menu, then you're likely to use the keyboard to choose items on the menu. I captured Ctrl-Alt-Space, and used that to open the menu, but every other keystroke I use when actually IN the menu gets passed through to DOSBox - which is of course NOT what should happen.

I'm still VERY grateful to you for giving me the method of doing this - because I would have spent many more days trying to solve it!