NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyboard

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyboard
by on (#233469)
My trusty DOS keyboards are all suffering from coffee damages, and I am finally forced to use one of these new windows 95 keyboards with shortened space-bars and new microsoft-logo-keys that have popped up everywhere in recent decades. It's particulary unpleasant in countries that use the right Alt key as AltGr key (for entering symbols like square brackets). The AltGr key is mounted right behind the aforementioned coffee cup, and I am hitting one of the new microsoft-logo-keys everythime when fiddling for AltGr, causing my input window to lose keyboard focus, and windows opening the start menu, apparently believing that I would want to visit my favourites, which, no, I don't want that, thanks.

Looking for workarounds, I've found this method: http://hackage.haskell.org/package/GLFW ... 2_enable.c - it's using WH_KEYBOARD_LL hook (for WinNT) and SPI_SETSCREENSAVERRUNNING flag (for Win9x). It's somewhat working, and I was happy with it... until I had noticed that the screensaver trick disables nearly all hotkeys, up to including Ctrl+Alt-Del.
Another method is reportedly editing scancode entries via regedit, but I didn't got that working under win98.

So here's another approach (exe and source code):
Attachment:
Nokey95.zip [2.98 KiB]
Downloaded 126 times
It's using WH_KEYBOARD hook (instead of WH_KEYBOARD_LL) and sends a dummy keybd_event to fool windows into thinking that another key was pressed or released while LWIN/RWIN was held down - so it won't freak out with start menu if the user releases the LWIN/RWIN key.
So far, it's working more or less okay under win98, and it's almost certainly better than the screensaver trick. One (dis-)advantage is that system key combinations are still working (eg. LWIN+D brings up the desktop).

One possible issue is that the start menu does pop up occassionally when quickly hammering both LWIN and RWIN keys as fast as possible (that's rarely happening during normal use, and I don't know if it's actually ever happening on normal keyboards; as opposed to my crappy-cheap keyboard with bugged firmware). Well, and another issue is LWIN/RWIN seems to get stuck occassionally, so pressing D would be seen as LWIN+D (again, that might be a keyboard firmware bug).

Does that new method sound useful to anybody? Would be interesting to know if it's working with all windows versions, and if the above two issues occur on other keyboards, too.

Usage is: Start the Nokey95.exe file manually (or automatically via StartUp folder). And use Ctrl+Alt+Del if you want to terminate Nokey95.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233474)
Quote:
I am hitting one of the new microsoft-logo-keys


After doing this 100 times, you would train yourself not to hit this button. Eventually "muscle memory" would engrained and it would stop being a problem.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233479)
I've been avoiding this key for years without much trouble. Ironically, I don't think I've ever used it intentionally on a Windows PC, I've only ever used it on a Mac, when I briefly worked for a company that only had Mac Minis.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233500)
Might have worked for me, too, but only if I would have obeyed in buying one of those keyboards when they came out, would have quit drinking coffee, and found a profession where I won't need square brackets. But now I am too old & stubborn for that, and I am not planning to go into training my muscles (except perhaps on physically destroying those keys and throwing them into fire, which must be extremly satisfying (yes, I know, burning plastic isn't good, but one could make small exceptions)).

I've never understood how it had happened that nearly all keyboard manufacturers and keyboard users ended up with those microsoft logos. I am wondering if it's legal to monopolize keyboard keys that way. Commodore were doing it, too, but they were doing it only on their own computers.

Btw. searching for "microsoft logo" "keyboard" "licensing" doesn't give too many hits. The only relevant search result seems to be this: http://download.microsoft.com/download/ ... ancode.doc - the .doc format is a bit hard to read in a text editor, and I haven't figured out if or how much money they are charging for using their company logo on PC keyboards. It would be quite amazing if they were actually charging license fees for using keyboards as free advertising space.

At least, they have granted permission "to refer to the Logo keys in documentation" without needing to obtain licenses for such references. I hope that permission does also apply for mentioning the logo keys in this thread.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233502)
There's a registry key for selectively disabling keys on the keyboard if you really need them disabled. I've done it for Caps Lock before.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233505)
Like this, https://www.daniweb.com/programming/sof ... is-running ? I have tried so, but either I got it wrong, or it doesn't work for win98. The advantage would be that it doesn't require a key-hook process running in background. The disadvantage is that one needs to reboot the computer to apply the changes (and even then, still doesn't work for me).

Btw. the keyboard hook is needed only for system wide deactivation of the offending keys. To disable the keys only in a single window, one can watch for WM_KEYDOWN messages with VK_LWIN or VK_RWIN, and then throw the dummy "keybd_event" from within of the message handler.

Yeah, Caps Lock is equally bad. I don't know if it's a bug in my own software, or if it's a generic windows feature... but if I do ever touch that key then trying to re-disable caps-locking is like fighting windmills (it locks back on any time when switching to a different window). The only workaround is to reboot the PC, but, in this case I've actually trained myself to never touch that key.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233507)
Dwedit wrote:
There's a registry key for selectively disabling keys on the keyboard if you really need them disabled. I've done it for Caps Lock before.

HKLM\System\CurrentControlSet\Control\Keyboard Layout\Scancode Map -> new REG_BINARY -> 00000000000000000300000000005BE000005CE000000000 followed by a reboot. Note Keyboard Layout not Keyboard Layouts, and the space in the regkey name.

This page goes into the syntactical details of the regkey in question: https://www.experts-exchange.com/articl ... eyond.html (not normally a site I'd link to, that's for sure)

I try very very hard to avoid programs that act as intermediary keyboard filters. I've seen all of them -- and I do mean all (that I have tried over the years) -- cause all sorts of very uncomfortable anomalies depending on their implementation and key sequence + modifiers + events. Since the above lets you remap scancodes natively in Windows, I've always advocated its use over another layer of software that can mess things up.

As for the Windows key(s) themselves: I too hate them (and the Menu key), but I've forced myself to just accept their existence and trained my muscle memory to not touch them when typing, because I can't be bothered going to great extremes to buy specialised keyboards that omit them. It took quite some time to train my fingers to be placed differently though (probably over a year).
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233508)
I made a low level keyboard hook one time as part of the MyAeroSnap program. It let you use WindowKey + Left/Right to place a window to the left or right side of the screen, like the Aero Snap feature in Vista/7. This was when I was still using Windows XP.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233514)
The only time I was using it in the past was win+L to lock the session and that's it. Now, with windows 10, I use ctr-win to switch desktop but it so cramped that it feels awkward :lol: except for that, I never use it.

But since you talk about win98... At that time I was hating that key the most :D . I always found that key was in the way when playing game and was always hitting it by accident.

So the shortcut I'm talking about are maybe not useful at all in your case. Remapping the key (if possible in win98) for your own need could be a solution since finding keyboard without one is quite expensive unfortunately.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233516)
With win98, the https://www.experts-exchange.com link is definetly not working in any browsers, does it contain how-to info for win98? Win98 has these three registry entries matching "keyboard layout(s)", I don't remember which one I was trying to edit, and don't want to retry/reboot at the moment, and regedit doesn't even allow to copy-paste the required hex numbers : /
HKEY_CURRENT_USER\keyboard layout
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\keyboard layouts
HKEY_USERS\.DEFAULT\keyboard layout

Yeah, hooking might bring up it's own problems. In this case the dummy "keybd_event" might potentially confuse something. It's currently issuing a dummy key-release for an invalid key number (zero used as scan code and virt code). Alternately one could, for example, issue a key-release for ESC key. Either one could theoretically mess up something, hard to say which one is less risky (until something goes wrong someday/somewhere).

For now I am happy with nokey95. I'll see if it's causing problems in future.

I was originally also planning to add the same feature in the no$xxx emulator/debugger GUIs. For that purpose it might be best to handle WM_KEYDOWN instead of the more common system wide WH_KEYBOARD (_LL) hooking. But well, for one point, it's almost a must-have feature for gaming, emulation, and text editing - on the other hand, that kind of trickery might backfire if it goes wrong on some OS versions.

What I could probably safely do is popping up an insulting message box like "You Loser, your keyboard and your muscle training sucks! Now go download NoKey95 or find some other way to disable your Spamkeys!" if somebody hits LWIN or RWIN in my software : )
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233519)
nocash wrote:
With win98, the https://www.experts-exchange.com link is definetly not working in any browsers, does it contain how-to info for win98?

The site probably doesn't work because of TLS/SSL requirements and substantially outdated CA lists, etc.. It doesn't surprise me in the least, and I don't think anything can be done about that.

I didn't realise Windows 98 was a requirement here. I had to re-read your initial post where I caught "... I didn't got that working under win98 ..." mixed in with all the other info.

No, I don't think this will work on Windows 9x; it's probably going to be a Vista+ feature. Sorry for that.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233522)
This is just sad...

Ok the Windows key is a really nice key in windows..

Win + E = opens a windows explorer window ( no 1 thing people complain about a mac is lack of this )
Win + Left arrow, Right Arrow = Windows snapping instantly snaps a window to take up half a screen and will cycle through monitors. Win 10 once you have done this you can use Up and Down to go to quarters
Win + Up Arrow = Maximise the window
Win + Down Arrow = Minimize window
Win + 1-0 = will launch the pined program on the task bar - if said program is already open it will switch to it
Win + Space = will switch language input systems if that is important to you
Win + D = Minimize all windows and hence show you the desktop
Win + Tab = Expose from Win 3. This will shrink all windows into smaller window tiles on the monitor the application is on and allows you to visually see the contents, you can then click to tab move to select the window you want
Win + L = Fast lock if you work in an office

the lack of windows key is what stops me from using my Commodore "m100" keyboard.. no Win key is just too painful these days.

However since I think NoCash in on 98 Win + E/D is the only unusable to him. To which if its that much of a problem get one with a Key caps and just remove the key( also get one that is spill proof, MS keyboards are nice for this )
However the Left side usually has the "menu" key not a Windows key. This acts as a right click on a mouse, without having to leave the keyboard.

As for evil keys of the Win98 era, remember when MS decided to copy Apple and put a Sleep key on the keyboard, dark times..
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233523)
Other commands with the Windows logo key:

Win + R = run dialog
Win (by itself) = display start menu

I don't like much they put Windows logo there (it should be some text instead) since not all computers will use Windows, and the key can still be applicable to other operating systems too sometimes. Not for DOS, but on Linux you might configure it as the window manager's key or perhaps as something else that might be missing on your computer. (For example, I have it together with enter to run xterm, with semicolon to run xrefresh, with arrow keys to switch between windows, and some other functions.)

(On Windows, I have often used Win+R for the run dialog.)
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233524)
I think for a windows keyboard it is neater and easier to make out the windows logo. However you can get "non-windows" keyboards if you don't want a "windows logo".
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233528)
Yeah, it is kind of tacky and annoying that there is a "windows" key. I personally use win+r, win+d all the time though.

I've been using a Logitech G15 keyboard for a long time (I even supported its LCD screen in my Squeedo synth player). But I bring it up because this keyboard has a "game mode" switch, which simply disables the windows key. I rarely hit it accidentally anymore, but I like being able to turn it off easily. What really gets me though, is the icon on the switch looks like an Atari 2600 joystick. The windows keys on this keyboard also have a large, round indentation on them. I'm not sure if that's a common thing or not, but I find it helpful, in the same way that the F and J keys have those little nubs on them.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233529)
If you use modern windows os, then you can use a Corsair Keyboard I have the K55, which
a.) with iCue lets you map and key to any other key/macro you want
b.) auto switch its mode when you launch a program
c.) has a lock key which you can program to disable anything you want.

However it can store such info onboard, so if you know somebody with a modern OS, you could program the keyboard to lock what you want, and then use it on an older one.


Also worth mentioning, I've never had any issues with the caps lock key "locking" on windows from 3.1 to now. Sounds like a driver issue.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233532)
The registry thing mentioned earlier to remap keys etc. only works in NT line, it doesn't work in 9x. You will have to hack the keyboard VXD directly to get rid of winkey or do like me in past and put tape on the contacts inside the keyboard.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233543)
Or in other OSes like Linux or BSD you can map any key to anything you want. My "windows" key is a Ctrl.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233565)
The generic term for that key on PC-like platforms is "Super key". Mac keyboards have the place of interest symbol (⌘) instead of the Windows logo, obviously. Wikipedia uses a squared plus sign (⊞).
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233570)
On Amiga keyboards they are called Amiga and Open Amiga, but I think some also had a "boing" key, in one of the branches of the holy wars.

http://www.wasdkeyboards.com/index.php/ ... board.html <- you can have Win 7, Win 8, Tux, Ubuntu, Amiga or Mac design on the keys. Or even whatever else you want
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233592)
Oziphantom wrote:
This is just sad...
Ok the Windows key is a really nice key in windows..

Thanks for a different opinion! Yes, I noticed Microsoft+D being potentially useful, I might even like using that function (at least if it were not having a company logo on the key). NoKey95 doesn't actually disable that key combinations - it does only prevent losing keyboard focus & start menu popping up when pushing & releasing the microsoft keys.

koitsu wrote:
I didn't realise Windows 98 was a requirement here.

Well, not a general requirement for the whole thread. It's just what I am using & what I've tested so far.

Memblers wrote:
The windows keys on this keyboard also have a large, round indentation on them. I'm not sure if that's a common thing or not

The indentation as such sounds useful, something like that is mentioned under Licensing on https://en.wikipedia.org/wiki/Windows_key - I guess PC keyboard makers are simply not allowed to use different designs or logos without permission, or if they do, they might be unable to declare the keyboard (or the whole pc) as "compatible with microsoft windows". Or maybe they just can't use different symbols because millions of customers would then complain that they can't find the "windows key" on their keyboards.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233599)
Nowadays, I mainly use WindowsKey+Tab, which can be used to move a nonresponsive fullscreen program to another desktop, so you can kill it.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233604)
As an physical alternative, you might just take the keycap off? Maybe that leaves an objectionable open key hole though... Could go further and break off or drill out the stem from the windows key so it can't press the switch.

If you're into buckling springs I think you can order Unicomp keyboards without a windows key. They're a little bit expensive though.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233622)
How practical would it be to 3D print a replacement keycap that's less tall? That way, it would feel recessed compared to the other keys, giving a bit more tactile reference as to where the fingers are. Compare how the Caps Lock key (to the left of the home row) is shaped on a ThinkPad keyboard like mine: there's a gap between the tallest part of the key cap and A.
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233659)
Windows+PauseBreak opens computer properties - very useful.
Try hardware approach - put small rectangular 1cmx1cm piece of paper between the two conductive foils of keyboard matrix under the key you want to permanently disable :D
Re: NoKey95: Disabling Microsoft-Logo-Keys on Windows95 keyb
by on (#233703)
I fully agree with these new keys to be annoying. When they first came out I also kept hitting them by accident (why in the world would you need TWO dedicated keys for that stupid start button??), and when doing that in a full-screen application, like a game, it would often minimize the game or do other weird stuff.

I eventually got used to it I guess, and I do use the left windows key when I feel like operating Windows without the mouse, or to use above-mentioned short-cuts. But I still find the right windows key useless and just making the keyboard unnecessarily cramped and complicates the use of Alt Gr as you said. The menu key however, I find useful when operating without the mouse to speed up the work.

Talking about cramped area around Alt Gr, since I'm working in Japan I had to get used to Japanese keyboards which are even worse in this department. Japanese keyboards seems to get rid of the useless right windows key so there are space for a bunch of Japanese input-related keys, that nobody are using because everyone use the romaji input method which doesn't require any special keys.

I've seen keyboards without a logo at all on the windows/super key. I just thought they didn't have the rights to make it. I'd prefer some neutral symbol on it though.

Back to topic, yeah I'd look into a mechanical keyboard with ability to disable these keys (if windows 98 can take modern USB keyboards that is). I think the Ducky keyboards are cool because they don't rely on any fancy drivers, just the standard stuff. All features are internal to the keyboard and should therefore work with anything that supports USB keyboards.