KeyDown Not Working?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

KeyDown Not Working?

Post by RNIB » Wed Sep 28, 2016 2:00 pm

I'm trying to write a macro as a workaround. I've just bought A ShuttlePro which is a USB jogwheel with assignable hotkeys. One of the programs I use is an audio editor called SADiE where I can scrub through the audio hearing it slower than real time by clicking and dragging with the mouse on the onscreen jog wheel.

What I'm trying to see is if I can assign a hot key to the jog wheel which when I move it triggers a macro to run which then moves the mouse to the correct part of the screen and left clicks and drags. So what I need, I think, is for the macro to always be running but waiting for the relevant key press, in this case Ctrl+Alt+R

Code: Select all

OnEvent>KeyDown,R,5,JogBack
SRT>JogBack
Release Ctrl
Release Alt
SetFocus>SADiE6 Radio Producer - Shuttle Pro Test.edl
MouseMove>1094,747
LDown
MouseMove>1094,780
LUp
End>JogBack
This is my code so far, but when I press Ctrl+Alt+R nothing happens at all. What am I doing wrong?

Unfortunately whilst you can also create macros in ShuttlePro itself there isn't the option of getting it to run a .exe file.

hagchr
Automation Wizard
Posts: 327
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Re: KeyDown Not Working?

Post by hagchr » Wed Sep 28, 2016 8:31 pm

Hi, I think it needs to be KEY_DOWN instead of KeyDown.

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: KeyDown Not Working?

Post by Marcus Tettmar » Thu Sep 29, 2016 7:37 am

Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: KeyDown Not Working?

Post by RNIB » Thu Sep 29, 2016 2:17 pm

Oh boy do I feel stupid! :oops: :oops:

Sorry.

I've got it working now so that the audio scrubs in reverse and forward depending on which way the jog wheel is moved.

Code: Select all

OnEvent>Key_Down,R,5,JogBack
OnEvent>Key_Down,F,5,JogForward
OnEvent>Key_Down,X,5,Stop
Label>mainloop
  Wait>0.02
Goto>mainloop
SRT>JogBack
Release Ctrl
Release Alt
SetFocus>SADiE6 Radio Producer - Shuttle Pro Test.edl
Wait>0.2
MouseMove>1094,747
LDown
MouseMove>1094,800
End>JogBack
SRT>JogForward
Release Ctrl
Release Alt
SetFocus>SADiE6 Radio Producer - Shuttle Pro Test.edl
Wait>0.2
MouseMove>1094,747
LDown
MouseMove>1094,700
End>JogForward
Srt>Stop
LUP
End>Stop


So at the moment if I move the jog wheel back it sends Ctrl+Alt+R which triggers this macro and the audio starts to scrub backwards. If I then move the jog wheel forward it sends Ctrl+Alt+F which triggers this macro and the audio starts to scrub forwards.

What I would like to do is add the function of stopping the audio if I move the jog wheel in the opposite direction. In other words if I were to move the jog wheel backwards I hear the audio going backwards but if I then move the jog wheel forward it stops the audio. If I move the jogwheel forward again, then the audio should start moving forward and vice versa.

I've tried various things but it never seems to respond to the 2nd movement in any direction but the jog wheel is supposed to resend the hot key every time it's moved as it is notched.

RNIB
Macro Veteran
Posts: 159
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Re: KeyDown Not Working?

Post by RNIB » Thu Sep 29, 2016 3:46 pm

Hmm, well got it a bit closer with this:

Code: Select all

OnEvent>Key_Down,F,5,JogForward
OnEvent>Key_Down,X,5,Stop
Label>mainloop
  Wait>0.02
Goto>mainloop
Srt>JogBack
Release Ctrl
Release Alt
SetFocus>SADiE6 Radio Producer - Shuttle Pro Test.edl
Wait>0.2
MouseMove>1094,747
LDown
MouseMove>1094,800
OnEvent>Key_Down,F,5,BackForward
End>JogBack
SRT>JogForward
Release Ctrl
Release Alt
SetFocus>SADiE6 Radio Producer - Shuttle Pro Test.edl
Wait>0.2
MouseMove>1094,747
LDown
MouseMove>1094,700
OnEvent>Key_Down,R,5,ForwardBack
End>JogForward
Srt>Stop
LUP
End>Stop
Srt>BackForward
LUP
LDOWN
GoSub>JogForward
End>BackForward
Srt>ForwardBack
LUP
LDOWN
GoSub>JogBack
End>BackForward
Now, if I've started it scrubbing in one direction it will stop if I then move it in the other. But it won't restart moving in either direction as the macro then terminates.

For reference the LUP is the command that actually stops the audio as unless the left mouse button is held down the audio won't be scrubbed.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts