Jump to content


Photo

Disable windows key start menu but not shortcuts


  • Please log in to reply
15 replies to this topic

#1 jspenguin

jspenguin
  • Members
  • 1 posts

Posted 18 March 2010 - 05:51 PM

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.

#2 uogpjf

uogpjf
  • Members
  • 2 posts

Posted 05 April 2010 - 03:46 PM

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.

#3 tidbit

tidbit
  • Moderators
  • 2288 posts

Posted 05 April 2010 - 03:58 PM

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)

#4 rainforest1155

rainforest1155
  • Members
  • 3 posts

Posted 05 April 2010 - 04:29 PM

@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.

#5 sphax

sphax
  • Guests

Posted 12 April 2010 - 03:31 PM

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? :)

#6 LiquidGravity

LiquidGravity
  • Members
  • 154 posts

Posted 13 April 2010 - 02:30 AM

Look up the variable A_PriorHotkey and its related variables in the AHK help.

#7 sphax

sphax
  • Guests

Posted 13 April 2010 - 08:40 AM

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... :(

#8 MasterFocus

MasterFocus
  • Moderators
  • 4126 posts

Posted 13 April 2010 - 12:53 PM

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


#9 sphax

sphax
  • Guests

Posted 13 April 2010 - 03:11 PM

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 :)

#10 MasterFocus

MasterFocus
  • Moderators
  • 4126 posts

Posted 13 April 2010 - 07:46 PM

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


#11 sphax

sphax
  • Guests

Posted 14 April 2010 - 08:29 AM

Perfect!

You saved my day!

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

#12 Johnny5k

Johnny5k
  • Guests

Posted 12 May 2010 - 06:44 AM

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

#13 stumped

stumped
  • Guests

Posted 11 September 2010 - 06:08 PM

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

#14 Guests

  • Guests

Posted 11 September 2010 - 06:55 PM

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

#15 Guests

  • Guests

Posted 06 January 2011 - 01:32 AM

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!