AutoHotkey Community

It is currently May 27th, 2012, 11:59 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Suppressing Windows keys
PostPosted: November 19th, 2005, 5:42 pm 
Offline

Joined: November 26th, 2004, 8:31 am
Posts: 21
After 10 years, my old Windows-unaware keyboard finally stopped working reliably, so I had to buy a new keyboard (Genius KB-16e, for those who are curious). Well, the first think I did was refrain from using the supplied driver (because I am sure AutoHotKey will do a far better job), the second was starting to write a script that would disable Windows and Menu keys. I disabled Menu easily enough:

Code:
AppsKey:: return


but I am at a loss as to how to disable the Windows key. The problem is that while I want to disable the key when pressed alone (Windows-down, Windows-up ----> Start menu is displayed), I want to keep the key as a modifier for shortcuts (Windows + L ----> Lock Workstation). At first I thought I would simply write it as a hotstring, but apparently that's not possible. So I decided I would write three handlers:

Code:
LWin::
  WindowsKeyDown = 1

$LWin Up::
  If WindowsKeyDown <> 1
    Send, {LWIN UP}

~anykey::
  WindowsKeyDown = 0

But there I found another problem: How do I address "anykey" in a hotkey handler?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 2nd, 2006, 2:59 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Sorry for the late reply. Here's a trick that seems to do what you wanted:

~LWin::return
~LWin up::return
~RWin::return
~RWin up::return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Google Feedfetcher, Yahoo [Bot] and 20 guests


You can post new topics in this forum
You can 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:
Powered by phpBB® Forum Software © phpBB Group