From a1303a881129f8e06604e57ff514d1316a92c95d Mon Sep 17 00:00:00 2001 From: bakkeby Date: Sat, 8 May 2021 16:57:59 +0200 Subject: [PATCH] Adding delkey patch ref. #21 --- README.md | 5 ++++- config.def.h | 8 ++++++++ patches.def.h | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b0b17c..6607130 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the ### Changelog: -2021-05-08 - Added blinking cursor, undercurl, desktopentry, netwmicon and osc_10_11_12_2 patches +2021-05-08 - Added blinking cursor, delkey, undercurl, desktopentry, netwmicon and osc_10_11_12_2 patches 2021-05-07 - Added xresources reload patch @@ -90,6 +90,9 @@ Refer to [https://st.suckless.org/](https://st.suckless.org/) for details on the - this patch allows you to select and copy the last URL displayed with Mod+l - multiple invocations cycle through the available URLs + - [delkey](https://st.suckless.org/patches/delkey/) + - return BS on pressing backspace and DEL on pressing the delete key + - [desktopentry](https://st.suckless.org/patches/desktopentry/) - adds a desktop entry for st so that it can be displayed with an icon when using a graphical launcher - this patch only applies to the Makefile and is enabled by default, remove if not needed diff --git a/config.def.h b/config.def.h index 41b2560..0834aef 100644 --- a/config.def.h +++ b/config.def.h @@ -455,7 +455,11 @@ static Key key[] = { { XK_KP_Delete, ControlMask, "\033[3;5~", +1, 0}, { XK_KP_Delete, ShiftMask, "\033[2K", -1, 0}, { XK_KP_Delete, ShiftMask, "\033[3;2~", +1, 0}, + #if DELKEY_PATCH + { XK_KP_Delete, XK_ANY_MOD, "\033[3~", -1, 0}, + #else { XK_KP_Delete, XK_ANY_MOD, "\033[P", -1, 0}, + #endif // DELKEY_PATCH { XK_KP_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, { XK_KP_Multiply, XK_ANY_MOD, "\033Oj", +2, 0}, { XK_KP_Add, XK_ANY_MOD, "\033Ok", +2, 0}, @@ -523,7 +527,11 @@ static Key key[] = { { XK_Delete, ControlMask, "\033[3;5~", +1, 0}, { XK_Delete, ShiftMask, "\033[2K", -1, 0}, { XK_Delete, ShiftMask, "\033[3;2~", +1, 0}, + #if DELKEY_PATCH + { XK_Delete, XK_ANY_MOD, "\033[3~", -1, 0}, + #else { XK_Delete, XK_ANY_MOD, "\033[P", -1, 0}, + #endif // DELKEY_PATCH { XK_Delete, XK_ANY_MOD, "\033[3~", +1, 0}, { XK_BackSpace, XK_NO_MOD, "\177", 0, 0}, { XK_BackSpace, Mod1Mask, "\033\177", 0, 0}, diff --git a/patches.def.h b/patches.def.h index c63d36a..de585b7 100644 --- a/patches.def.h +++ b/patches.def.h @@ -72,6 +72,11 @@ */ #define COPYURL_HIGHLIGHT_SELECTED_URLS_PATCH 0 +/* Return BS on pressing backspace and DEL on pressing the delete key. + * https://st.suckless.org/patches/delkey/ + */ +#define DELKEY_PATCH 0 + /* This patch adds the option of disabling bold fonts globally. * https://st.suckless.org/patches/disable_bold_italic_fonts/ */