diff --git a/patches/tablet-input/README.md b/patches/tablet-input/README.md index b57ca29..29cdc98 100644 --- a/patches/tablet-input/README.md +++ b/patches/tablet-input/README.md @@ -1,14 +1,15 @@ ### Description -implements wlr-tablet-v2 for drawing tablets and supports cursor emulation -inspired by @guyuming76's [branch](https://codeberg.org/guyuming76/dwl/commits/branch/graphic_tablet), with coding help from @Palanix and testing by @Thanatos +Implements wlr-tablet-v2 for drawing tablets with cursor emulation. +Inspired by @guyuming76's [branch](https://codeberg.org/guyuming76/dwl/commits/branch/graphic_tablet), with coding help from @Palanix and testing by @Thanatos. -extended with: -- specify the active drawing zone on the physical tablet -- pad and tool button bindings to compositor actions +- **Tablet area**: define the active drawing zone using the `tablet_pad` array +`{x, y, width, height}`, values range from 0.0 to 1.0 (as a fraction of the +tablet's full surface). Only input within this area is mapped to the screen. +- **Button bindings**: bind tablet pad and stylus buttons to compositor actions. ### Download - [git branch](https://codeberg.org/pi66/dwl/src/branch/tablet-input) -- [tablet-input-main-a2d03cf618.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/tablet-input/tablet-input-main-a2d03cf618.patch) +- [tablet-input-main-a2d03cf.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/tablet-input/tablet-input-main-a2d03cf.patch) - [tablet-input-0.8.patch](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/tablet-input/tablet-input-0.8.patch) ### Authors diff --git a/patches/tablet-input/tablet-input-0.8.patch b/patches/tablet-input/tablet-input-0.8.patch index 9af55c2..d014a21 100644 --- a/patches/tablet-input/tablet-input-0.8.patch +++ b/patches/tablet-input/tablet-input-0.8.patch @@ -1,6 +1,6 @@ -From 27a9f5b7a0446f212785e7e8d6413f2a8e6af1ff Mon Sep 17 00:00:00 2001 +From a14dff19f38fffa498f3de4679952b39b4323502 Mon Sep 17 00:00:00 2001 From: pi66 -Date: Sat, 4 Apr 2026 01:38:16 +0100 +Date: Wed, 8 Apr 2026 21:47:41 +0100 Subject: [PATCH] feat: add pad/tool bindings and pen region --- @@ -34,7 +34,7 @@ index 578194f..e0d1835 100644 config.h: cp config.def.h $@ diff --git a/config.def.h b/config.def.h -index 8a6eda0..1286eeb 100644 +index 8a6eda0..288494e 100644 --- a/config.def.h +++ b/config.def.h @@ -4,6 +4,7 @@ @@ -68,10 +68,10 @@ index 8a6eda0..1286eeb 100644 + +static const TabletPadButton tabletpadbuttons[] = { + /* button state function argument */ -+// { 0, WLR_BUTTON_PRESSED, spawn, {.v = termcmd} }, -+// { 1, WLR_BUTTON_PRESSED, killclient, {0} }, -+// { 2, WLR_BUTTON_PRESSED, togglefloating, {0} }, -+// { 3, WLR_BUTTON_PRESSED, zoom, {0} }, ++/* { 0, WLR_BUTTON_PRESSED, spawn, {.v = termcmd} }, */ ++/* { 1, WLR_BUTTON_PRESSED, killclient, {0} },*/ ++/* { 2, WLR_BUTTON_PRESSED, togglefloating, {0} },*/ ++/* { 3, WLR_BUTTON_PRESSED, zoom, {0} },*/ + { 0, 0, NULL, {0} } +}; diff --git a/dwl.c b/dwl.c diff --git a/patches/tablet-input/tablet-input-main-a2d03cf618.patch b/patches/tablet-input/tablet-input-main-a2d03cf.patch similarity index 97% rename from patches/tablet-input/tablet-input-main-a2d03cf618.patch rename to patches/tablet-input/tablet-input-main-a2d03cf.patch index 9af55c2..d014a21 100644 --- a/patches/tablet-input/tablet-input-main-a2d03cf618.patch +++ b/patches/tablet-input/tablet-input-main-a2d03cf.patch @@ -1,6 +1,6 @@ -From 27a9f5b7a0446f212785e7e8d6413f2a8e6af1ff Mon Sep 17 00:00:00 2001 +From a14dff19f38fffa498f3de4679952b39b4323502 Mon Sep 17 00:00:00 2001 From: pi66 -Date: Sat, 4 Apr 2026 01:38:16 +0100 +Date: Wed, 8 Apr 2026 21:47:41 +0100 Subject: [PATCH] feat: add pad/tool bindings and pen region --- @@ -34,7 +34,7 @@ index 578194f..e0d1835 100644 config.h: cp config.def.h $@ diff --git a/config.def.h b/config.def.h -index 8a6eda0..1286eeb 100644 +index 8a6eda0..288494e 100644 --- a/config.def.h +++ b/config.def.h @@ -4,6 +4,7 @@ @@ -68,10 +68,10 @@ index 8a6eda0..1286eeb 100644 + +static const TabletPadButton tabletpadbuttons[] = { + /* button state function argument */ -+// { 0, WLR_BUTTON_PRESSED, spawn, {.v = termcmd} }, -+// { 1, WLR_BUTTON_PRESSED, killclient, {0} }, -+// { 2, WLR_BUTTON_PRESSED, togglefloating, {0} }, -+// { 3, WLR_BUTTON_PRESSED, zoom, {0} }, ++/* { 0, WLR_BUTTON_PRESSED, spawn, {.v = termcmd} }, */ ++/* { 1, WLR_BUTTON_PRESSED, killclient, {0} },*/ ++/* { 2, WLR_BUTTON_PRESSED, togglefloating, {0} },*/ ++/* { 3, WLR_BUTTON_PRESSED, zoom, {0} },*/ + { 0, 0, NULL, {0} } +}; diff --git a/dwl.c b/dwl.c