From d5f6fbd8534cdf5ee5c7bde16accdf0cd876179d Mon Sep 17 00:00:00 2001 From: Micah N Gorrell Date: Wed, 27 Mar 2024 16:27:59 -0600 Subject: [PATCH] Modified logic of press_repeat_release patch so that an unmodified keybinding with default values for the new flags will behave as it does in vanilla, while keybindings with customized flags will function as expected --- .../press_repeat_release.patch | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/press_repeat_release/press_repeat_release.patch b/press_repeat_release/press_repeat_release.patch index eef914c..b86666d 100644 --- a/press_repeat_release/press_repeat_release.patch +++ b/press_repeat_release/press_repeat_release.patch @@ -1,7 +1,7 @@ From aee1dc3e9ca4d8deec5432d0c64921af6e301ecd Mon Sep 17 00:00:00 2001 From: Micah N Gorrell Date: Wed, 27 Mar 2024 15:59:50 -0600 -Subject: [PATCH] onpress, onrepeat, onrelease +Subject: [PATCH 1/2] onpress, onrepeat, onrelease --- dwl.c | 18 ++++++++++++------ @@ -74,3 +74,35 @@ index 5867b0c..43bbf0c 100644 -- 2.44.0 + +From 1875bb171c9b0cd2fb03bb7e6c3fb400e33eeaf1 Mon Sep 17 00:00:00 2001 +From: Micah N Gorrell +Date: Wed, 27 Mar 2024 16:26:52 -0600 +Subject: [PATCH 2/2] Modified logic so that an unmodified keybinding with + default values for the new flags will behave as it does in vanilla, while + keybindings with customized flags will function as expected + +--- + dwl.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/dwl.c b/dwl.c +index 43bbf0c..55e7a40 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -1443,7 +1443,11 @@ keybinding(uint32_t mods, xkb_keysym_t sym, int on_press, int on_repeat, int on_ + for (k = keys; k < END(keys); k++) { + if (CLEANMASK(mods) == CLEANMASK(k->mod) + && sym == k->keysym && k->func) { +- if ((on_press && k->on_press) || (on_repeat && k->on_repeat) || (on_release && k->on_release)) { ++ if ((k->on_press == 0 && k->on_repeat == 0 && k->on_release == 0) || ++ (on_press && k->on_press) || ++ (on_repeat && k->on_repeat) || ++ (on_release && k->on_release) ++ ) { + k->func(&k->arg); + return 1; + } +-- +2.44.0 +