AutoHotkey Community

It is currently May 27th, 2012, 5:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: December 19th, 2005, 8:51 pm 
Offline

Joined: November 6th, 2004, 11:03 am
Posts: 170
Location: Salt Lake City, UT
Why doesn't this work?

Code:
~WHEELUP::
If (GetKeyState("Control") AND GetKeyState("Alt"))
   msgbox,16,,Up
return

~WHEELDOWN::
If (GetKeyState("Control") AND GetKeyState("Alt"))
   msgbox,16,,Down
return


I also tried this:
Code:
~WHEELUP::
   GetKeyState, AltKey, Alt
   GetKeyState, CtrlKey, Ctrl
If (CtrlKey = "D" and AltKey = "D")
   msgbox,UP
return


The following works, but I'd like to be able to hold down the CTRL+ALT keys and roll the mouse, instead of repeatedly hitting those keys.
Code:
^!WHEELUP::Msgbox,Up
^!WHEELDOWN::Msgbox,Down!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2005, 9:36 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
If looks like Windows defines Ctrl-Wheel Up/Down (regardless of the state of Alt) for something (in IE6 View/TextSize increase or decrease, in Word zoom + or -10%), which takes precedence over your WHEELUP/DOWN hotkeys. I found, however no problems with
Code:
~^!WHEELUP::
   TrayTip,,Up
return

~^!WHEELDOWN::
   TrayTip,,Down
Return
I don't need to press Ctrl or Alt repeatedly (XP SP2).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2005, 10:52 pm 
Offline

Joined: November 6th, 2004, 11:03 am
Posts: 170
Location: Salt Lake City, UT
Try this one. It should show you that you do have to press CTRL+ALT repeatedly. I'm also on XP SP2.

Code:
~^!WHEELUP::
i++
   TrayTip,,%i%
return

~^!WHEELDOWN::
i--
   TrayTip,,%i%
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2005, 3:38 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Short answer: One work-around I've found is to add the line #InstallKeybdHook to the script.

More detail: Without #InstallKeybdHook, your example appears to be sensitive to which modifier you press down first: Ctrl or Alt. If you press Alt down first, it works. But in the opposite order it doesn't.

I think this probably has something to do with the unusual way the OS treats the Alt key (in conjuction with alt-tabbing, menu bar activation, and other low-level features). I've also observed interactions between Ctrl and Alt, such as the fact that Ctrl seems to suppress Alt's native function of activating the menu bar.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2005, 7:15 am 
http://www.microsoft.com/windowsxp/down ... rtoys.mspx

download and install the alt-tab replacement. I don't know if you can use the scroll wheel but you can use the arrows and you can click on the icons, very handy.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 20th, 2005, 5:35 pm 
Offline

Joined: November 6th, 2004, 11:03 am
Posts: 170
Location: Salt Lake City, UT
@Chris - Thanks! I hadn't tried holding down the keys in the opposite order. :)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], XstatyK, Yahoo [Bot] and 73 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