input: Implement click finger behaviour (enabled by default)

input touchpad settings header:
- click finger behaviour (enabled by default)
- Emulation of different button clicks depending on the
  number of fingers that are pressed at the same time on
  any location of the touchable surface of the device.
    - Clicking with 1 finger triggers a primary button click,
      usually left button click.
    - Clicking with 2 fingers triggers a secondary button click,
      usually right button click.
    - Clicking with 3 fingers triggers a terciary button click,
      usually middle button click.

  This feature is useful for clickpads that are input devices
  lacking a separated set of buttons from the touch area.

input preflet:
- Implement clickfinger

input mouse:
- Handle and provide new settings for clickfinger behaviour

input mouse mm:
- Implement clickfinger in the user space
- Enables button emulation based on the number of fingers pressing
  at the same time the touch surface.

  Userful feature for clickpads.

Change-Id: Ibaa06df3887793158093cc08f6281fc080e85c3b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9923
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Samuel Rodríguez Pérez
2026-01-02 11:01:29 +00:00
committed by Adrien Destugues
parent f44235f7e5
commit a3f6c4d484
7 changed files with 52 additions and 2 deletions
@@ -34,6 +34,10 @@ typedef struct {
// 0x04: edge motion on button click move
// 0x08: edge motion on button click drag
bool finger_click; // 1 finger click -> click button id 1
// 2 fingers' click -> click button id 2
// 3 fingers' click -> click button id 3
bool software_button_areas;
} touchpad_settings;
@@ -53,6 +57,7 @@ const static touchpad_settings kDefaultTouchpadSettings = {
false,
true,
0x02,
true,
false
};