Home Forums Macros Double click and sustain macro function Reply To: Double click and sustain macro function

#5093
Philippe OllivierPhilippe
Keymaster

Hi Daniel,
This is a long standing feature request, and I am also very interested by the possibility to use simple click, double click and long push in the macros.
We will have a look to thins and if that’s no to complicated, we will imagine to implement this in Logelloop 5.5

In the meantime, you may use this macro to detect a double click in a macro using the expression monotonic_ms()
Ok, that’s not very handy as it is very necessary to achieve this detection outside of the macro…

Philippe

//*************************** Macro Begin ***************************
// This macro will report the elapsed time between
// two user actions

// At the first User action, we initiate the $begin$ variable
// and we set the time duration to 0
Declare int $begin$ = {monotonic_ms()}
Declare int $time_duration_ms$ = 0

//We wait for a second user action
WaitUserAction

// Then we calculate the elapsed time between the first and the second user action
$time_duration_ms$ = {monotonic_ms() – $begin$}

// We send it as a message to the Logelloop user interface.
Message $time_duration_ms$

If {$time_duration_ms$ < 250} MessageMain "Double click" //MacroStartIfNeededByName "Perpetual Hamster" //MacroStopByName "Perpetual SFX OstinatO" // Here you can do something for the double click Else MessageMain "Simple click" //MacroStartIfNeededByName "Perpetual SFX OstinatO" //MacroStopByName "Perpetual Hamster" // Here you can do something for the simple click EndIf //*************************** Macro End ***************************