Author Topic: TMK Firmware for Sentraq S60-X 60%: Mouse layer swaps button 2 and button 3  (Read 3029 times)

0 Members and 1 Guest are viewing this topic.

Offline bgoodr

  • Thread Starter
  • Posts: 14
Hi,

I have built two Sentraq S60-X 60% DIY Keyboard Kit's from MassDrop. Below is a picture of one of them. There's really nothing special there than the front side labels I attached to the keys to aid me learning to use the SpaceFN layer:



I am using a forked version of the TMK firmware from Vinny Cordeiro's TMK fork (MassDrop reference to it at Reference to Vinny Cordeiro's TMK fork on MassDrop).

I have constructed my own keymap that contains a SpaceFN and Mouse Keys layer.  I've got it all working correctly for my needs, but there is a problem with it:

Find my keymap_spacefn_capslockctrlswap_mousekeys.c in my GitHub repo.  (OT: That bgoodr/keyboard-firmware-build-util repo is just a thin facade around the TMK firmware to provide automatic installation of required packages on Ubuntu).

When I initially defined the mouse layer, I simply reused similar code found in the keymap_hasu.c (line 121) file. I verified that the keyboard mostly worked properly using X windows xev program on my Ubuntu 16.04 LTS machine. I discovered that, when the mouse keys layer was enabled, when I pressed the key for BTN3, xev reported it as Button 2. Likewise, the key for BTN2 produced an xev report of Button 3.  It is as if these two keys are swapped.

I have since hacked around this simply by swapping BTN2 and BTN3 (commit 2216915728b89f1aeeeb8e95c88a6c447bca5534), but it is an unsightly hack.

I have considered that this might be something unique to my Ubuntu configuration, however I do not believe that is the case, because of this test: I hooked the keyboard up to my Windows 7 laptop, moved the mouse cursor over the title bar of a window, and used the mouse keys layer and clicked what is currently mapped to BTN3, and I got the context menu to popup.  This tells me that even Windows is seeing the same codes from the keyboard as Linux is.

This is quite puzzling. Does anyone have any ideas?

Thanks!
bg
Current keyboard: Sentraq S60-X 60% DIY Keyboard Kit
Utility I use to build TMK firmware on Ubuntu: Keyboard firmware build utils
Current layout: keymap_spacefn_capslockctrlswap_mousekeys.c