Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Disable windows key start menu but not shortcuts


  • Please log in to reply
20 replies to this topic
jspenguin
  • Members
  • 1 posts
  • Last active: Mar 18 2010 08:28 PM
  • Joined: 18 Mar 2010
I wanted to find a way to disable the start menu popup but still leave shortcuts like Win+R and Win+L enabled. I messed around for 2 hours trying to figure out a solution and finally stumbled on a 2-line solution:

~LWin Up:: return
~RWin Up:: return

This seems to work on both XP and 7. Haven't tried Vista, but I don't see any reason it wouldn't work.

uogpjf
  • Members
  • 2 posts
  • Last active: Apr 05 2010 03:28 PM
  • Joined: 05 Apr 2010
RWin is OK, I never hit that by accident. But LWin drives me nuts. I guess I have fat fingers, and I hit it a lot: It steals focus, and interrupts my typing.

I tried
~LWin Up:: return

Works for Me! (Windows 7)

Thank you, Thank you, <jspenguin>! I gave up the search some months ago, and you have provided the solution.

tidbit
  • Administrators
  • 2611 posts
  • Not an Administrator
  • Last active: Yesterday, 10:57 PM
  • Joined: 09 Mar 2008
instead of making it a waste of space, you should give it a new function, not just a blank key. if you want it to be blank, just pop the key off the keyboard. but ya know, that's 1 less modifier for you to use as a hotkey. or 1 less shortcut menu or w/e you could do.

I myself have my window keys (actually, only my right one) mapped to a custom menu script.

and BTW: this isn't really a script. in fact, it's the ultra basics of ahk, and this code is even in the Hotkeys page of the manual.

A key or key-combination can be disabled for the entire system by having it do nothing. The following example disables the right-side Windows key:

RWin::return

Found here: Hotkeys (Mouse, Joystick and Keyboard Shortcuts)

rainforest1155
  • Members
  • 3 posts
  • Last active: Apr 08 2010 11:13 PM
  • Joined: 02 Apr 2010
@jspenguin: Yaaay! I've been looking for a way to do it on Win7 for the last couple of days and couldn't come up with a solution that works on Win7. Thanks a lot!


instead of making it a waste of space, you should give it a new function, not just a blank key. if you want it to be blank, just pop the key off the keyboard. but ya know, that's 1 less modifier for you to use as a hotkey. or 1 less shortcut menu or w/e you could do.

Actually, jspenguin's code is very different from the sample code in the FAQ. It does not disable win-key shortcuts - it just disables the key itself if you don't hit any shortcut, but only the winkey itself. The only thing that happens if you hit the winkey itself is that the start menu comes up and steals focus, but you can already get that using ctrl+esc.

sphax
  • Guests
  • Last active:
  • Joined: --
Hello there, I ended up here looking for a way to disable my Windows key.

By the way, I managed it out - thanks to this post - But I have a remaining question :

Is there a way to use the same script file to enable/disable the key depending on its previous state?

I tried something like :

if (~LWin == return)
{
     ~LWin::#
}
else
{
     ~LWin::return
}

But it seems it does not get into the 'else' part...

The goal of that is to simply click my script file to enable/disable the Left Windows Key before I start a game... Actually, I do use the win key with shortcuts & to open the Start menu

Note: I run Windows 7

Any clue, please? :)

LiquidGravity
  • Members
  • 156 posts
  • Last active: Oct 11 2014 04:11 PM
  • Joined: 26 Jan 2009
Look up the variable A_PriorHotkey and its related variables in the AHK help.

sphax
  • Guests
  • Last active:
  • Joined: --
Hello LiquidGravity and thank you for your answer.

I tried something like :


#SingleInstance force

If (A_PriorHotkey = ~LWin)
{
	~LWin::#
}
Else
{
	~LWin::return
}

But could not get the feature I expected to work... Maybe I did not explain clearly my need, so here is a new explanation:

Clicking the same script file must :
- check the Windows key behavior
- Case 1: if it is disabled (~LWin::return), then enables it (~LWin::#)
- Case 2: if it is enabled (~LWin::#), then disables if (~LWin::return)

The usage I want with that is to click my script file, launch my game, have fun, then when I exit, I just have to click the script file again to enable my key.

With the A_PriorHotkey, I found some other examples but people mostly used it for double key strike, or similar... I guess I'm missing something here... :(

MasterFocus
  • Moderators
  • 4322 posts
  • Last active:
  • Joined: 08 Apr 2009
Gui, [color=brown]99[/color]:+Owner

Gui, [color=brown]99[/color]:Show, y-9999 NoActivate, [color=darkred]WinKeyShouldDoNothing[/color]

#UseHook



; Start the script and use [color=red]F1[/color] to toggle. Change this if desired.

[color=red]F1[/color]:: Gui, % "[color=brown]99[/color]:" ( varToggle:=!varToggle ? "Show" : "Cancel" ), NoActivate



#IfWinExist, [color=darkred]WinKeyShouldDoNothing[/color]

~LWin:: Return



#IfWinExist


sphax
  • Guests
  • Last active:
  • Joined: --

Gui, [color=brown]99[/color]:+Owner
Gui, [color=brown]99[/color]:Show, y-9999 NoActivate, [color=darkred]WinKeyShouldDoNothing[/color]
#UseHook

; Start the script and use [color=red]F1[/color] to toggle. Change this if desired.
[color=red]F1[/color]:: Gui, % "[color=brown]99[/color]:" ( varToggle:=!varToggle ? "Show" : "Cancel" ), NoActivate

#IfWinExist, [color=darkred]WinKeyShouldDoNothing[/color]
~LWin:: Return

#IfWinExist


Hello MasterFocus, and thanks!

Reading your snippet, I think I can get its sense... By the way, I failed at running it: hitting F1 creates a windows (I see it when I hit ALT+TAB) and of course it's not activated neither visible...

Hitting F1 again makes the window disappear, which is OK to me. But during this, hitting the Win key do open the start menu :(

Did you get it to work? (again, I run under windows 7, I don't know if it helps or change anything...)

Thanks anyway for helping me dudes :)

MasterFocus
  • Moderators
  • 4322 posts
  • Last active:
  • Joined: 08 Apr 2009
Try this:
Gui, 99:+Owner
Gui, 99:Show, y-9999 NoActivate, WinKeyShouldDoNothing
varToggle := 0 ; Start script with 0, which doesn't block LWin.
#UseHook

#IfWinExist, WinKeyShouldDoNothing
~LWin Up:: Return

[color=red]#IfWinExist[/color]
; Start the script and use [color=red]F12[/color] to toggle. Change this if desired.
[color=red]F12[/color]:: Gui, % "99:" ( [color=darkred](varToggle:=!varToggle)[/color] ? "Show" : "Hide" ), NoActivate


sphax
  • Guests
  • Last active:
  • Joined: --
Perfect!

You saved my day!

this is exactly what I needed, thank you very much for your time :):)

Johnny5k
  • Guests
  • Last active:
  • Joined: --
Thanks jspenguin!! This is a lifesaver when I'm using Windows on my Mac - the Command (Apple) key is mapped to the Windows key, and it was getting really annoying when the Start Menu would pop up all the time!! This is a great solution!

I posted it over on the VMWare Fusion forums too, since nobody had found a solution yet.
http://communities.v...message/1531861

Thanks again!!
-Johnny5k

stumped
  • Guests
  • Last active:
  • Joined: --
not one word made sense not one line helped me find the ****ing menu to turn off the start menu hotkey sry im so stupid

  • Guests
  • Last active:
  • Joined: --

not one line helped me find the **** menu to turn off the start menu hotkey

there isnĀ“t such a menu.
if you are new to autohotkey: read this http://www.autohotke...cs/Tutorial.htm

  • Guests
  • Last active:
  • Joined: --

I wanted to find a way to disable the start menu popup but still leave shortcuts like Win+R and Win+L enabled. I messed around for 2 hours trying to figure out a solution and finally stumbled on a 2-line solution:

~LWin Up:: return
~RWin Up:: return

This seems to work on both XP and 7. Haven't tried Vista, but I don't see any reason it wouldn't work.



I love you!