Skip to content

Feature request: allow Force Touch to emit arbitrary key/button events, not only left/right/middle click #2

Description

@TypoMustakes

First of all, thank you for LinuxMagicForce. I’m using it with an Apple Magic Trackpad 2 on Linux, and it’s the first setup I’ve found that makes Force Touch genuinely usable. I would also like to point out that I’m not familiar enough with the codebase to know whether there are constraints that make this difficult, but from a user perspective this would be a very valuable feature.

Current limitation

At the moment, Force Touch can only be mapped to one of:

  • left click
  • right click
  • middle click

This works for basic use, but it limits what can be done in modern Wayland compositors and tiling environments such as Hyprland.

Why this is a problem

If Force Touch is mapped to middle click, then from the compositor / application side it becomes indistinguishable from any other middle click. In other words, the original “this was a Force Touch action” signal is lost.

That makes it hard to build more advanced workflows such as:

  • binding Force Touch to a compositor action
  • making Force Touch trigger different behavior depending on the focused application
  • using Force Touch as a dedicated “extra input layer” without interfering with normal middle-click behavior
  • scripting per-app actions in Hyprland, Sway, etc.

For example, on my system I’d like Force Touch to act as a dedicated trigger that Hyprland can catch and translate depending on the focused window, similar in spirit to how Force Touch can have context-sensitive behavior on macOS. That’s only practical if the event is exposed as something distinct from BTN_LEFT / BTN_RIGHT / BTN_MIDDLE.

Requested feature

It would be extremely useful if LinuxMagicForce could optionally emit an arbitrary evdev key or button event for Force Touch, instead of only the three standard mouse buttons.

Examples of useful outputs:

  • keyboard keys such as KEY_F13 through KEY_F24
  • other keys like KEY_PROG1, KEY_MACRO1, etc.
  • extra mouse buttons such as BTN_SIDE, BTN_EXTRA, BTN_TASK

The key point is not a specific default, but the ability to configure Force Touch to emit a distinct input event.

Why this would help

With a unique event code, users could then:

  • bind Force Touch in Hyprland / Sway / other compositors
  • route it through scripts depending on the active window
  • keep normal middle-click behavior intact
  • use Force Touch as a dedicated “modifier-like” action for advanced workflows

In practice this would make Force Touch much more powerful on Linux, especially for Wayland users.

If the full-on configurable output is too much work, or there are some fundamental obstacles to this that I am not aware of, then perhaps support for a limited set of configurable non-standard outputs, e.g. KEY_F13 to KEY_F24 and/or BTN_SIDE / BTN_EXTRA, would also solve this.

Thanks again for the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions