Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
9db7b43
{kwin,libgestures}: implement mouse swipe gesture
taj-ny Mar 2, 2025
d51dadd
{kwin,libgestures}: implement mouse hold gesture
taj-ny Mar 2, 2025
82d51bb
{kwin,libgestures}: change a lot of stuff, add mouse wheel gesture
taj-ny Mar 8, 2025
310a1c9
change a ton of stuff
taj-ny Mar 15, 2025
0f966c0
docs/config: add missing directions for wheel
taj-ny Mar 15, 2025
6381511
libgestures: prevent gesture conflicts
taj-ny Mar 19, 2025
e3025db
{kwin,libgestures}: add stroke gesture
taj-ny Mar 23, 2025
3bbe1f9
docs: update
taj-ny Mar 23, 2025
55b5b33
readme: update
taj-ny Mar 23, 2025
abeb569
docs/config: fix link
taj-ny Mar 23, 2025
0da904d
kwin/kcm: update about page
taj-ny Mar 23, 2025
d851cd4
kwin/kcm: link to current version's documentation in about page
taj-ny Mar 23, 2025
5052ae9
cmake: enable optimizations and debug output
taj-ny Mar 23, 2025
ec34c2a
libgestures: more logging
taj-ny Mar 25, 2025
217dc34
{kwin,libgestures}: allow mouse motion gestures with modifiers only
taj-ny Mar 25, 2025
934d8b0
libgestures: add more logging, add name property to gestures,actions
taj-ny Mar 26, 2025
95425f9
libgestures/handler: fix stroke gestures
taj-ny Mar 26, 2025
71897ba
libgestures/handler: fix stroke gesture conflict resolution
taj-ny Mar 27, 2025
13c163c
libgestures: Gesture.press_instant -> Gesture.instant
taj-ny Mar 27, 2025
eeca593
docs/config: improve action interval documentation
taj-ny Mar 27, 2025
e59a3b8
docs/config: update
taj-ny Mar 28, 2025
ae9f7fd
docs/config: add hyperlinks in types
taj-ny Mar 28, 2025
104aad1
Revert "kwin/kcm: link to current version's documentation in about page"
taj-ny Mar 28, 2025
1ae747b
libgestures: encode stroke data as base64 to save space
taj-ny Mar 29, 2025
f57d8c5
libgestures/stroke: allow multiple strokes per gesture
taj-ny Mar 30, 2025
8c680a9
{kwin,libgestures}: replace edges with start positions
taj-ny Mar 30, 2025
65660f9
readme: update
taj-ny Mar 30, 2025
03ef90a
readme: fix typos
taj-ny Mar 30, 2025
fe07b9e
libgestures: add gesture end positions
taj-ny Mar 31, 2025
5973522
libgestures/handler: minor improvements to mouse gestures
taj-ny Mar 31, 2025
aaa09f3
Merge remote-tracking branch 'origin' into mouse-gestures
taj-ny Mar 31, 2025
68b1206
kwin: disable mouse gestures on Plasma <6.3
taj-ny Mar 31, 2025
43b4bf3
libgestures/handler: make timeouts configurable
taj-ny Mar 31, 2025
f3eb7f6
hide debug logs on release builds
taj-ny Mar 31, 2025
1a9e87d
libgestures/handler: simplify stuff
taj-ny Mar 31, 2025
70bb6f2
libgestures/handler: make touchpad scroll timeout configurable
taj-ny Mar 31, 2025
acaafb8
rename stuff
taj-ny Apr 2, 2025
c0014f4
libgestures: begin refactor
taj-ny Apr 3, 2025
7ff8f52
it builds!
taj-ny Apr 5, 2025
a0f3289
tests: add some tests
taj-ny Apr 5, 2025
efeb6ec
workflows/test: add missing dependency
taj-ny Apr 5, 2025
8394bc1
tests/(directional)motiontrigger: create
taj-ny Apr 5, 2025
cd84d98
bug fixes
taj-ny Apr 9, 2025
75dc60b
kwin: replace handlers before loading config
taj-ny Apr 9, 2025
7882de0
kwin/kcm: wrap text
taj-ny Apr 9, 2025
585cd9e
libgestures: move src/libgestures/libgestures to src/libgestures
taj-ny Apr 9, 2025
c07f838
libgestures -> libinputactions
taj-ny Apr 9, 2025
9607186
libinputactions: move swipe delta multiplier to motion trigger handler
taj-ny Apr 10, 2025
31e0b31
libinputtriggers: rename some handler methods
taj-ny Apr 10, 2025
49c7e3c
tests: remove old gesture tests
taj-ny Apr 10, 2025
f132072
tests: fix
taj-ny Apr 10, 2025
da9fbe6
cmake: try to fix build failure
taj-ny Apr 10, 2025
5a44a06
tests/range: create
taj-ny Apr 10, 2025
dec7607
libinputactions: rename stuff
taj-ny Apr 10, 2025
b0ec7a8
kwin/kcm: fix typo
taj-ny Apr 10, 2025
e17fdd6
some cleanup
taj-ny Apr 14, 2025
cc826c3
libinputactions/mousehandler: block mouse up events
taj-ny Apr 14, 2025
594163b
libinputactions/mousehandler: get current buttons from events, not Input
taj-ny Apr 14, 2025
bed5f56
kwin: remove useless line
taj-ny Apr 14, 2025
e1cfe04
tests: fix
taj-ny Apr 14, 2025
fe36505
libinputactions: split Input into InputEmitter and InputState
taj-ny Apr 14, 2025
89f07e4
libinputactions/mousehandler: ignore motion before press timeout
taj-ny Apr 14, 2025
4045cac
tests: fix for the millionth time
taj-ny Apr 14, 2025
573307a
kwin: fix build on Plasma <6.3
taj-ny Apr 14, 2025
98815ba
docs/config: remove duplicate section
taj-ny Apr 14, 2025
e124fb8
libinputactions/mousehandler: fix modifiers check
taj-ny Apr 15, 2025
baf78aa
libinputactions/mousehandler: add property to disable unblocking butt…
taj-ny Apr 15, 2025
30cdbef
docs/example-gestures: update
taj-ny Apr 15, 2025
778d87e
libinputactions/input/backend: make it a singleton
taj-ny Apr 16, 2025
33a7a02
libinputactions: rename logging categories
taj-ny Apr 16, 2025
6960a4e
readme: update
taj-ny Apr 16, 2025
8219e87
flake: add gtest to dev shell
taj-ny Apr 16, 2025
bfffd2e
libinputactions: refactor window provider
taj-ny Apr 16, 2025
3a74b90
libinputactions: don't clear modifiers when not necessary, allow acti…
taj-ny Apr 26, 2025
595c0cc
libinputactions: refactor input
taj-ny Apr 30, 2025
1447947
tests: fix
taj-ny Apr 30, 2025
f50513e
docs/config: update
taj-ny Apr 30, 2025
47a6209
docs/config: remove unused 'Default' columns
taj-ny Apr 30, 2025
951a479
libinputactions/readme: update
taj-ny Apr 30, 2025
b972dcb
libinputactions: conditions v2, variables, gesture groups
taj-ny May 11, 2025
1b4b532
docs/config: fix typo
taj-ny May 11, 2025
28fcc5c
docs/config: pointer_shape -> cursor_shape
taj-ny May 11, 2025
2efa022
readme: update
taj-ny May 11, 2025
cbb2c64
libinputactions/triggerhandler: fix conflict resolution with >1 swipe…
taj-ny May 11, 2025
a5fd070
libinputactions/yaml: fix asSequence not working with empty sequences
taj-ny May 12, 2025
24038d4
libinputactions/mouse: stop motion timeout timer on button press
taj-ny May 12, 2025
2b27fb2
docs/config: add note to cursor_shape variable
taj-ny May 12, 2025
53cef32
libinputactions/yaml: allow StrokeGesture.strokes to not be a list
taj-ny May 13, 2025
5486b7f
libinputactions: allow variable expansion in command actions
taj-ny May 13, 2025
327f176
docs: move to separate repo
taj-ny May 13, 2025
be3f503
kwin/kcm: update
taj-ny May 13, 2025
4711cee
libinputactions: refactor variables (to make custom ones possible in …
taj-ny May 17, 2025
70ed8e5
libinputactions/expression: optimize slightly
taj-ny May 17, 2025
9082f75
change some stuff, fix tests
taj-ny May 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
run: pacman -Syu --noconfirm

- name: Install dependencies
run: pacman -S --needed --noconfirm base-devel git extra-cmake-modules qt6-tools kwin
run: pacman -S --needed --noconfirm base-devel git extra-cmake-modules qt6-tools kwin yaml-cpp gtest

- name: Check out repository
uses: actions/checkout@v4
Expand Down
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16.0)

project(kwin_gestures)
set(PROJECT_VERSION "0.5.1")
project(inputactions)
set(PROJECT_VERSION "0.6.0")

set(QT_MIN_VERSION "6.6.0")
set(QT_MAJOR_VERSION 6)
Expand All @@ -16,7 +16,7 @@ option(BUILD_TESTS "Build tests" OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose Release or Debug" FORCE)
endif()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DQT_NO_DEBUG_OUTPUT")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DQT_NO_DEBUG_OUTPUT")

find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
Expand All @@ -31,6 +31,8 @@ find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
DBus
)

add_compile_options(-Wno-unused-parameter) # This warning is stupid

add_subdirectory(src)
if (BUILD_TESTS)
add_subdirectory(tests)
Expand Down
62 changes: 34 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
# KWin Gestures
Custom touchpad gestures for Plasma 6.
# Input Actions
Input handler built on top of libinput and KWin, currently in a very early stage of development.

X11 is currently not supported.

https://github.com/user-attachments/assets/2c16790a-869b-44f3-a760-590137293759

[peterfajdiga/kwin4_effect_geometry_change](https://github.com/peterfajdiga/kwin4_effect_geometry_change) was used for tile animations.
Supported environments: Plasma 6 Wayland

# Features
- Gestures: hold, pinch, swipe
- Actions: run command, input (keyboard keys, mouse buttons, relative and absolute mouse movement, full control over when keys/buttons are pressed/released), invoke global shortcut
- Override/block built-in Plasma gestures
- Application-specific gestures
- Trigger actions before fingers are lifted for a more responsive feel
- Repeating actions with support for changing the direction mid-gesture
- Fast and slow gestures
- Stroke gesture: draw any shape
- Can specify multiple strokes per gesture
- Mouse gestures: press, stroke, swipe, wheel
- Horizontal scrolling wheels are supported
- Multiple mouse buttons can be specified (and all of them must be pressed in any order)
- Mouse buttons can still be used for normal clicks and dragging, depending on gestures
- Supports left, middle, right and 24 extra mouse buttons
- Touchpad gestures: pinch, press, rotate, stroke, swipe
- Supports 2-finger swipe and stroke gestures (requires edge scrolling to be disabled)
- Actions: run command, emit input, invoke Plasma global shortcut
- Executed at a specific point of the gesture's lifecycle (begin, update, end, cancel)
- Update actions can repeat at a specified interval
- Based on time for press gestures and distance for all other ones
- Bidirectional motion gestures can have actions with negative intervals
- Thresholds: actions and/or gestures will not trigger unless it is reached (based on time/distance just like intervals)
- Compatible with tools that operate at evdev level (Input Actions operates at compositor level, so it will process events after those tools)
- Selective input event blocking
- Blocks built-in Plasma gestures if a custom one is activated
- Powerful condition system with [many variables](https://github.com/InputActions/docs/blob/HEAD/variables.md) and [operators](https://github.com/InputActions/docs/blob/HEAD/configuration.md#operators)
- End conditions: determine whether a gesture is ended or cancelled
- [And more](https://github.com/InputActions/docs/blob/HEAD/configuration.md)

# Installation
<details>
Expand All @@ -27,8 +37,8 @@ https://github.com/user-attachments/assets/2c16790a-869b-44f3-a760-590137293759
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

kwin-gestures = {
url = "github:taj-ny/kwin-gestures";
inputactions = {
url = "github:taj-ny/InputActions";
inputs.nixpkgs.follows = "nixpkgs";
};
};
Expand All @@ -40,7 +50,7 @@ https://github.com/user-attachments/assets/2c16790a-869b-44f3-a760-590137293759

{
environment.systemPackages = [
inputs.kwin-gestures.packages.${pkgs.system}.default
inputs.inputactions.packages.${pkgs.system}.inputactions-kwin
];
}
```
Expand Down Expand Up @@ -93,8 +103,8 @@ https://github.com/user-attachments/assets/2c16790a-869b-44f3-a760-590137293759

### Building
```sh
git clone https://github.com/taj-ny/kwin-gestures
cd kwin-gestures
git clone https://github.com/taj-ny/InputActions
cd InputActions
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
Expand All @@ -109,15 +119,11 @@ Remove the *build* directory when rebuilding the effect.
> If the effect stops working after a system upgrade, you will need to rebuild it.

1. Install the plugin.
2. Open the Desktop Effects page in System Settings.
3. Enable the *Gestures* effect in the *Tools* category.

See [docs/configuration.md](docs/configuration.md) for instructions on how to configure this plugin.

# Gesture recognition issues
Before reporting any issues related to gesture recognition, run ``libinput debug-events`` as root and ensure the gesture is recognized properly. If it's not, there's nothing I can do.
2. Open the *Desktop Effects* page in *System Settings*.
3. Enable the *Input Actions* effect in the *Tools* category.

Depending on the touchpad, 3 or 4-finger pinch gestures may sometimes be incorrectly interpreted as swipe gestures due to the touchpad only being able to track 2 fingers. As a workaround, move only 2 fingers in opposite directions. See https://wayland.freedesktop.org/libinput/doc/1.25.0/gestures.html#gestures-on-two-finger-touchpads for more information.
[Documentation](https://github.com/InputActions/docs/blob/HEAD/index.md)

# Credits
- [KWin](https://invent.kde.org/plasma/kwin) - Gesture recognition code (parts of it), sending keystrokes
- [Strokognition](https://invent.kde.org/jpetso/strokognition), [wstroke](https://github.com/dkondor/wstroke), [easystroke](https://github.com/thjaeger/easystroke) - Stroke gestures
- [KWin](https://invent.kde.org/plasma/kwin) - Gesture handling code (heavily extended and modified)
Loading
Loading