mousewheel = ctrl + mousewheel

Get help with using AutoHotkey and its commands and hotkeys
bendy303
Posts: 12
Joined: 05 Dec 2014, 00:33
Facebook: Benedict Harris
Google: Benedict Harris

mousewheel = ctrl + mousewheel

05 Dec 2014, 00:48

excuse the repost, I didnt realise I was not logged in before...


Hi,

just wanted to enable mousewheel zoom in Cubase without having to press ctrl manually. (zoom in Cubase is ctrl + mousewheel)

I came up with some code that only half works: it sends a ctrl key press every time the mouse wheel moves...instead of just a single ctrl key HELD DOWN as long as the mouse wheel moves...


any advice?

Code: Select all


#IfWinActive ahk_class SteinbergWindowClass
$WheelUp::
Send ^+{WheelUp}
;MsgBox, 4, , Do you want to continue? (Press YES or NO)
Return

$WheelDown::
Send ^+{WheelDown}
;MsgBox, 4, , Do you want to continue? (Press YES or NO)
Return
#IfWinActive
 
User avatar
joedf
Posts: 7898
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: mousewheel = ctrl + mousewheel

05 Dec 2014, 02:12

- removed double post -

Anyway, remove the "+" symbols. They represent the shift key ..
User avatar
Nextron
Posts: 1379
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: mousewheel = ctrl + mousewheel

05 Dec 2014, 05:48

The scroll wheel is different from other buttons, in the way that it does not produce an up-event, but only down-events (not talking about the rotational direction). Since you can't rely on the up-event to release the control key, you can use a timer.

Code: Select all

#IfWinActive ahk_class SteinbergWindowClass
$WheelUp::
	Send {Control down}
$^WheelUp::
	Send {WheelUp}
	;MsgBox, 4, , Do you want to continue? (Press YES or NO)
	SetTimer,ControlUp,-300
Return

$WheelDown::
	Send {Control down}
$^WheelDown::
	Send {WheelDown}
	;MsgBox, 4, , Do you want to continue? (Press YES or NO)
	SetTimer,ControlUp,-300
Return

ControlUp:
	Send {Control up}
Return
#IfWinActive
This way the control key will only be released when you stop scrolling for 300ms as the timers resets on every wheel event (or whatever time you choose).
bendy303
Posts: 12
Joined: 05 Dec 2014, 00:33
Facebook: Benedict Harris
Google: Benedict Harris

Re: mousewheel = ctrl + mousewheel

05 Dec 2014, 07:44

thanks for your reply!!

unfortunatly it is still returning a 'double tap' of the ctrl, which triggers another app....

how can I make it press and hold down ctrl ONCE only while the mouse wheel is turning?
User avatar
Nextron
Posts: 1379
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: mousewheel = ctrl + mousewheel

05 Dec 2014, 08:45

Hmm, I'm not seeing the same behavior. Could you post the last ~20 lines (between [/c]-tags) from AHK's main window of most recently executed lines and key history after you've scrolled a couple of times while running this script?
bendy303
Posts: 12
Joined: 05 Dec 2014, 00:33
Facebook: Benedict Harris
Google: Benedict Harris

Re: mousewheel = ctrl + mousewheel

05 Dec 2014, 09:30

you are right, there is not a 'double ctrl' tap - it is just because I scrolled twice quickly, thus creating a ctrl double tap.

However now there is another problem - some of the wheel seems to get through without recognising that ctrl is considered down, so now it also scrolls AS WELL as zooming, instead of just zooming.

the nature behaviour of Cubase without a script and without a modifer key - is that mouse wheel controls scrolling up and down. With ctrl + mousewheel - it zooms only. So with your script - it now zooms AND scrolls...

this is last 20 lines

002: Return (4.84)
003: Send,{Control down} (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.30)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.05)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.06)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.27)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp} (0.03)
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.30)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.06)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.08)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.25)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp} (0.03)
007: SetTimer,ControlUp,-1000
008: Return
005: Send,{WheelUp} (0.03)
007: SetTimer,ControlUp,-1000
008: Return (0.28)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.05)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.42)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.05)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.41)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.31)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.01)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.02)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (0.03)
005: Send,{WheelUp}
007: SetTimer,ControlUp,-1000
008: Return (1.01)
019: Send,{Control up} (0.01)
020: Return (2.11)
User avatar
Nextron
Posts: 1379
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: mousewheel = ctrl + mousewheel

05 Dec 2014, 10:24

Could you also post the key history after scrolling a few notches? (AHK window > view > key history and script info)
bendy303
Posts: 12
Joined: 05 Dec 2014, 00:33
Facebook: Benedict Harris
Google: Benedict Harris

Re: mousewheel = ctrl + mousewheel

05 Dec 2014, 10:47

Window: E:\Documents\```Software files\Autohotkey\mousezoomCUBASEPRO8__forum.ahk - AutoHotkey v1.0.48.05
Keybd hook: no
Mouse hook: yes
Enabled Timers: 0 of 1 ()
Interrupted threads: 0
Paused threads: 0 of 0 (0 layers)
Modifiers (GetKeyState() now) =
Modifiers (Hook's Logical) = LCtrl
Modifiers (Hook's Physical) =
Prefix key is down: no

NOTE: Only the script's own keyboard events are shown
(not the user's), because the keyboard hook isn't installed.

NOTE: To disable the key history shown below, add the line "#KeyHistory 0" anywhere in the script. The same method can be used to change the size of the history buffer. For example: #KeyHistory 100 (Default is 40, Max is 500)

The oldest are listed first. VK=Virtual Key, SC=Scan Code, Elapsed=Seconds since the previous event. Types: h=Hook Hotkey, s=Suppressed (blocked), i=Ignored because it was generated by an AHK script, a=Artificial, #=Disabled via #IfWinActive/Exist.

VK SC Type Up/Dn Elapsed Key Window
-------------------------------------------------------------------------------------------------------------
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.47 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.06 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
11 01D i u 1.01 STRG
01 000 d 0.28 LButton
01 000 u 0.08 LButton
01 000 d 0.11 LButton
01 000 u 0.11 LButton E:\Documents\```Software files\Autohotkey\mousezoomCUBASEPRO8__forum.ahk - AutoHotkey v1.0.48.05
01 000 d 3.85 LButton
01 000 u 0.09 LButton N/A
01 000 d 9.95 LButton mousewheel = ctrl + mousewheel - View topic • AHKScript - Google Chrome
01 000 u 0.05 LButton N/A
01 000 d 1.67 LButton E:\Documents\```Software files\Autohotkey\mousezoomCUBASEPRO8__forum.ahk - AutoHotkey v1.0.48.05
01 000 u 0.11 LButton
01 000 d 1.29 LButton
01 000 u 0.09 LButton
Press [F5] to refresh.




*EDIT---I did it again, this time moving the mousewheel both up, then down



Window: E:\Documents\```Software files\Autohotkey\mousezoomCUBASEPRO8__forum.ahk - AutoHotkey v1.0.48.05
Keybd hook: no
Mouse hook: yes
Enabled Timers: 0 of 1 ()
Interrupted threads: 0
Paused threads: 0 of 0 (0 layers)
Modifiers (GetKeyState() now) =
Modifiers (Hook's Logical) = LCtrl
Modifiers (Hook's Physical) =
Prefix key is down: no

NOTE: Only the script's own keyboard events are shown
(not the user's), because the keyboard hook isn't installed.

NOTE: To disable the key history shown below, add the line "#KeyHistory 0" anywhere in the script. The same method can be used to change the size of the history buffer. For example: #KeyHistory 100 (Default is 40, Max is 500)

The oldest are listed first. VK=Virtual Key, SC=Scan Code, Elapsed=Seconds since the previous event. Types: h=Hook Hotkey, s=Suppressed (blocked), i=Ignored because it was generated by an AHK script, a=Artificial, #=Disabled via #IfWinActive/Exist.

VK SC Type Up/Dn Elapsed Key Window
-------------------------------------------------------------------------------------------------------------
A2 01D i d 0.00 STRG
9F 001 h d 0.06 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.28 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.03 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.05 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.05 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
9F 001 h d 0.11 WheelUp
A2 01D i u 0.00 STRG
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 STRG
11 01D i u 1.01 STRG
User avatar
Nextron
Posts: 1379
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: mousewheel = ctrl + mousewheel

05 Dec 2014, 17:35

Two things I notice are that there's no keyboard hook installed while it should have been. Second is that you're running an old AHK version from a couple of years ago (probably downloaded from autohotkey.com?). Perhaps #2 is to blame for #1. First try to install the most recent version and see if that solves the problem. If it doesn't, please post those two pieces of text again, but now while using the latest version.
bendy303
Posts: 12
Joined: 05 Dec 2014, 00:33
Facebook: Benedict Harris
Google: Benedict Harris

Re: mousewheel = ctrl + mousewheel

06 Dec 2014, 04:08

oh wow didnt realise autohotkey.com is out of date!

ok so upgraded, and did again


JUST MOUSEWHEEL UP (no need to show both mousewheel up and down because the problem exists just with one direction)

-------------------------------------------------

Window: E:\Documents\```Software files\Autohotkey\mousezoomCUBASEPRO8__forum.ahk - AutoHotkey v1.1.16.05
Keybd hook: no
Mouse hook: yes
Enabled Timers: 0 of 1 ()
Interrupted threads: 0
Paused threads: 0 of 0 (0 layers)
Modifiers (GetKeyState() now) =
Modifiers (Hook's Logical) = LCtrl
Modifiers (Hook's Physical) =
Prefix key is down: no

NOTE: Only the script's own keyboard events are shown
(not the user's), because the keyboard hook isn't installed.

NOTE: To disable the key history shown below, add the line "#KeyHistory 0" anywhere in the script. The same method can be used to change the size of the history buffer. For example: #KeyHistory 100 (Default is 40, Max is 500)

The oldest are listed first. VK=Virtual Key, SC=Scan Code, Elapsed=Seconds since the previous event. Types: h=Hook Hotkey, s=Suppressed (blocked), i=Ignored because it was generated by an AHK script, a=Artificial, #=Disabled via #IfWinActive/Exist, U=Unicode character (SendInput).

VK SC Type Up/Dn Elapsed Key Window
-------------------------------------------------------------------------------------------------------------
01 000 d 3.88 LButton Cubase Pro Project - Untitled1
01 000 u 0.13 LButton
01 000 d 2.70 LButton
01 000 u 0.14 LButton
01 000 d 1.08 LButton
01 000 u 0.09 LButton
01 000 d 1.84 LButton
01 000 u 1.47 LButton
01 000 d 1.25 LButton
01 000 u 0.13 LButton
01 000 d 1.22 LButton
01 000 u 0.14 LButton
9F 001 h d 1.50 WheelUp
11 01D i d 0.00 Control
9F 001 i d 0.02 WheelUp
9F 001 h d 0.03 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.05 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.05 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.33 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.01 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.03 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.03 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.28 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.03 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.03 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.05 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.26 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.00 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.01 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.03 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.33 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.01 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.00 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.09 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.28 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.00 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.02 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.01 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
9F 001 h d 0.03 WheelUp
A2 01D i u 0.00 LControl
9F 001 i d 0.00 WheelUp
A2 01D i d 0.00 LControl
11 01D i u 1.01 Control
01 000 d 5.93 LButton
01 000 u 0.09 LButton
01 000 d 0.09 LButton
01 000 u 0.11 LButton E:\Documents\```Software files\Autohotkey\mousezoomCUBASEPRO8__forum.ahk - AutoHotkey v1.1.16.05
01 000 d 2.82 LButton
01 000 u 0.09 LButton
01 000 d 0.73 LButton
01 000 u 0.08 LButton
Press [F5] to refresh.
bendy303
Posts: 12
Joined: 05 Dec 2014, 00:33
Facebook: Benedict Harris
Google: Benedict Harris

Re: mousewheel = ctrl + mousewheel

06 Dec 2014, 04:15

I think I got it!!

I noticed it says "Keybd hook: no" so I googled and figured out I should add #InstallKeybdHook


is that it?

seems to be working

thanks a million for your help!
bendy303
Posts: 12
Joined: 05 Dec 2014, 00:33
Facebook: Benedict Harris
Google: Benedict Harris

Re: mousewheel = ctrl + mousewheel

06 Dec 2014, 04:45

ahhhh one more thing:

now I have that part working - I wanted it swapped with the original function. How can I get the ctrl + mousewheel (human input) to now control the vertical scroll?


so essientally I thought I could use the same code and add it with the functions swapped...but I get a 'duplicate hotkey' error


this is what i did:

Code: Select all

#InstallKeybdHook
#IfWinActive ahk_class SteinbergWindowClass

$WheelUp::
    Send {Control down}
$^WheelUp::
    Send {WheelUp}
    SetTimer,ControlUp,-300
Return

$WheelDown::
    Send {Control down}
$^WheelDown::
    Send {WheelDown}
    SetTimer,ControlUp,-300
Return

ControlUp:
    Send {Control up}
Return

;;;; and the opposite to swap functions:


$^WheelUp::
    Send {WheelUp}
Return

$^WheelDown::
    Send {WheelDown}
Return


#IfWinActive
bendy303
Posts: 12
Joined: 05 Dec 2014, 00:33
Facebook: Benedict Harris
Google: Benedict Harris

Re: mousewheel = ctrl + mousewheel

06 Dec 2014, 04:57

and if it is not too much to ask:

is there a way to recognise the window simply UNDER the mouse cursor instead of just window in focus? (ie #IfWinActive)

then I can zoom even when the Cubase window is not in focus
User avatar
Nextron
Posts: 1379
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: mousewheel = ctrl + mousewheel

06 Dec 2014, 14:40

bendy303 wrote:is there a way to recognise the window simply UNDER the mouse cursor instead of just window in focus? (ie #IfWinActive)

then I can zoom even when the Cubase window is not in focus
This requires a totally different approach. So I've hidden the comment on your other questions, because it probably isn't relevant once you use this script:

Code: Select all

#If MouseIsOver("ahk_class SteinbergWindowClass")
WheelUp::
WheelDown::
^WheelUp::
^WheelDown::
	CoordMode, Mouse, Screen
	MouseGetPos, m_x, m_y
	PostMessage, 0x20A, % (InStr(A_Thishotkey, "Up") ? 1 : -1) * 120 << 16 | (InStr(A_Thishotkey, "^") ? 0 : 0x0008), ( m_y << 16 )|(m_x & 0xFFFF),, % "ahk_id " DllCall("WindowFromPoint", "int64", (m_y<<32) | (m_x&0xFFFFFFFF))
Return

MouseIsOver(WinTitle) {
	ListLines,Off
	MouseGetPos,,,Win
	SetTitleMatchMode,2
	Return WinExist(WinTitle " ahk_id " Win)
}
#If
Spoiler
bendy303
Posts: 12
Joined: 05 Dec 2014, 00:33
Facebook: Benedict Harris
Google: Benedict Harris

Re: mousewheel = ctrl + mousewheel

10 Dec 2014, 09:10

awesome! excuse my late reply, the email indicating you replied got lost in my hundreds of emails...

so checked manually, and saw that you did!


ok gunna check this out now

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], gvieira, kyuuuri, paul1965 and 33 guests