# Mouse click and drag left right

**URL:** <https://forum.bome.com/t/mouse-click-and-drag-left-right/1472>\
**Category:** Bome Products\
**Created:** [April 26, 2020, 9:55am UTC](https://forum.bome.com/t/mouse-click-and-drag-left-right/1472 "2020-04-26T09:55:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luchian](https://forum.bome.com/letter_avatar_proxy/v4/letter/l/e0b2c6/32.png) [@Luchian](https://forum.bome.com/u/Luchian)\
**Post date:** [April 26, 2020, 9:55am UTC](https://forum.bome.com/t/mouse-click-and-drag-left-right/1472/1 "2020-04-26T09:55:23Z")

</div>

Hi there,

I want to make a script wich can go to a position click and drag left or right how i rotate my knob. So i made

1. Mouse move and click down
2. Timer Drag
3. Mouse move left right (here i don't know how to do it)
4. Timer drag mouse click UP

How i can configure my rules that he know where i rotate left or right? (my knobs are 0-127 and i have X-touch Mini)

Thanks,

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [April 26, 2020, 3:32pm UTC](https://forum.bome.com/t/mouse-click-and-drag-left-right/1472/2 "2020-04-26T15:32:08Z")

</div>

The below post should help:

[https://www.bome.com/support/kb/midi-controller-to-mouse-question-help](https://www.bome.com/support/kb/midi-controller-to-mouse-question-help)

I recommend you use X-touch editor and make your knob relative instead of absolute, but if you insist on absolute, you can do something in MT Pro to convert it to relative. See the below tutorial:

https://youtu.be/VCvxPZawJyE

&nbsp;

Steve Caldwell  
Bome Q and A Moderator and  
Independent Bome Consultant/Specialist  
bome@sniz.biz

---

<div class="post-metadata">

**Author:** ![Luchian](https://forum.bome.com/letter_avatar_proxy/v4/letter/l/e0b2c6/32.png) [@Luchian](https://forum.bome.com/u/Luchian)\
**Post date:** [April 26, 2020, 4:04pm UTC](https://forum.bome.com/t/mouse-click-and-drag-left-right/1472/3 "2020-04-26T16:04:52Z")

</div>

Thanks for reply. I need knobs to be relative because i use x-touch with midi2lr on Lightroom. I resolve like this:

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
[x] Preset 0: Init

[x] Translator 0.0: Project Opened  
Incoming: Project Opened  
Outgoing: One-shot timer "Init": 0 ms delay

[x] Translator 0.1: Esc Init  
Incoming: Physical Keys: Esc  
Outgoing: One-shot timer "Init": 0 ms delay

[x] Translator 0.2: Init Global Variables  
Incoming: On timer "Init"  
Rules:  
// ga = value of the knob for scroll wheel  
// This will be updated when the actual knob  
// is moved. Let's start it at 1/2 wa  
ga=64  
Outgoing: (none)

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

[] Preset 3: DR Contrast

[x] Translator 3.0: Move knob 64  
Options: swallow  
Incoming: Control Change on ch. 11 with any CC# set 'qq' to CC# with any value  
Outgoing: Control Change on ch. 11 with CC#:qq and value:64 (0x40), to port X-TOUCH MINI

[x] Translator 3.1: Mouse Move and click  
Options: swallow  
Incoming: Control Change on ch. 11 with any CC# set 'qq' to CC# with any value  
Rules:  
if g0==1 then exit rules, skip Outgoing Action  
g0=1

//CONTRAST  
//ga=491  
//gb=1966  
if qq==1 then ga=482  
if qq==1 then gb=1966

//PIVOT  
//ga=693  
//gb=1966  
if qq==2 then ga=693  
if qq==2 then gb=1966

//SATURATION  
//ga=865  
//gb=1966  
if qq==3 then ga=865  
if qq==3 then gb=1966

if qq\>3 then exit rules, skip Outgoing Action

Outgoing: Left mouse button down at ga,gb on primary display

[x] Translator 3.2: Timer Drag  
Options: swallow  
Incoming: Control Change on ch. 11 with any CC# and any value  
Outgoing: One-shot timer "Drag": 250 ms delay

[x] Translator 3.3: Mouse move left  
Options: swallow  
Incoming: Control Change on ch. 11 with any CC# and any value set 'pp' to value  
Rules:  
if pp\<65 then gr=-5  
if pp\>65 then gr=5  
Outgoing: Mouse move gr horizontal

[x] Translator 3.4: Timer Drag and Mouse click UP  
Incoming: On timer "Drag"  
Rules: g0=0  
Outgoing: Left mouse button up

---

<div class="post-metadata">

**Author:** ![Luchian](https://forum.bome.com/letter_avatar_proxy/v4/letter/l/e0b2c6/32.png) [@Luchian](https://forum.bome.com/u/Luchian)\
**Post date:** [April 26, 2020, 4:05pm UTC](https://forum.bome.com/t/mouse-click-and-drag-left-right/1472/4 "2020-04-26T16:05:32Z")

</div>

There is any solution on

“if qq\>3 then exit rules, skip Outgoing Action”

to do nothing if qq\>3 ?

Thanks,

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [April 26, 2020, 5:24pm UTC](https://forum.bome.com/t/mouse-click-and-drag-left-right/1472/5 "2020-04-26T17:24:06Z")

</div>

Hi,

Your drag operation is occurring immediately while your click is being delayed by the timer.

You need to use a timer and global variables for your drag operation

- Translator that monitors incoming CC and puts the value in a global variable (since the timer will not see local variables). All this timer should do is store the global variable you want for the drag operation. No outgoing action.

After click operation you need to then trigger the drag operation which should look at the global variable set by the translator above&nbsp; to determine the drag direction. and distance.

So essentially you uncouple the CC incoming value with the outgoing operation by a timer.

&nbsp;

Steve Caldwell  
Bome Q and A Moderator and  
Independent Bome Consultant/Specialist  
bome@sniz.biz

---

<div class="post-metadata">

**Author:** ![Luchian](https://forum.bome.com/letter_avatar_proxy/v4/letter/l/e0b2c6/32.png) [@Luchian](https://forum.bome.com/u/Luchian)\
**Post date:** [April 26, 2020, 6:06pm UTC](https://forum.bome.com/t/mouse-click-and-drag-left-right/1472/6 "2020-04-26T18:06:50Z")

</div>

I tried something, hope it\'s ok

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [April 27, 2020, 3:05am UTC](https://forum.bome.com/t/mouse-click-and-drag-left-right/1472/7 "2020-04-27T03:05:13Z")

</div>

It looks OK, did you try it?
