Dosbox-x: Add pause key for modern laptops

Created on 4 Mar 2018  Â·  20Comments  Â·  Source: joncampbell123/dosbox-x

Neither "ALT-PAUSE" or "ALT-F16" are available on modern laptops. Please add a key combination that will let you pause emulation on any laptop keyboard, without connecting external keyboards, etc.

enhancement input

All 20 comments

Also many PC-98 games require numeric keypad but there is no simple way to remap the arrow keys to the corresponding numpad keys now in Dosbox-X.

For what's worth it: while many laptops do include a way to use some of the
letters as the numpad keys (either through Num Lock or through the Fn key),
there are some that simply don't (like mine). I did try to work around that
using a joy2key program but turned out I couldn't map the numpad keys
without actually having them (had to edit its configuration with a text
editor and look up scancodes to make it work).

So yeah, a way to easily change mappings could be useful.

Please consider using Ctrl+Shift+F1 to bring up the mapper interface, which will let you remap keys to accomplish what you need.

We're currently cleaning up the keyboard shortcuts with a "host key" concept. https://github.com/joncampbell123/dosbox-x/issues/569 Any suggestions for what the shortcut should be to trigger the debugger?

@joncampbell123: Pausing emulation would seem quite essential to the average user and should have a standard, built-in, easy accessible shortcut.

Have a look at how VirtualBox does host keys. If you can re-use that, that would be something people are used to from a related piece of software.

Macs are moving away from F-keys, so a conscious step to make new shortcuts would be well advised to avoid them. I already have to press Fn to utilise F-keys, so shortcuts require three keypresses.

@forthrin Several things I suggest:

Some of us still like using function keys, however, I agree in not making them the default shortcut.

Most of VirtualBox's host key shortcuts tend to be the A-Z keys, which is helpful.

My other plan to mitigate the mess of default shortcuts is to eventually take the Windows menu code and make it more generic so that Linux and Mac OS X builds have a menu as well, and then non-essential default mapper shortcuts can be removed and the command accessible in the menu instead.

The most recent Apple macbooks have a touch bar, which might be an interesting support option for Mac OS X builds if it's present, and could tie into DOSBox-X's mapper as well if someone has the hardware and willingness to submit patches. At the very least the touch bar could be programmed to show function keys.

Perhaps there could be a couple default mappers built-in, easily selectable with a line in the conf file (even if there is a way to reconfigure each and every key manually, which I assume you can persist in some fashion). I really like the f-keys, (although one of them conflicts with one of my games), so I'd continue to use them as defaults. There's also something to be said for having the same defaults as mainstream Dosbox.

I don't have a great suggestion for replacing Ctrl-Break / Ctrl-Pause on laptops. Maybe Ctrl - Tilde? ( ~ )

I'll be honest, every laptop I've owned still has a break/pause key, and desktop keyboards still have it.

Perhaps it would be best to maintain a break/pause key mapping by default, but allow remapping as always.

Though some keyboards may still have a pause key, it's clearly a legacy thing. Anyway, I propose to consider how often different keys are used, or look at how they are logically grouped:

1. Generic useful keys, frequently used, and important to have easy access to. Capture mouse would be part of a potential Host key, wouldn't it? (I think I use OS alt+Tab to do this.)
ALT-ENTER | Switch to full-screen (and back).
ALT-PAUSE (ALT-F16 on OS X) | Pause emulation.
CTRL-F4 | Update cached information about mounted drives.
CTRL-F10 | Capture/Release the mouse

2. Keys related to performance, I rarely use these myself, but I suppose they are required to make some programs run correctly.
CTRL-F7 | Decreases frameskip.
CTRL-F8 | Increases frameskip.
CTRL-F11 | Decrease DOSBox cycles
CTRL-F12 | Increase DOSBox cycles
ALT-F12 | Unlock speed (turbo button).

3. Keys related to recording. I don't use these myself, but I guess popular with people who make YouTube walkthroughs, etc.
CTRL-F5 | Save a screenshot (goes to capture folder).
CTRL-ALT-F5 | Start/Stop recording of AVI video.
CTRL-F6 | Start/Stop recording sound output to a wave file
CTRL-ALT-F7 | Start/Stop recording of OPL commands.
CTRL-ALT-F8 | Start/Stop the recording of raw MIDI commands.

4. Other keys: Quit should if possible follow the OS convention. A separate key for key mapper? Isn't this the kind of thing you do once, if ever? I'd be perfectly happy to do this in an .ini file.
CTRL-F9 | Kill (close) DOSBox.
CTRL-F1 | Show the keymapper configuration screen,

None of the current keys have any logical meaning except Alt+Enter and Alt+Pause. Some things to consider for a new design includes:

  • Introduction of a Host key
  • More logical keys (like +/- for speed-related things)
  • Cursor-navigated OSD menu for less frequently used functions

Here are my recommendations for the bindings. Please remember I am only discussing the default binding, the option will always be there to bind to whatever key you like.

ALT-ENTER: Should be bound to the host key and combo instead. Binding fullscreen to ALT-ENTER makes it impossible to use ALT-ENTER to bring a DOS window fullscreen in Windows 3.1.
ALT-PAUSE: No problem, so far. On my builds, this brings up the debugger instead.
CTRL-F4: This is the swap floppy command. I think it should be moved to a host key combination instead, especially when the guest OS is Windows 3.1.
CTRL-F10: I suggest moving to a host key combination.

CTRL-F7, CTRL-F8: I don't think very many people use frameskip. Once the Windows menus are ported to all platforms these default bindings should be removed and the commands put in the menus instead. But, the mapper will still support binding these functions if desired.
CTRL-F11/CTRL-F12: I use these bindings quite a bit. Since they involve F11-F12 and not any keys a game or Windows application would likely use, I suggest keeping these as-is.
ALT-F12: Unlock speed can remain on ALT-F12, should not conflict with either DOS games or Windows 3.1

Screenshot and start/stop recording AVI and WAV should be host key shortcuts. OPL and MIDI capture should not have bindings by default (but you can assign one), and should be moved to the menu (once the menu is ported from Windows to all platforms).

CTRL-F1 should be moved to host key + F1 for the mapper. CTRL+F1 sounds like something a DOS or Windows application might use.

Just FYI, I just took a look at 5 relatively new laptops that I have access to. The 2 gaming laptops have both pause/break keys and prtsc keys. The 2 ultrabooks (LG and Samsung) do not have pause/break, but they do have prtsc keys. The Microsoft Surface laptops don't have either.

Perhaps prtsc is another option for the host key

Do they all have F11/F12? My original suggestion is to make F12 a host key to avoid conflicts with DOS games and Windows 3.1

For what matters: my laptop has Pause key as Fn+Right Shift

Yes, they all have F12. A few comments:

  • I think DosBox should be able to capture the Windows key for use either in a guest OS, or as the host key, or let the host OS use it (as is the default). Personally I'd like to disable the windows key so it cannot be accidentally pressed when my kids are playing games on it. I imagine that this should be able to be done (or perhaps is already possible) in the keymapper.
  • A way to switch Dosbox from fullscreen to windowed mode should be an easy-to-use shortcut. (Alternatively, to minimize Dosbox.) I commonly use the windows key for this purpose, rather than alt-tab, but either is fine. Because these keys are so well-known, I'd be hesitant to remove both of them from the default configuration -- someone might not know how to exit a locked-up fullscreen game.
  • If the Windows key, alt-tab, or alt-enter are redefined, it might be a good idea to have this optionally only take effect when in fullscreen mode, similar to how Remote Desktop captures alt-tab and alt-enter in fullscreen mode, but not in windowed mode.

@Shane32 DOSBox-X can already capture the Windows key IF you capture the mouse and keyboard.

The Pause key doesn't seem like much to depend upon, with a plethora of non-standard workarounds:

Compact and notebook keyboards often do not have a dedicated Pause/Break key.

These may use the following substitutes for Break:

Ctrl+Fn+F11 or Fn+B or Fn+Ctrl+B on certain Lenovo laptops.
Ctrl+Fn+B on certain Dell laptops.
Fn+Esc on Samsung.
Ctrl+Fn+⇧ Shift on certain HP laptops.

Substitutes for Pause:

Fn+P or Fn+Ctrl+P or Fn+Alt+P on certain Lenovo laptops.
Fn+B on certain Dell laptops.
Fn+⇧ Shift on certain HP laptops.
Apple keyboards do not have the Pause/Break key, as Mac OS X does not use it. The key may be substituted by Fn+Esc.

For some Dell laptops without a Break key press the ALT+Space bar and select "Interrupt".

Another reason not to use Alt-Enter for full-screen toggle is that Alt-Enter brings up the Properties dialog for Windows 3.1 Program Manager items.

Unfortunately it looks that you can't really remap pause, because you will not be able to un-pause (resume) with the remapped key.

While it may be possible to find common keys for all OSes, I think some keys will necessarily have to follow precendent established by OSes and physical keyboards, in practice meaning 1) macOS and Mac keyboards, and 2) Windows/Linux and PC keyboards.

To make things more complicated, each OS often has several standards. For example, Alt+Enter or Alt+D for full screen is a Windows thing, while macOS might use Cmd+Ctrl+F or just Cmd+F.

I should also mention that non-US keyboards some times have keys such as square brackets, tilde, etc. in different physical places and also requiring use of modifiers. European users can't press alt + [ because [ itself requires alt. Safe keys are A-Z, 0-9 and usually shift 0-9.

Thus: 1) Lean on OS precedents where applicable. 2) Use keys equally available everywhere.

Was this page helpful?
0 / 5 - 0 ratings