Skip to content

v0.9.0

Latest

Choose a tag to compare

@taj-ny taj-ny released this 09 Mar 15:31
· 22 commits to main since this release
Immutable release. Only release title and notes can be modified.
bc0add8

First release after the repository split. For more information about the split and older releases see https://github.com/taj-ny/InputActions/releases.

This release only contains information about changes that affect all implementations. Don't forget to check out the latest releases for the KWin and Hyprland implementations as well.

Changes

  • Added a command-line tool for management - inputactions. The DBus interface is now considered internal and should not be used directly. Installation instructions have been updated to install this tool as well. Repository: InputActions/ctl
  • Added an emergency key combination (by default backspace+space+enter) that can be held in any order for 2 seconds to suspend InputActions until the next config reload.

Actions

  • Action
    • Modified properties
      • on: New value (tick) - for time-based actions in motion triggers.
    • New properties
  • InputAction
    • Added the wheel mouse action
    • The move_by_delta mouse action now accepts an optional argument that multiplies the delta (e.g. move_by_delta 0.75). This replaces the global mouse.delta_multiplier and touchpad.delta_multiplier properties.

Config

  • The legacy config ~/.config/kwingestures.yml is no longer copied to ~/.config/inputactions/config.yaml if the latter does not exist.
  • Added more error messages and improved existing ones.
  • Added warnings about deprecated features and unused (likely misspelled) properties.
  • Added /etc/inputactions/config.yaml to the list of configuration file candidates, making it possible to restrict write access for unprivileged programs. The new order is (highest priority to lowest):
    • ~/.config/inputactions/config-debug.yaml (debug builds only)
    • /etc/inputactions/config.yaml
    • ~/.config/inputactions/config.yaml (created if not present)
  • New root properties:
    • anchors: For defining YAML anchors without unused property warnings.
    • device_rules
    • emergency_combination
    • external_variable_access: Allow dumping variables by running inputactions variables list.

Run inputactions config reload or inputactions config issues to see detailed information about issues.

Devices

  • DeviceRule: New device property system based on conditions, where each device can have properties applied by many rules
    device_rules:
      - conditions: $name == Logitech G502 X
        motion_threshold: 30
    
      - conditions: $mouse
        press_timeout: 300
        unblock_buttons_on_timeout: false
    
      - conditions: $name contains TrackPoint
        ignore: true
  • Device
    • New properties for all devices (configurable through device rules)
      • ignore: Ignore the device.
  • Mouse
    • New device properties
      • motion_threshold: Used for determining the direction of swipe triggers. It should not be necessary to change the threshold in most cases.
      • motion_timeout: Replaces mouse.motion_timeout, now can be configured on a per-device basis.
      • press_timeout: Replaces mouse.press_timeout, now can be configured on a per-device basis.
      • swipe.angle_tolerance: Angle tolerance for the left, right, up, down, left_right and up_down swipe directions. The remaining space is used for diagonal directions.
      • unblock_buttons_on_timeout: Replaces mouse.unblock_buttons_on_timeout, now can be configured on a per-device basis.
    • Added the lock_pointer property for all mouse motion triggers - locks the pointer's position while the trigger is active.
    • Added the circle trigger (more information below).
  • Touchpad:
    • New device properties
      • click_timeout: Replaces touchpad.click_timeout, now can be configured on a per-device basis.
      • handle_evdev_events: Allows for disabling the evdev input backend in case of issues for a specific device.
      • motion_threshold_1: Used for determining the direction of 1-finger swipe triggers. It should not be necessary to change the threshold in most cases.
      • motion_threshold_2: Used for determining the direction of 2-finger swipe triggers. It should not be necessary to change the threshold in most cases.
      • motion_threshold_3: Used for determining the direction of 3-finger swipe triggers. It should not be necessary to change the threshold in most cases.
      • swipe.angle_tolerance: Angle tolerance for the left, right, up, down, left_right and up_down swipe directions. The remaining space is used for diagonal directions.
    • Added the circle trigger (more information below).
  • Touchscreen: Added support

Triggers

  • Trigger
    • New properties
      • block_events: Whether to block input events when this trigger is active.
      • resume_timeout: Delays the trigger end in order to allow resumption before a certain amount of time passes.
  • CircleTrigger: New trigger where the action is continuous circular motion around any point. Can be used for touchpad circular scrolling. Credits to galundin/circular-scrolling-improved for the algorithm. Available for mice, touchpads and touchscreens.
  • SwipeTrigger:
    • Now based on angles, making it possible to create diagonal gestures. The angle tolerance for the left, right, up, down, left_right and up_down has been reduced from 45° to 20°. To restore the old behavior and disable diagonal gestures, set the swipe.angle_tolerance device property to 45:
      device_rules:
        - swipe:
            angle_tolerance: 45
    • Modified properties:
      • direction: New values: left_up, left_down, right_up, right_down, left_up_right_down, left_down_right_up.
    • New properties:
      • angle: Custom angle range (mutually exclusive with direction).
      • bidirectional: Also allow motion in the range opposite to the one specified in angle (does nothing if a predefined direction is used).

Variables

  • New variables
    • time_since_last_trigger
    • window_under_fingers_*: Information about the window under fingers (touchscreen only).
    • window_pid, window_under_fingers_pid, window_under_pointer_pid: ID of the process that owns the window.

Example use cases of new features

Mouse: kill window that was under the pointer **at the beginning of the stroke**
- type: stroke
  strokes: [ 'NAAAMy9kZAA=' ] # down
  mouse_buttons: [ right ]

  actions:
    # save the variable to a file for later use, this is currently the only method
    - on: begin
      conflicting: false # this prevents the action from triggering conflict resolution
      command: echo "$window_under_pointer_pid" > /tmp/inputactions_var

    - on: end
      command: kill -9 "$(cat /tmp/inputactions_var)"
Touchpad: circular scrolling

Place two fingers, with at least one’s initial position being the top or bottom edge, then start circling around any point.

- type: circle
  fingers: 2
  direction: any

  conditions:
    any:
      - $finger_1_initial_position_percentage_y <= 0.05
      - $finger_2_initial_position_percentage_y <= 0.05
      - $finger_1_initial_position_percentage_y >= 0.95
      - $finger_2_initial_position_percentage_y >= 0.95

  actions:
    - on: update
      interval: -0.5
      input:
        - mouse: [ wheel 0 -1 ]

    - on: update
      interval: 0.5
      input:
        - mouse: [ wheel 0 1 ]
Touchpad: automatically move the pointer when a finger touches the edge of a touchpad
- type: swipe
  fingers: 1
  direction: any
  block_events: false

  conditions: $finger_1_initial_position_percentage between 0.2,0.2;0.8,0.8 # prevent accidental activations

  actions:
    - on: tick
      conditions: $finger_1_position_percentage_x <= 0.05

      input:
        - mouse: [ move_by -1 0 ]

    - on: tick
      conditions: $finger_1_position_percentage_x >= 0.95

      input:
        - mouse: [ move_by 1 0 ]

    - on: tick
      conditions: $finger_1_position_percentage_y <= 0.05

      input:
        - mouse: [ move_by 0 -1 ]

    - on: tick
      conditions: $finger_1_position_percentage_y >= 0.95

      input:
        - mouse: [ move_by 0 1 ]
Touchpad: 3-finger window drag (allow lifting fingers)
- type: swipe
  fingers: 3
  direction: any
  resume_timeout: 500 # allow lifting fingers for 500 ms, perform any other action (for example tap) to cancel the trigger immediately

  actions:
    - on: begin
      input:
        - keyboard: [ +leftmeta ]
        - mouse: [ +left ]

    - on: update
      input:
        - mouse: [ move_by_delta ]

    - on: end_cancel
      input:
        - keyboard: [ -leftmeta ]
        - mouse: [ -left ]