Remapping trackball buttons

Hello everybody,

At long last, I finally got my MNT Reform laptop in the mail. Since I’m already an i3 user, I turned it on and felt immediately at home. I mean I’m customizing around so its compatible with my i3 muscle memory, but essentially it’s already 95% compatible with me right out of the box, which is a lot more than can be said of any other laptop I’ve owned.

One of the things I’m dying to change is the trackball button mapping. I’m a long-time Kensington Expert Mouse user and so I really, REALLY want the left and right click at the bottom. The MNT trackball would be nothing short of ideal for me if it used the Kensington Expert Mouse pattern.

Is there a way to remap those keys somehow?

Since what is running on your trackball is open firmware the question is not “if” but rather “how” :smiley:

I’ve never done this myself but I guess you could change the mapping here:

And then rebuild the firmware for your trackball and flash it. Good luck!

Okay I have rebuilt the firmware as per the instructions (no changes at the moment, just want to see how the process goes).

When I type ./flash.sh, it says:

No accessible RP-series devices in BOOTSEL mode were found.

Is there something I should do to disconnect the trackball and put it into programming mode? The doc doesn’t say and I can’t find much of anything online.

EDIT: Nevermind, I found the flashing switch on the trackball’s PCB.

My trackball now uses the Kensington Expert Mouse button pattern. That was easy :slight_smile:

3 Likes

Would it’ve helped to have flash.sh give you some tips? I prepared this MR now:

Tell me if you think I should add more or reword something to make it more helpful.

If you like, you can share the diff with your changes! :slight_smile:

Yes! It would have saved me 30 minutes of searching what to do.

Although in fairness, all I had to do was read the documentation: that’s how I noticed that the trackball PCB had a flash switch. Once you see it, it’s obvious. It’s just getting to that part of the documentation isn’t straightforward.

Your help in flash.sh would also have given me the idea of resetting the trackball with the switch instead of cycling the laptop’s power and rebooting. What can I say, I’m not clever all of the time :slight_smile:

Seems fine to me.

It doesn’t need to be verbose, just to point total newbies like me to the right direction.

Sure why not. Here goes:

diff --git a/reform2-trackball2-fw/src/main.c b/reform2-trackball2-fw/src/main.c
index 9829087..a852eac 100644
--- a/reform2-trackball2-fw/src/main.c
+++ b/reform2-trackball2-fw/src/main.c
@@ -39,11 +39,19 @@
 #define PIN_SDA 0
 #define PIN_SCL 1
 
-#define PIN_BTN1 20
-#define PIN_BTN2 21
-#define PIN_BTN3 19
-#define PIN_BTN4 18
-#define PIN_BTN5 17
+// Factory button assignments
+//#define PIN_BTN1 20  /* On MNT Reform: upper-left button > left click */
+//#define PIN_BTN2 21  /* On MNT Reform: upper-right button > right click */
+//#define PIN_BTN3 19  /* On MNT Reform: lower-left button > scroll mode */
+//#define PIN_BTN4 18  /* On MNT Reform: lower-mid button > middle click */
+//#define PIN_BTN5 17  /* On MNT Reform: lower-right button > wheel mode */
+
+// Kensington Expert Mouse-like button assignments on MNT Reform (i.e. with left and right clicks under the thumb)
+#define PIN_BTN1 19    /* Lower-left button > left click */
+#define PIN_BTN2 17    /* Lower-right button > right click */
+#define PIN_BTN3 20    /* Upper-left button > scroll mode */
+#define PIN_BTN4 18    /* Lower-mid button > middle click [UNCHANGED] */
+#define PIN_BTN5 21    /* Upper-right button > wheel mode */
 
 #define PIN_LEDS 24

It looks to me that your code comments should be part of the firmware so that the next person reading these bits knows what’s going on. If you like, I can create a commit with these changes and send it to MNT. How would you like to be credited?

I don’t need to be credited :slight_smile: But thanks.

I thank you as well. Please keep the problems coming so that we can fix them before others run into them as well.

I added a small drawing as well: reform2-trackball2-fw/flash.sh: add more helpful output (!86) · Merge requests · Reform / reform · GitLab