[atreus] Mouse keys -- yes, it works!

  • From: Mauro Lopes <maurolopes@xxxxxxxxx>
  • To: atreus@xxxxxxxxxxxxx
  • Date: Mon, 25 Apr 2016 01:31:59 -0300

I spent quite some time trying to make Mouse Keys (controlling the mouse
cursor by pressing keyboard keys) work on my Atreus. After almost giving
up, I found a solution.
For reasons that I still don't understand, you can't just use mouse
keycodes directly in the keymap. But it works perfectly (all mouse
commands) if you create an action and point to it in the keymap! In other
words:

----------------------------------------------------------------
Wrong:

KEYMAP(.... KC_MS_UP ....)
----------------------------------------------------------------
Right:

KEYMAP(.... KC_FN7 ....)

const uint16_t PROGMEM fn_actions[] = {
  .....
  [7] = ACTION_MOUSEKEY(KC_MS_UP),
  .....
};

Don't forget to uncomment `MOUSEKEY_ENABLE = yes` in the Makefile and run
`make clean` before recompiling just in case.
And yes, I used 16 of 32 possible fn_actions just to have all mouse
commands.
----------------------------------------------------------------

Given that this behavior is unexpected and it seems this solution is not
explained anywhere (having had no replies in the old version of this
mailing list, here [1]), I thought it was worth sharing.

[1] http://librelist.com/browser/atreus/2015/7/15/tmk-mouse-keys/

Other related posts: