# Mouse sensitivity

**URL:** <https://mworks.discourse.group/t/mouse-sensitivity/1108>\
**Category:** Support\
**Created:** [August 11, 2025, 9:20am UTC](https://mworks.discourse.group/t/mouse-sensitivity/1108 "2025-08-11T09:20:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vgs](https://avatars.discourse-cdn.com/v4/letter/v/df705f/32.png) [@vgs](https://mworks.discourse.group/u/vgs)\
**Post date:** [August 11, 2025, 9:20am UTC](https://mworks.discourse.group/t/mouse-sensitivity/1108/1 "2025-08-11T09:20:59Z")

</div>

Hi Chris!

I am an intern at the DPZ and I was running a trial experiment. I have created a dot as my cursor, but i want to change the speed of it, because it is too fast to control. How could I achieve that?

Thanks a lot beforehand

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 11, 2025, 1:55pm UTC](https://mworks.discourse.group/t/mouse-sensitivity/1108/2 "2025-08-11T13:55:26Z")

</div>

Hi,

If the problem is the mouse tracking speed, then you’ll need to adjust that in the macOS settings:

[https://support.apple.com/guide/mac-help/mouse-settings-mh29222/mac](https://support.apple.com/guide/mac-help/mouse-settings-mh29222/mac)

If that’s not the issue, can you tell me in more detail how you created the cursor?

FYI, I’m away on vacation this week, so I’ll only be able to provide limited assistance until I return.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![vgs](https://avatars.discourse-cdn.com/v4/letter/v/df705f/32.png) [@vgs](https://mworks.discourse.group/u/vgs)\
**Post date:** [August 12, 2025, 10:17am UTC](https://mworks.discourse.group/t/mouse-sensitivity/1108/3 "2025-08-12T10:17:27Z")

</div>

Hello!

I don’t think that the issue, because I tried it and it didn’t change anything.

The code for the cursors is this:

var xAgent = 0  
var yAgent = 0

mouse\_input mouse1(  
mouse\_position\_x = xAgent  
mouse\_position\_y = yAgent  
autostart = true  
)

mouse\_input mouse2(  
mouse\_position\_x = xAgent  
mouse\_position\_y = yAgent  
autostart = true  
)

var IO\_mouseX\_pos = 0  
var IO\_mouseY\_pos = 0  
var cursor1\_x = 0  
var cursor1\_y = 0

var cursor2\_x = 0  
var cursor2\_y = 0

var IO\_mouseX\_raw = 0 {  
IO\_mouseX\_pos += IO\_mouseX\_raw  
if (abs(IO\_mouseX\_pos) \> 1024) {  
IO\_mouseX\_pos = IO\_mouseX\_pos / abs(IO\_mouseX\_pos) \* 1024  
}  
cursor1\_x = IO\_mouseX\_pos / 1024 \* 20  
cursor1\_y = IO\_mouseY\_pos / 1024 \* -20

}  
var IO\_mouseY\_raw = 0 {  
IO\_mouseY\_pos += IO\_mouseY\_raw  
if (abs(IO\_mouseY\_pos) \> 1024) {  
IO\_mouseY\_pos = IO\_mouseY\_pos / abs(IO\_mouseY\_pos) \* 1024  
}  
}  
var IO\_mouseDown = 0 {  
IO\_mouseX\_pos = 0  
IO\_mouseY\_pos = 0  
}

var IO\_mouse2X\_pos = 0  
var IO\_mouse2Y\_pos = 0

var IO\_mouse2X\_raw = 0 {  
IO\_mouse2X\_pos += IO\_mouse2X\_raw  
if (abs(IO\_mouse2X\_pos) \> 1024) {  
IO\_mouse2X\_pos = IO\_mouse2X\_pos / abs(IO\_mouse2X\_pos) \* 1024  
}  
cursor2\_x = IO\_mouse2X\_pos / 1024 \* -20  
cursor2\_y = IO\_mouse2Y\_pos / 1024 \* -20

}  
var IO\_mouse2Y\_raw = 0 {  
IO\_mouse2Y\_pos += IO\_mouse2Y\_raw  
if (abs(IO\_mouse2Y\_pos) \> 1024) {  
IO\_mouse2Y\_pos = IO\_mouse2Y\_pos / abs(IO\_mouse2Y\_pos) \* 1024  
}  
}  
var IO\_mouse2Down = 0 {  
IO\_mouse2X\_pos = 0  
IO\_mouse2Y\_pos = 0  
}

iodevice/usbhid\_generic maus1 (  
preferred\_location\_id = 1893965574  
usage\_page = 1  
usage = 1  
//log\_all\_input\_values = true  
autostart = true  
) {  
usbhid\_generic\_input\_channel (usage\_page = 1; usage = 48; value = IO\_mouseX\_raw)  
usbhid\_generic\_input\_channel (usage\_page = 1; usage = 49; value = IO\_mouseY\_raw)  
usbhid\_generic\_input\_channel (usage\_page = 9; usage = 1; value = IO\_mouseDown)  
}

iodevice/usbhid\_generic maus2 (  
preferred\_location\_id = 1245184  
usage\_page = 1  
usage = 1  
//log\_all\_input\_values = true  
autostart = true  
) {  
usbhid\_generic\_input\_channel (usage\_page = 1; usage = 48; value = IO\_mouse2X\_raw)  
usbhid\_generic\_input\_channel (usage\_page = 1; usage = 49; value = IO\_mouse2Y\_raw)  
usbhid\_generic\_input\_channel (usage\_page = 9; usage = 1; value = IO\_mouse2Down)  
}

stimulus\_display (  
background\_color = 0,0,0  
redraw\_on\_every\_refresh = true  
)

circle cursor1 (  
color = 0,1,0  
x\_size = 0.3  
x\_position = IO\_mouseX\_pos / 1024 \* 20  
y\_position = IO\_mouseY\_pos / 1024 \* -20  
alpha\_multiplier = 1 //transparency  
)

circle cursor2 (  
color = 1,0,0  
x\_size = 0.3  
x\_position = IO\_mouse2X\_pos / 1024 \* -20  
y\_position = IO\_mouse2Y\_pos / 1024 \* -20  
alpha\_multiplier = 1  
)

var dummyX = 0  
var dummyY = 0

iodevice/mouse\_input mouse (  
mouse\_position\_x = dummyX  
mouse\_position\_y = dummyY  
hide\_cursor = true  
)

When I changed the value of cursor1\_x and from IO\_mouseX\_pos / 1024 \* 20 to IO\_mouseX\_pos / 1024 \* 10, it changed the speed, but also the range of the cursor.

Did that help?

Thanks a lot,

Evan

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 18, 2025, 2:34pm UTC](https://mworks.discourse.group/t/mouse-sensitivity/1108/4 "2025-08-18T14:34:47Z")

</div>

Hi Evan,

Thanks for sharing your code.

I see you’re getting the cursor location via a [USB HID device](https://mworks.github.io/documentation/latest/components/usb_hid_device.html), instead of a [mouse input device](https://mworks.github.io/documentation/latest/components/mouse_input_device.html). That explains why changing the system mouse tracking speed didn’t have any effect. Are you doing this because you need to track two mice independently?

Interfacing with a mouse via a USB HID device is difficult, because you have to translate the data from the mouse in to screen position manually. That said, I think you can control the speed of the cursor by multiplying `IO_mouseX_raw` / `IO_mouseY_raw` by a scaling factor before adding it to `IO_mouseX_pos` / `IO_mouseY_pos`. For example, in the actions attached to `IO_mouseX_raw`, replace

```auto
IO_mouseX_pos += IO_mouseX_raw

```

with this:

```auto
IO_mouseX_pos += 0.5 * IO_mouseX_raw

```

I’m just using a scaling factor of 0.5 as an example. You can experiment to find the right value for the speed you want.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![vgs](https://avatars.discourse-cdn.com/v4/letter/v/df705f/32.png) [@vgs](https://mworks.discourse.group/u/vgs)\
**Post date:** [August 28, 2025, 9:41am UTC](https://mworks.discourse.group/t/mouse-sensitivity/1108/5 "2025-08-28T09:41:35Z")

</div>

Hi Chris!

Sorry for the late reply.

It worked perfectly.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [August 28, 2025, 1:29pm UTC](https://mworks.discourse.group/t/mouse-sensitivity/1108/6 "2025-08-28T13:29:33Z")

</div>


