 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ranomore
Joined: 06 Nov 2004 Posts: 178 Location: Salt Lake City, UT
|
Posted: Mon Dec 19, 2005 8:51 pm Post subject: CTRL+ALT+ MouseWheel up/Down |
|
|
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! |
|
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4016 Location: Pittsburgh
|
Posted: Mon Dec 19, 2005 9:36 pm Post subject: |
|
|
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). |
|
| Back to top |
|
 |
ranomore
Joined: 06 Nov 2004 Posts: 178 Location: Salt Lake City, UT
|
Posted: Mon Dec 19, 2005 10:52 pm Post subject: |
|
|
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 |
|
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Tue Dec 20, 2005 3:38 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Guest
|
|
| Back to top |
|
 |
ranomore
Joined: 06 Nov 2004 Posts: 178 Location: Salt Lake City, UT
|
Posted: Tue Dec 20, 2005 5:35 pm Post subject: |
|
|
@Chris - Thanks! I hadn't tried holding down the keys in the opposite order.  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|