INPUT - Code Donation: Disable Windows Keys

Here you can discuss the development of patches.

INPUT - Code Donation: Disable Windows Keys

Postby dezipaitor » 2013-10-26 @ 15:48

Hi

Since I had several bad contacts with the Windows keys in a DOS game session, I decided to disable these keys when DosBox has input focus.
I know there are little programs out there to solve this problem, but it is hard to find them, and usually nobody can trust them.

The attachement contains a patch file and the whole file sdlmain.cpp from svn revision 3827 .

The code is only compiled for WIN32 (#ifdef), and by default it is inactive. It can be made active in two ways:
Using command line parameter: -disablespecialkeys OR in dosbox.conf file in the [sdl] section by adding the line disablespecialkeys=true
The Windows keys are disabled if DosBox has focus and are enabled if DosBox loses focus.

The configuration is called "special" because it may also be useful for other platforms.

Of course, the code is released under the (DosBox) GPL license.

I hope the code becomes official so everybody can get its advantage.

THX for your GREAT WORK!

EDIT:
Reuploaded attachement due to minor fix.
You do not have the required permissions to view the files attached to this post.
Last edited by dezipaitor on 2013-10-28 @ 19:28, edited 1 time in total.
dezipaitor
Newbie
 
Posts: 2
Joined: 2013-10-26 @ 15:28

Re: Code Donation: Disable Windows Keys

Postby Joey_sw » 2013-10-26 @ 23:54

is that would disable the "Application/Menu" Key (the key which located the left of Right-Ctrl on standard layout post-win95-keyboard) ?
as I map that key to "Mod1" in dosbox to free the "Ctrl+" or "Alt+" key combination for the dos-program/games' usages.
-fffuuu
User avatar
Joey_sw
Oldbie
 
Posts: 542
Joined: 2011-8-17 @ 12:03

Re: Code Donation: Disable Windows Keys

Postby dezipaitor » 2013-10-27 @ 09:23

Yes, both windows keys between left and right control and alt keys are disabled. Alt+Tab is not disabled.
dezipaitor
Newbie
 
Posts: 2
Joined: 2013-10-26 @ 15:28

Re: Code Donation: Disable Windows Keys

Postby Dominus » 2013-10-27 @ 10:23

Moving to the patches forum
User avatar
Dominus
DOSBox Moderator
 
Posts: 7385
Joined: 2002-10-03 @ 09:54
Location: Vienna


Return to DOSBox Patches

Who is online

Users browsing this forum: NY00123, olddos25 and 1 guest