It is currently Thu Sep 19, 2019 11:54 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sat Feb 02, 2019 11:00 am 
Offline

Joined: Fri Feb 24, 2012 12:09 pm
Posts: 1005
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 122 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.


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 11:29 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2564
Location: DIGDUG
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.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 1:11 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11412
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 5:44 pm 
Offline

Joined: Fri Feb 24, 2012 12:09 pm
Posts: 1005
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.


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 5:59 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4211
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.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 6:26 pm 
Offline

Joined: Fri Feb 24, 2012 12:09 pm
Posts: 1005
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.


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 6:44 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 4208
Location: A world gone mad
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).


Last edited by koitsu on Sat Feb 02, 2019 6:47 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 6:47 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4211
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.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 8:09 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2312
Location: Fukuoka, Japan
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.


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 8:29 pm 
Offline

Joined: Fri Feb 24, 2012 12:09 pm
Posts: 1005
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 : )


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 8:44 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 4208
Location: A world gone mad
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.


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 10:16 pm 
Offline

Joined: Tue Feb 07, 2017 2:03 am
Posts: 757
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..


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 10:58 pm 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 1042
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.)

_________________
.


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 11:03 pm 
Offline

Joined: Tue Feb 07, 2017 2:03 am
Posts: 757
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".


Top
 Profile  
 
PostPosted: Sat Feb 02, 2019 11:22 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3725
Location: Indianapolis
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group