Forum > Options
Ability to use the Win key to assign a specific IDE function
flowCRANE:
I had been working on ThinkPad laptops for a very long time, and they had a great keyboard. One of the advantages was that the up arrow key had keys with the codes VK_BROWSER_BACK and VK_BROWSER_FORWARD on either side (see the attachment). I had assigned functions to these keys that allowed me to move around the code editor tabs and jump between code editor windows (alone keys to switch between tabs in a given editor window, with the Ctrl key to switch between editor windows). This made working very convenient.
I recently switched to a stationary PC and am currently working on a full-size keyboard that does not have these two keys. So I lost the ability to conveniently move between tabs and windows. For now, I have set other shortcuts for these functions (Ctrl+Tab and Shift+Ctrl+Tab to change tabs and Ctrl+` to change the editor window), but they are not convenient for me.
Up until now I had my shortcuts set up so that I could either use my right hand to use these functions (e.g. BrowserNext to change tabs), or both (e.g. Ctrl+BrowserNext to change windows). Now I have to use only my left hand (e.g. Ctrl+Tab), which is a real pain for me because I have to fight muscle memory.
Ideally, I could use the arrow keys combined with one of the special keys on the left side of the keyboard. The available keys are: Ctrl, Shift, Alt, and Win. I already use the first three keys for many code editor functions, so I no longer have any sensible shortcuts that would be unassigned — the Win key remains.
If it were possible to use the Win key for IDE function shortcuts, I would use it — Win+Left/Right to move between tabs in the active code editor window and, for example, Ctrl+Win+Left/Right to move between code editor windows. That would be very convenient for me. Well, it would be, because the IDE does not allow the use of the Win key in IDE function shortcuts.
Why? Why can't you use this key?
Martin_fr:
I know the feeling... Could us a few extra keys myself.
Ignoring issue with cross platform....
Have you tried? In your own app? To react to those keys and suppress it from going to Windows? IIRC it can be suppressed (in most cases) if another key is pressed with it (while it is hold down). But if you press and depress it, without pressing another key (maybe changed your mind) then the start up menu pops up. It may not bother you, but it's not a user experience for everyone.
Considering that the "Alt + Ctrl" keycodes already cause trouble, because they can't be distinguished from AltGr and that is needed to type various common keys on non English keyboards... The Win key is going to call for even more trouble.
marcov:
IIRC those keys are reserved for system level usage on Windows, and not passed onto applications.
440bx:
Take what follows with a grain of salt because I've never tried using the Winkey in my code.
It _seems_ that it should be possible for user code to use the Winkey. I say that because some MS Office apps make use of it. For instance, in Onenote win-shift-s takes a screenshot (per Wikipedia.)
It should not take much work to write a little test program to see if an app/window gets a WM_CHAR (or some other message) upon the winkey being pressed/depressed.
Of course, using the winkey is a bit problematic because MS seems to have reserved that key for itself. Therefore any use you make of it could easily conflict with ways it's already used or will be used in the future (by MS.)
HTH.
440bx:
Just tried it...
for the winkey an app gets a WM_KEYDOWN followed by a WM_KEYUP.
Windows reacts to the WM_KEYUP. That's when it chooses to show the start menu.
One possible useful characteristic is that if the user presses shift, alt, or ctrl _before_ pressing the winkey then Windows does not do anything. IOW, if you required the other keys to be pressed first then you could assign some functions to combinations that include the winkey.
The other possibility would be to "eat" the winkey in all cases thereby preventing windows from seeing/using it. IOW, usurping the winkey for your program. :)
HTH.
Navigation
[0] Message Index
[#] Next page