P.I. Engineering User Forum

Product Support, Technical Questions and Answers, and Examples for P.I. Engineering Products

You are not logged in.

#1 2017-11-30 05:30:20

JH
Member
Registered: 2017-11-30
Posts: 1

save + restore mouse position

Hello support team,

is it possible to save the mouse position (at start of a macro) and jump back to this Position (at end of macro) ?

If it is not possible yet - is there a Workaround or do you plan to implement this funktion in future.

Kind regards - JH

Offline

#2 2017-11-30 09:29:21

PIE Liam
Technical Support Specialist
From: Williamston, MI
Registered: 2016-01-21
Posts: 48
Website

Re: save + restore mouse position

Sure, if you added a mouse absolute function to your macro it would move the cursor wherever you programmed it too, you could add one of these before and after the main body of your macro. TO add this function go to the "Functions" tab in the main window of Macroworks 3.1 and select "Show Functions" then expand the Mouse>Movement sub-menu and double click to add.

Offline

#3 2017-12-13 21:52:08

maik
Member
Registered: 2017-11-16
Posts: 4

Re: save + restore mouse position

I would like to be able to have the mouse position to return to the position that the mouse cursor started from before the macro which could be at a different point every time. So the Macro would have to remember the starting position of the cursor. If you look at this video at 00.09.40 they show some cool stuff. https://mixinglight.com/color-tutorial/ … companion/

Maik

Offline

#4 2017-12-14 10:00:45

PIE Liam
Technical Support Specialist
From: Williamston, MI
Registered: 2016-01-21
Posts: 48
Website

Re: save + restore mouse position

maik are you using ControllerMate or our software MW3.1 to program the unit? If you're using Contorllermate (like the video you've linked to) they may have an answer for you on their forums. If you are using MW3.1 , are you using it in SW mode or HW mode? If you are suing SW mode then you could use the mouse movement functions to place the cursor wherever you'd like to, you can use multiple mouse movement functions on a single macro, you can find these functions in the Functions Tab>Show Functions>Expand the mouse movement sub-menu.

Offline

#5 2017-12-14 14:51:57

maik
Member
Registered: 2017-11-16
Posts: 4

Re: save + restore mouse position

I'm using MW3.1 in software mode. No, I need the "Marco to capture the point of the mouse cursor at the time of pushing the button because to apply a filter or transition onto a video clip or video cut can be at many specific different location each and every time. Does that make sense?

Maik

Offline

#6 2017-12-15 09:39:11

PIE Liam
Technical Support Specialist
From: Williamston, MI
Registered: 2016-01-21
Posts: 48
Website

Re: save + restore mouse position

So you would like to MW3.1 to read the position of the cursor and act accordingly at each press, a position that changes? This is not doable in MW3.1, sounds as though you may need to write some code, an application that can handle that level of logic. If you are a software developer  we do provide software development kits at this link http://xkeys.com/PISupport/Developer.php

Offline

#7 Yesterday 09:50:12

maik
Member
Registered: 2017-11-16
Posts: 4

Re: save + restore mouse position

Using autohotkey a free windows program https://autohotkey.com/  and this script you can apply any preset to your clip that your mouse cursor is on without having to select the clip or highlighting it in Adobe Premiere Pro.

*
;;;;;;;;;;FUNCTION FOR DIRECTLY APPLYING A PRESET EFFECT TO A CLIP!;;;;;;;;;;;;
; preset() is my most used, and most useful AHK function! There is no good reason why Premiere doesn't have this functionality.
;keep in mind, I use 150% UI scaling, so your pixel distances for commands like mousemove WILL be different!
;to use this script yourself, carefully go through  testing the script and changing the values, ensuring that the script works, one line at a time. use message boxes to check on variables and see where the cursor is. remove those message boxes later when you have it all working!
#IfWinActive ahk_exe Adobe Premiere Pro.exe
;Setting the coordinate mode is really important. This ensures that pixel distances are consistant for everything, everywhere.
coordmode, pixel, Window
coordmode, mouse, Window
coordmode, Caret, Window
;This (temporarily) blocks the mouse and keyboard from sending any information, which could interfere with the funcitoning of the script.
BlockInput, SendAndMouse
BlockInput, MouseMove
BlockInput, On
SetKeyDelay, 0 ;this ensures that any text AutoHotKey "types in," will input instantly, rather than one letter at a time.
MouseGetPos, xposP, yposP ;---stores the cursor's current coordinates at X%xposP% Y%yposP%
Send +7 ;CTRL SHIFT 7 --- you must set this in premiere's keyboard shortcuts menu to "effects" panel
sleep 15 ;"sleep 15" means the script will wait for 15 milliseconds before the next command. This is done to give Premiere some time to load its own things.
Send ^+F ;CTRL shift F -- set in premiere to "select find box"
sleep 15 ;"sleep 15" means the script will wait for 15 milliseconds before the next command. This is done to give Premiere some time to load its own things.
Send ^b ;CTRL b -- set in premiere to "select find box"
sleep 15
;Any text in the Effects panel's find box has now been highlighted. There is also a blinking "text insertion point" at the end of that text. This is the vertical blinking line, or "caret."
MouseMove, %A_CaretX%, %A_CaretY%, 0
sleep 15
MouseMove, %A_CaretX%, %A_CaretY%, 0
;and fortunately, AHK knows the exact X and Y position of this caret. So therefore, we can find the effects panel find box, no matter what monitor it is on, with 100% consistency.
sleep 15
MouseGetPos, , , Window, classNN
WinGetClass, class, ahk_id %Window%
;msgbox, ahk_class =   %class% `nClassNN =     %classNN% `nTitle= %Window%
;;;I think ControlGetPos is not affected by coordmode??  Or at least, it gave me the wrong coordinates if premiere is not fullscreened... https://autohotkey.com/docs/commands/ControlGetPos.htm
ControlGetPos, XX, YY, Width, Height, %classNN%, ahk_class %class%, SubWindow, SubWindow ;-I tried to exclude subwindows but I don't think it works...?
;;my results:  59, 1229, 252, 21,      Edit1,    ahk_class Premiere Pro
;now we have found a lot of useful informaiton about this find box. Turns out, we don't need most of it...
;we just need the X and Y coordinates of the "upper left" corner...
;comment in the following line to get a message box of your current variable values. The script will not advance until you dismiss the message box.
;MsgBox, xx=%XX% yy=%YY%
MouseMove, XX-25, YY+10, 0 ;-----------------------moves cursor onto the magnifying glass
;msgbox, should be in the center of the magnifying glass now.
sleep 5

Send MySFXPreset   ;This types in the text you wanted to search for. Like "MySFXPreset" We can do this because the entire find box text was already selected by Premiere. Otherwise, we could click the magnifying glass if we wanted to , in order to select that find box.

sleep 30
MouseMove, 62, 35, 0, R ;----------------------relative to the position of the magnifying glass (established earlier,) this moves the cursor down and directly onto the preset's icon. In my case, it is inside the "presets" folder, then inside of another folder, and the written name sohuld be compeltely unique so that it is the first and only item.
;msgbox, The cursor should be directly on top of the preset's icon. `n If not, the script needs modification.
MouseGetPos, iconX, iconY, Window, classNN ;---now we have to figure out the ahk_class of the current panel we are on. It used to be DroverLord - Window Class14, but the number changes anytime you move panels around... so i must always obtain the information anew.
WinGetClass, class, ahk_id %Window% ;----------"ahk_id %Window%" is important for SOME REASON. if you delete it, this doesnt work.
;msgbox, ahk_class =   %class% `nClassNN =     %classNN% `nTitle= %Window%
ControlGetPos, xxx, yyy, www, hhh, %classNN%, ahk_class %class%, SubWindow, SubWindow ;-I tried to exclude subwindows but I don't think it works...?
MouseMove, www/4, hhh/2, 0, R ;-----------------clicks in about the CENTER of the Effects panel. This clears the displayed presets from any duplication errors. VERY important. without this, the script fails 20% of the time.
MouseClick, left, , , 1 ;-----------------------the actual click
sleep 10
MouseMove, iconX, iconY, 0 ;--------------------moves cursor BACK onto the effect's icon
sleep 35
MouseClickDrag, Left, , , %xposP%, %yposP%, 0 ;---drags this effect to the cursor's pervious coordinates, which should be above a clip.
sleep 10
MouseClick, middle, , , 1 ;this returns focus to the panel the cursor is hovering above, WITHOUT selecting anything. great!
Send +7 ;CTRL SHIFT 7 --- you must set this in premiere's keyboard shortcuts menu to "effects" panel
sleep 15 ;"sleep 15" means the script will wait for 15 milliseconds before the next command. This is done to give Premiere some time to load its own things.
Send ^+F ;CTRL shift F -- set in premiere to "select find box"
sleep 15 ;"sleep 15" means the script will wait for 15 milliseconds before the next command. This is done to give Premiere some time to load its own things.
Send ^b ;CTRL b -- set in premiere to "select find box"
sleep 15
Send +{backspace} ;shift backspace deletes any text that may be present.
Sleep, 10
MouseMove,  %xposP%, %yposP%, 0 ;---cursor's pervious coordinates, which should be above a clip.
sleep 10
MouseClick, middle, , , 1 ;this returns focus to the panel the cursor is hovering above, WITHOUT selecting anything. great!
blockinput, MouseMoveOff ;returning mouse movement ability
BlockInput, off ;do not comment out or delete this line -- or you won't regain control of the keyboard!! However, CTRL+ALT+DEL will still work if you get stuck!! Cool.

theEnding:
;END of preset()

*

Offline

#8 Yesterday 09:59:01

maik
Member
Registered: 2017-11-16
Posts: 4

Re: save + restore mouse position

Some info on Autohotkey.

https://youtu.be/dAiBHjCS9Qk

Offline

Board footer

Powered by FluxBB