mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-09-09 12:45:00 +00:00
update keycodes patch
0498877c
This commit is contained in:
parent
bec2575e44
commit
0e2955ea97
@ -3,7 +3,7 @@ Use keycodes instead of keysyms. This way, input is independent from keyboard la
|
||||
|
||||
### Download
|
||||
- [git branch](https://codeberg.org/sevz/dwl/src/branch/keycodes)
|
||||
- [2023-11-25](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/keycodes/keycodes.patch)
|
||||
- [2024-06-07](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/keycodes/keycodes.patch)
|
||||
|
||||
### Config after patching
|
||||
(run in DWL source directory)
|
||||
@ -11,7 +11,6 @@ Use keycodes instead of keysyms. This way, input is independent from keyboard la
|
||||
export XKB_DEFAULT_VARIANT=yourbestkeyboardlayout
|
||||
cc -lxkbcommon -o generate-keys generate-keys.c
|
||||
./generate-keys
|
||||
sudo make install
|
||||
```
|
||||
|
||||
### Authors
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 8e58ce22afe6a7cca34ff69d8862c89497156f40 Mon Sep 17 00:00:00 2001
|
||||
From bf026b489f4de99030b424226a6b5877fcbc26ea Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
||||
<leohdz172@proton.me>
|
||||
Date: Fri, 4 Jun 2021 16:51:01 -0500
|
||||
@ -16,10 +16,10 @@ Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
||||
create mode 100644 keys.h
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index a8ed61d..40e13af 100644
|
||||
index a784eb4f..8af07495 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -104,11 +104,11 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
||||
@@ -106,11 +106,11 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
||||
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
|
||||
#define MODKEY WLR_MODIFIER_ALT
|
||||
|
||||
@ -34,9 +34,9 @@ index a8ed61d..40e13af 100644
|
||||
|
||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
@@ -117,51 +117,52 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
||||
@@ -119,51 +119,52 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
|
||||
static const char *termcmd[] = { "foot", NULL };
|
||||
static const char *menucmd[] = { "bemenu-run", NULL };
|
||||
static const char *menucmd[] = { "wmenu-run", NULL };
|
||||
|
||||
+#include "keys.h"
|
||||
static const Key keys[] = {
|
||||
@ -48,8 +48,8 @@ index a8ed61d..40e13af 100644
|
||||
- { MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||
- { MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||
- { MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
|
||||
- { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05} },
|
||||
- { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05} },
|
||||
- { MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
|
||||
- { MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
||||
- { MODKEY, XKB_KEY_Return, zoom, {0} },
|
||||
- { MODKEY, XKB_KEY_Tab, view, {0} },
|
||||
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
|
||||
@ -82,8 +82,8 @@ index a8ed61d..40e13af 100644
|
||||
+ { MODKEY, Key_k, focusstack, {.i = -1} },
|
||||
+ { MODKEY, Key_i, incnmaster, {.i = +1} },
|
||||
+ { MODKEY, Key_d, incnmaster, {.i = -1} },
|
||||
+ { MODKEY, Key_h, setmfact, {.f = -0.05} },
|
||||
+ { MODKEY, Key_l, setmfact, {.f = +0.05} },
|
||||
+ { MODKEY, Key_h, setmfact, {.f = -0.05f} },
|
||||
+ { MODKEY, Key_l, setmfact, {.f = +0.05f} },
|
||||
+ { MODKEY, Key_Return, zoom, {0} },
|
||||
+ { MODKEY, Key_Tab, view, {0} },
|
||||
+ { MODKEY|WLR_MODIFIER_SHIFT, Key_c, killclient, {0} },
|
||||
@ -127,10 +127,10 @@ index a8ed61d..40e13af 100644
|
||||
|
||||
static const Button buttons[] = {
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 10d5a5b..33fb251 100644
|
||||
index 6f041a0d..ba743c6d 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -138,7 +138,7 @@ typedef struct {
|
||||
@@ -143,7 +143,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
uint32_t mod;
|
||||
@ -139,7 +139,7 @@ index 10d5a5b..33fb251 100644
|
||||
void (*func)(const Arg *);
|
||||
const Arg arg;
|
||||
} Key;
|
||||
@@ -147,9 +147,8 @@ typedef struct {
|
||||
@@ -152,9 +152,8 @@ typedef struct {
|
||||
struct wl_list link;
|
||||
struct wlr_keyboard_group *wlr_group;
|
||||
|
||||
@ -151,7 +151,7 @@ index 10d5a5b..33fb251 100644
|
||||
struct wl_event_source *key_repeat_source;
|
||||
|
||||
struct wl_listener modifiers;
|
||||
@@ -272,7 +271,7 @@ static void fullscreennotify(struct wl_listener *listener, void *data);
|
||||
@@ -289,7 +288,7 @@ static void fullscreennotify(struct wl_listener *listener, void *data);
|
||||
static void handlesig(int signo);
|
||||
static void incnmaster(const Arg *arg);
|
||||
static void inputdevice(struct wl_listener *listener, void *data);
|
||||
@ -160,7 +160,7 @@ index 10d5a5b..33fb251 100644
|
||||
static void keypress(struct wl_listener *listener, void *data);
|
||||
static void keypressmod(struct wl_listener *listener, void *data);
|
||||
static int keyrepeat(void *data);
|
||||
@@ -1351,7 +1350,7 @@ inputdevice(struct wl_listener *listener, void *data)
|
||||
@@ -1491,7 +1490,7 @@ inputdevice(struct wl_listener *listener, void *data)
|
||||
}
|
||||
|
||||
int
|
||||
@ -169,7 +169,7 @@ index 10d5a5b..33fb251 100644
|
||||
{
|
||||
/*
|
||||
* Here we handle compositor keybindings. This is when the compositor is
|
||||
@@ -1361,7 +1360,7 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||
@@ -1501,7 +1500,7 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||
const Key *k;
|
||||
for (k = keys; k < END(keys); k++) {
|
||||
if (CLEANMASK(mods) == CLEANMASK(k->mod)
|
||||
@ -178,7 +178,7 @@ index 10d5a5b..33fb251 100644
|
||||
k->func(&k->arg);
|
||||
return 1;
|
||||
}
|
||||
@@ -1372,17 +1371,12 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||
@@ -1512,17 +1511,12 @@ keybinding(uint32_t mods, xkb_keysym_t sym)
|
||||
void
|
||||
keypress(struct wl_listener *listener, void *data)
|
||||
{
|
||||
@ -196,7 +196,7 @@ index 10d5a5b..33fb251 100644
|
||||
|
||||
int handled = 0;
|
||||
uint32_t mods = wlr_keyboard_get_modifiers(&group->wlr_group->keyboard);
|
||||
@@ -1391,19 +1385,16 @@ keypress(struct wl_listener *listener, void *data)
|
||||
@@ -1531,19 +1525,16 @@ keypress(struct wl_listener *listener, void *data)
|
||||
|
||||
/* On _press_ if there is no active screen locker,
|
||||
* attempt to process a compositor keybinding. */
|
||||
@ -220,7 +220,7 @@ index 10d5a5b..33fb251 100644
|
||||
wl_event_source_timer_update(group->key_repeat_source, 0);
|
||||
}
|
||||
|
||||
@@ -1433,15 +1424,13 @@ int
|
||||
@@ -1573,15 +1564,13 @@ int
|
||||
keyrepeat(void *data)
|
||||
{
|
||||
KeyboardGroup *group = data;
|
||||
@ -240,7 +240,7 @@ index 10d5a5b..33fb251 100644
|
||||
}
|
||||
diff --git a/keys.h b/keys.h
|
||||
new file mode 100644
|
||||
index 0000000..e732f80
|
||||
index 00000000..e732f806
|
||||
--- /dev/null
|
||||
+++ b/keys.h
|
||||
@@ -0,0 +1,242 @@
|
||||
@ -487,10 +487,10 @@ index 0000000..e732f80
|
||||
+#define Key_XF86WWAN 254
|
||||
+#define Key_XF86RFKill 255
|
||||
--
|
||||
2.43.0
|
||||
2.45.2
|
||||
|
||||
|
||||
From 9d24eaa9b2bd2c87c975882cd0b2adba978db564 Mon Sep 17 00:00:00 2001
|
||||
From 0498877c2bc6fd08b15fcefb9599e27728617e7b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
|
||||
<leohdz172@proton.me>
|
||||
Date: Sun, 19 Mar 2023 15:50:07 -0600
|
||||
@ -507,7 +507,7 @@ Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
|
||||
|
||||
diff --git a/generate-keys.c b/generate-keys.c
|
||||
new file mode 100644
|
||||
index 0000000..83458fb
|
||||
index 00000000..83458fb7
|
||||
--- /dev/null
|
||||
+++ b/generate-keys.c
|
||||
@@ -0,0 +1,82 @@
|
||||
@ -594,5 +594,5 @@ index 0000000..83458fb
|
||||
+ xkb_context_unref(context);
|
||||
+}
|
||||
--
|
||||
2.43.0
|
||||
2.45.2
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user