# Trouble with mouse keys

**URL:** <https://community.keyboard.io/t/trouble-with-mouse-keys/918>\
**Category:** Programming\
**Created:** [January 4, 2018, 7:31pm UTC](https://community.keyboard.io/t/trouble-with-mouse-keys/918 "2018-01-04T19:31:08Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [January 9, 2018, 6:55pm UTC](https://community.keyboard.io/t/trouble-with-mouse-keys/918/21 "2018-01-09T18:55:47Z")

</div>

Hrm. If you change the HID report to constant (that is, replace [this line](https://github.com/keyboardio/KeyboardioHID/blob/3fbb10871a5a70858f742fbf7988b27b42b63b9f/src/MultiReport/Mouse.cpp#L61) with `D_INPUT, (D_CONSTANT)`), does that make it work under OSX? If not, what if you remove that block of the descriptor (lines 55-61), and change `Mouse.sendReport` to send `sizeof(report)-1` (to exclude the last hWheel byte)?

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [January 9, 2018, 8:21pm UTC](https://community.keyboard.io/t/trouble-with-mouse-keys/918/22 "2018-01-09T20:21:46Z")

</div>

> [@algernon](#):
>
> Hrm. If you change the HID report to constant (that is, replace this line with D\_INPUT, (D\_CONSTANT)), does that make it work under OSX? If not, what if you remove that block of the descriptor (lines 55-61), and change Mouse.sendReport to send sizeof(report)-1 (to exclude the last hWheel byte)?

Just changing line 61 did not work, but removing lines 55-61, and one byte from the report did work:

```auto
void Mouse_::sendReportUnchecked(void) {
  HID().SendReport(HID_REPORTID_MOUSE, &report, sizeof(report)-1);
}

```

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [January 10, 2018, 4:52am UTC](https://community.keyboard.io/t/trouble-with-mouse-keys/918/23 "2018-01-10T04:52:47Z")

</div>

> [@So8res](#):
>
> any ideas as to what’s going on, or how to debug the issue? I’ve debugged a little, to no avail.

If you’re desperate to get this working again, I can now give you a fairly simple change that will make it work, as long as you don’t also want keys for a horizontal scroll wheel. @algernon and/or @jesse will likely come up with a better fix, but they might be occupied with more pressing issues for a while (or it might be a difficult problem to solve without removing horizontal scroll support).

Given that it’s been broken for a while, and only one person seems to have noticed, this might not be high on the priority list. There is now a [GitHub issue against KeyboardioHID](https://github.com/keyboardio/KeyboardioHID/issues/25) for anyone who wants to follow this problem.

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [January 10, 2018, 5:11am UTC](https://community.keyboard.io/t/trouble-with-mouse-keys/918/24 "2018-01-10T05:11:09Z")

</div>

I’ve created a [PR for KeyboardioHID](https://github.com/keyboardio/KeyboardioHID/pull/26) that can be used as a temporary band-aid to restore mouse key functionality on macOS. It’s not intended as a long-term solution, but it can fix things for the moment, as long as you don’t also need keys for a horizontal scroll wheel at the same time.

(Credit is mostly due to @algernon for the code; I’m only responsible for some of the grunt work).

[Previous page](https://community.keyboard.io/t/trouble-with-mouse-keys/918.md?page=1)
