Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: 3 command for 1 button

This topic is old and might contain outdated or incorrect information.

using xp-1, trying to make the "beat sync" button to do:
doubleclick = pitch zero
holding = timecodereset
one click = match_bpm

doubleclick ? pitch_zero : holding 200ms ? timecode_reset_pitch : match_bpm

all work, just the timecode_reset_pitch not doing when holding. any idea whats wrong?
 

Posted Thu 30 Apr 20 @ 12:04 am
NicotuxHome userMember since 2014
because you can't hold and double click test at the same time

try a rsi instead (by the way it will work with touchscreens as well)
(reinventing the wheel) side effect: click and hold delayed the holding time, double click is instant

repeat_start rpt ? up ? var hh 0 ? set hh 1 : repeat_stop rpt & pitch_zero : nothing : set hh 0 & repeat_start rpt 200ms 1 & var hh 0 ? timecodereset : set match_bpm

more generaly: click or double click or hold
repeat_start rpt ? up ? var hh 0 ? set hh 1 : repeat_stop rpt & <ACTIONDBLCLICK> : nothing : set hh 0 & repeat_start rpt 200ms 1 & var hh 0 ? <ACTIONHOLD> : <ACTIONSINGLECLICK>
 

Posted Thu 30 Apr 20 @ 9:25 am
wow look so hard. where can i learn better scripting at this level?
 

Posted Thu 30 Apr 20 @ 5:38 pm
locoDogPRO InfinityModeratorMember since 2013
 

Posted Thu 30 Apr 20 @ 5:42 pm
i start there. all i know is from there but it kind of hard to understand at this level from text. might thinking about sell a video lessons
 

Posted Fri 01 May 20 @ 12:54 am
maybe you can explain that command to understand it alone?
repeat_start rpt ? up ? var hh 0 ? set hh 1 : repeat_stop rpt & <ACTIONDBLCLICK> : nothing : set hh 0 & repeat_start rpt 200ms 1 & var hh 0 ? <ACTIONHOLD> : <ACTIONSINGLECLICK>
 

Posted Fri 01 May 20 @ 1:01 am
and double click need to be super fast to work, can i change the delay time between clicks?
 

Posted Fri 01 May 20 @ 1:07 am
NicotuxHome userMember since 2014
You can change delay as to follow your need

for details .. lisibility will depends on render engine of the site

repeat_start rpt ? ................... is the loop rpt in use ? (holding time or double click delay)
... first action is yes
___ up ? .................................... is the key released ?
... first action is yes (key was released)
______ var hh 0 ? ..................... is this the first time the key is released ?
.... first action is yes (first click)
_________set hh 1 .................... set flag 'the key was released once"
.... second action is no (not first click)
______ : repeat_stop rpt ......... double click detected, kill the "waiting for hold delay" loop named rpt
________ & <ACTIONDBLCLICK> ...
... second action is no (key was not released)
____ : nothing .......................... go on waiting for double click or timeout
.... second action is no ( no wait loop)
: set hh 0 ................................. key was not released
& repeat_start rpt 200ms 1 .... wait for 200ms only once with name 'rpt' (to see if a key is released and/or pressed & released again)
... when time ellapsed : there was no double click (loop is killed in this case)
& var hh 0 ? ............................ was the key keept down ?
... first action is yes holding
___ <ACTIONHOLD>
... second action is no ( it was a click)
: <ACTIONSINGLECLICK>
 

Posted Fri 01 May 20 @ 7:36 am
thank you very much for you good explain, but sorry my english not good enough to understand :(

i need to set delay time between the double click, thats the main question right now.

double click 200ms 1 ?

thats the right question?
 

Posted Fri 01 May 20 @ 4:24 pm
NicotuxHome userMember since 2014
the line
& repeat_start rpt 200ms 1

gives 200ms to perform a second click or to be consider as holding
single click is delayed 200ms

with
& repeat_start rpt 450ms 1

you have 450ms for second click and need to maintain for 450ms to consider holding
single click will be delayed 450ms

 

Posted Fri 01 May 20 @ 4:34 pm
ohhhhh. so that means that i dont really delaying the double click, i delay the regular click to wait and see if i will dobule?
 

Posted Fri 01 May 20 @ 7:27 pm
NicotuxHome userMember since 2014
yes exactly
of course the single click can't be sure as long as the timeout for a double or a hold has not elapsed
as soon as there were 2 clicks sure this was a double click
once time elapsed if the button was released it was a single click otherwhise it is hold
 

Posted Fri 01 May 20 @ 7:30 pm


(Old topics and forums are automatically closed)