 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
dmsuperman Guest
|
Posted: Mon Jan 14, 2008 11:05 pm Post subject: AltTab with the wheel |
|
|
I've got this:
| Code: | !WheelDown::
SendInput, {ALT down}{TAB}
return
!WheelUp::
SendInput, {ALT down}+{TAB}
return |
It works almost as it should, only it keeps the ALT down once I activate it. I want it so I hold alt and scroll to scroll through the alt tab windows like alttab and altshifttab, then when I release the alt key it will release it and switch to the window I've scrolled to. |
|
| Back to top |
|
 |
Conquer
Joined: 27 Jun 2006 Posts: 385 Location: Canada
|
Posted: Tue Jan 15, 2008 1:17 am Post subject: |
|
|
| Code: | MButton::AltTabMenu
WheelDown::AltTab
WheelUp::ShiftAltTab |
From AHK's help file.
Just a note that you have to click the middle mouse button to display the menu first. Otherwise, the wheel up and down actions wouldn't work normally. _________________
 |
|
| Back to top |
|
 |
dmsuperman Guest
|
Posted: Tue Jan 15, 2008 4:30 am Post subject: |
|
|
Yes, I saw that, but that's not the funtionality I'm looking for. I want it a similar effect to this program: http://www.nirsoft.net/utils/volumouse.html
I hold control and scroll down and it lowers the volume, then release control and it closes the window. I want to hold alt, scroll the mouse to scroll between apps and alt to actually switch to that app. Basically if I could figure out how to set a hotkey to {ALT down} I could figure it out, but {ALT down}:: and HotKey, {ALT down} both throw errors when I run the script. |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2739 Location: Australia, Qld
|
Posted: Tue Jan 15, 2008 6:32 am Post subject: |
|
|
| Code: | !WheelDown::Send {Blind}{Tab}
!WheelUp::Send {Blind}+{Tab}
| That's probably the fifth time I've written an Alt+Wheel = Alt+Tab script. For some reason this is the first time {Blind} occurred to me.
Btw, a key down hotkey is just:
The standard modifier keys have special treatment, so you must use the left or right version:
(~ to not block it.) |
|
| Back to top |
|
 |
dmsuperman Guest
|
Posted: Tue Jan 15, 2008 12:44 pm Post subject: |
|
|
| For somereason when I try to use this script it opens anywhere from 20-50 notepad windows. Any clue why? |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2739 Location: Australia, Qld
|
Posted: Tue Jan 15, 2008 1:13 pm Post subject: |
|
|
Your computer is possessed by the devil.
Which script? |
|
| Back to top |
|
 |
dmsuperman Guest
|
Posted: Tue Jan 15, 2008 5:18 pm Post subject: |
|
|
| Code: | #SingleInstance force
;WinKey + Esc to lock computer
#escape::GoSub, LockPC
MonitorOff:
Run D:\Tools\nircmd\nircmd.exe screensaver
Run D:\Tools\nircmd\nircmd.exe monitor off
return
LockPC:
Run rundll32 user32.dll LockWorkStation
SetTimer, MonitorOff, -2000
return
;WinKey + Ctrl + Esc to lock computer and mute
^#escape::GoSub, LockPCMute
LockPCMute:
SendInput ^#!p
GoSub, LockPC
Run D:\Tools\nircmd\nircmd.exe mutesysvolume 1
Run D:\Tools\nircmd\nircmd.exe beep 300 100
return
;Enable shade
#Tab::Run D:\AutoHotKey\blocker.ahk
;Ctrl + WinKey + e to edit this script
^#e::Edit
;WinKey + c to bring up command prompt
#c::Run cmd.exe, C:\
;Ctrl + WinKey + C to bring up run-like prompt to run in cmd window
^#C::
InputBox, cmd, Run, Enter command to run,,300,90
Run cmd.exe /k %cmd%, C:\
return
~!Printscreen::
~Printscreen::
ClipWait, 1
Run mspaint.exe
Sleep, 1000
SendInput, ^e
SendInput, 1{TAB}1{ENTER}
SendInput, ^v
SendInput, ^s
return
!^Printscreen::
SendInput, !{PRINTSCREEN}
return
^Printscreen::
SendInput, {PRINTSCREEN}
return
!WheelDown::Send {Blind}{Tab}
!WheelUp::Send {Blind}+{Tab}
~LAlt::
~RAlt::
;WinKey + N for notepad
#n::Run notepad.exe
;Ctrl + WinKey + f to run the systray tooltip fixer
^#f::Run D:\Tools\ToolTip Fix\Tooltips Fix.exe
^#r::Reload
;Replace strings
:*:;ip;::
UrlDownloadToFile, http://whatismyip.org/, D:\AutoHotKey\myip.txt
FileRead, ip, D:\AutoHotKey\myip.txt
SendInput %ip%
return
:*:;l;::http://localhost/
:*:;host;::
UrlDownloadToFile, http://whatismyip.org/, D:\AutoHotKey\myip.txt
FileRead, ip, D:\AutoHotKey\myip.txt
SendInput http://%ip%/
return
:*:btw::by the way
:*:imo::in my opinion
^Left::GoSub, MoveWindowToNextScreen
^Right::GoSub, MoveWindowToNextScreen
MoveWindowToNextScreen:
SysGet, Mon, Monitor, 1
WinGetActiveTitle, ActTitle
WinGetPos, X, Y,,,%ActTitle%,,,
;Determine which monitor it's on to see which one to move it to
if(X < (MonRight - 4))
GoSub, MoveWindowToRightScreen
else
GoSub, MoveWindowToLeftScreen
return
MoveWindowToLeftScreen:
WinGetActiveTitle, ActTitle
WinGetPos, X, Y,,,%ActTitle%,,,
if(X >= (MonRight - 4)){
WinGet, state, MinMax, %ActTitle%
if(state = 1){
WinRestore, %ActTitle%
}
newx := X - 1152
WinMove,%ActTitle%,,%newx%,Y
if(state = 1){
WinMaximize, %ActTitle%
}
}
return
MoveWindowToRightScreen:
WinGetActiveTitle, ActTitle
WinGetPos, X, Y,,,%ActTitle%,,,
if(X < (MonRight - 4)){
WinGet, state, MinMax, %ActTitle%
if(state = 1){
WinRestore, %ActTitle%
}
newx := X + 1152
WinMove,%ActTitle%,,%newx%,Y
if(state = 1){
WinMaximize, %ActTitle%
}
}
return |
That's the whole script, but the only thing that opens notepad is winkey + n and I don't see how that could be activated. |
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1259 Location: Denmark
|
Posted: Tue Jan 15, 2008 5:31 pm Post subject: |
|
|
| Quote: | | 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: |
This will make #n as well as lalt and ralt start notepad
| Code: | ...
~LAlt::
~RAlt::
;WinKey + N for notepad
#n::Run notepad.exe
... |
_________________ there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face
- Kashmir |
|
| Back to top |
|
 |
dmsuperman Guest
|
Posted: Tue Jan 15, 2008 5:58 pm Post subject: |
|
|
| Ah, many thanks for your help. Unfortunately, it still does the action of keeping the AltTab menu open after releasing alt. If I add ~Alt::return to it then it doesn't keep the alt tab menu open, it just switches to the next window and closes the alt tab menu. Thanks again for your help, hopefully we can figure this out. |
|
| Back to top |
|
 |
dmsuperman
Joined: 15 Jan 2008 Posts: 5
|
Posted: Tue Jan 15, 2008 6:04 pm Post subject: |
|
|
I've registered, so this is me now.
Basically the effect now is that I hold alt, scroll up or down to scroll to the proper window to switch to, release alt, and it opens that window. Then, it keeps the alttab menu open, until I reload the script. I haven't got a clue why it does this, however.
EDIT:
I've found that if I start with scrolling up instead of scrolling down, then it will do the above effect of not even showing the window. If I scroll down, it'll keep the window open, if I scroll down then up then it'll keep the window open, but if I only scroll up it just switches between windows without opening the menu. |
|
| Back to top |
|
 |
dmsuperman
Joined: 15 Jan 2008 Posts: 5
|
Posted: Tue Jan 15, 2008 6:28 pm Post subject: |
|
|
Sorry for triple posting, but I've found this script:
| Code: | ~Rbutton & WheelUp::ShiftAltTab
~Rbutton & WheelDown::AltTab
RButton::MouseClick, right,,,,, D
RButton up::MouseClick, right,,,,, U |
It seems to mostly do what I want, and since I'm guessing our problems are stemming from using the Alt button as the prefix key when it's also needed for the sending key, this is a better solution. If you want to see what I was talking about, try it out. Hold the right button and scroll. I wanted that, only with alt instead of rbutton but this is fine.
FINAL EDIT: as I was posting I realized perhaps this is the way. It is! If I replace Rbutton with Alt it works exactly as I wanted it to in the first place. Thank you all for all your help  |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 2739 Location: Australia, Qld
|
Posted: Tue Jan 15, 2008 9:54 pm Post subject: |
|
|
FYI, this was not intended to be part of the solution:
I was just demonstrating how you could detect these key-presses, for future reference. |
|
| 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
|