Multitouch on trackpad?

How does the multitouch work on the trackpad module? Is it as advanced as the Apple Trackpad? I’ve noticed that I can pinch to zoom out (Cmd–), but zooming in triggers a different shortcut (Ctrl-Shift-=).

Is there any way to configure this? I have tried all the different zoom options, but only the Zoom PC works as expected. I would like to “2 finger swipe left/right” for back and forward, and could think of other ideas similar to the Apple Trackpad.

As far as I remember, we are getting following events from the board:

  • single finger tap
  • single finger move
  • two (multi?) finger move (4 directions)
  • two (multi?) finger tap
  • zoom in, zoom out

We interpret two finger move as scrolling. This is hard coded if I remember correctly.

Implementing left right 2 finger gestures should be possible (and indeed it sounds like a great idea now that you say that aloud, since scrolling is available via layer switchers), but is not implemented at the moment.

As to the zoom navigation mode, feel free to remap it according to firmware/doc-dev/reference-manual.md at master · UltimateHackingKeyboard/firmware · GitHub via the $onInit macro event.

1 Like

I am currently running rightaditya’s firmware build from
High-resolution scrolling · Issue #741 · UltimateHackingKeyboard/firmware · GitHub on an UHK60v1 under Windows 11, and I can two-finger swipe left/right on the touchpad and make my browser go back/forward.

1 Like

Actually I just realised that’s not the whole truth. I can do it inside a VirtualBox VM running Firefox on RHEL8. But not directly under the same Firefox running on the host Windows 11.

Don’t ask me why.

1 Like

Just tried it on a Linux host (Pop_OS! 22.04) with the regular build and here again I can two-finger swipe back and forth in the browser history via the touchpad.

Is it possible to run both of these firmwares, or would I need to choose one over another?

You can only install one firmware at a time.

What I don’t understand is why I can successfully use two-finger left/right swipes with the touchpad with the official firmware on Linux / Firefox, but not under Windows 11. So it seems that the official released firmware can do it, given the right circumstances.

Can you please share the script you used to achieve this? I tried going though your Github repo, but was unable to find any script that looked relevant. I did go through the reference manual but only saw this:

set keymapAction.fn.193 macro TouchpadAction 
(maps touchpad two-finger gesture to a macro named TouchpadAction).

but this doesn’t specify any gesture direction. What is 193?

I tried using the highres firmware for a bit, but could not notice any difference in the scrolling smoothness. But, for some reason, the call hrm-auto in the $onInit doesn’t seem to trigger when booting up the device. I need to manually enable hrm-auto everytime.

Edit: I changed it to exec hrm-auto and it seems to work as expected now.

So, I just switched back to 11.1.1, but still get this bug.

Also, the onHold modifier still has not been released in this new update (compared to the other firmware versio discussed in a separate thread)

193 is the 2-finger tap action.

To map to directions, you need to remap the relevant navigation mode.

set module.keycluster.navigationMode.base caret

set navigationModeAction.media.left macro VimMTL
set navigationModeAction.media.right macro VimMTR

But the operation is meant for caret-like operation, where one swipe will correspond to dozens activations. (This could be worked around via a more complicated smart macro, but…)

No script; I just swiped.

What is 193?

It’s the key id of the key that set keymapAction is supposed to bind the action. Each key on the UHK has a key id. You can either look up the id manually, or use a calculation such as $keyId.g (which returns the key id of the key that is labelled g on the US QWERTY layout). There’s also resolveNextKeyId (see reference manual for how to use it).

I don’t understand. Does it mean that your linux interprets any fast side-ways scroll as a history movement?

(UHK does no such thing on its own.)

I don’t understand it either! All I know is that I use two fingers to swipe (even slowly), and the browser starts showing the ← and → symbols sliding in from the side… If I do the same with one finger, it just moves the mouse.

Let me check again which firmware I was running; I’ve had two many different builds lately, testing too many different things in short succession.

Also, I need to gather all the touchpad- and mouse-related configuration settings. I’ll get back on this.

I tested this now with UHK60v1 connected to Windows 11 PC, running rightaditya/uhkfirmware: 11.1.0 #f1f20388 and also with official UltimateHackingKeyboard/firmware: 11.1.1.

Config was my Maxtend UHK Config.

When I open MS Excel, I can scroll the sheet up/down/left/right with two-finger swipes on the touchpad.

When I open Firefox, I can scroll the page up/down with two-finger swipes on the touchpad. Left/right doesn’t do anything (no back/forth).

However, in a VirtualBox VM with RHEL8 and Firefox Browser inside, I can also two-finger left/right to go back/forth. In that Firefox I have the extension “Two-Finger History Jump” installed.

So I think the difference is the “Two-Finger History Jump” that allows me to do back/forward in Firefox. It seems to convert the scrolling action to history back/forward when there is nothing to scroll horizontally. If I disable this extension, I get the same behaviour as on the Firefox directly on Windows.

Without that “Two-Finger History Jump”, and in other applications, the two-finger swipe gives me scrolling action in all four directions.

Using the actual Laptop touchpad, two-finger swipes give me history back/forward also without the “Two-Finger History Jump” extension.

With rightaditya’s firmware, the scrolling is super smooth (hires scrolling). With the official firmware, scrolling is in larger steps.