joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.65k stars 377 forks source link

Numlock, Caps lock, Scroll lock, Fn lock, Keyboard layout - sync with host #3634

Open Torinde opened 2 years ago

Torinde commented 2 years ago

Is your feature request related to a problem? Please describe.

It's disconcerting when the keyboard behaves differently depending on which window I have in focus (e.g. normal host application vs DOSbox-X) - e.g. if in one I get small letters, in the other capitals, etc.

What you want

Option (and toggle in menu) to keep the host and DOSbox-X status in sync - for lock-keys and also for the keyboard layout (e.g. Latin/Greek).

For the lock keys it's clear - if host caps lock is enabled, DOSbox-X caps lock to be enabled as well (and vice versa), etc. For keyboard layout - pre-filled table of correspondence, but user can overwrite in conf - listing keyb/codepage/Windows-layout/Linux-layout combinations, e.g. if my currently active layout in DOSbox is Greek - and I have Greek layout installed in Windows - then automatically switch Windows also to Greek. (but if that's too much - even a pre-filled correspondence covering the most common cases will be great).

Also, LED indicators on the host keyboard should be in sync as well (in case it's possible to turn Numlock on, but not its LED) - that will be useful for DOS programs and games that manipulate those LED indicators (e.g. flashing with certain frequency in sync with some event/status, use as 4 step progress-bar, etc.).

Describe alternatives you've considered

No response

Additional information

No response

Have you checked that no similar feature request(s) exist?

Code of Conduct & Contributing Guidelines

Torinde commented 1 month ago

https://github.com/schellingb/dosbox-pure/commit/98d103bb6c9df9dd438e310b14aed16f38afea1f

Pass host keyboard LED state (num-lock, caps-lock, scroll-lock) to emulation if available