[wiki] [sites] [slock] Introducing terminalkeys patch || Matthias Schoth

From: <git_AT_suckless.org>
Date: Sat, 18 Jun 2016 15:36:51 +0200

commit 5312b38240198152f2697cbda2fddff41bd1c0a4
Author: Matthias Schoth <mschoth_AT_gmail.com>
Date: Sat Jun 18 15:35:56 2016 +0200

    [slock] Introducing terminalkeys patch

diff --git a/tools.suckless.org/slock/patches/slock-20160618-terminalkeys.diff b/tools.suckless.org/slock/patches/slock-20160618-terminalkeys.diff
new file mode 100644
index 0000000..afcb874
--- /dev/null
+++ b/tools.suckless.org/slock/patches/slock-20160618-terminalkeys.diff
_AT_@ -0,0 +1,27 @@
+diff --git a/slock.c b/slock.c
+index c9cdee2..03e191d 100644
+--- a/slock.c
++++ b/slock.c
+_AT_@ -149,6 +149,22 @@ readpw(Display *dpy, const char *pws)
+ IsPFKey(ksym) ||
+ IsPrivateKeypadKey(ksym))
+ continue;
++ if (ev.xkey.state & ControlMask) {
++ switch (ksym) {
++ case XK_u:
++ ksym = XK_Escape;
++ break;
++ case XK_m:
++ ksym = XK_Return;
++ break;
++ case XK_j:
++ ksym = XK_Return;
++ break;
++ case XK_h:
++ ksym = XK_BackSpace;
++ break;
++ }
++ }
+ switch (ksym) {
+ case XK_Return:
+ passwd[len] = 0;
diff --git a/tools.suckless.org/slock/patches/terminalkeys.md b/tools.suckless.org/slock/patches/terminalkeys.md
new file mode 100644
index 0000000..0338af3
--- /dev/null
+++ b/tools.suckless.org/slock/patches/terminalkeys.md
_AT_@ -0,0 +1,24 @@
+terminalkeys
+============
+
+Description
+-----------
+
+Use key commands that are commonly used in terminal applications
+(e.g. bash, login) in slock.
+
+Mappings:
+* Ctrl-u: delete until beginning of line, mapped to `Esc`
+* Ctrl-h: Backspace, mapped to `Backspace`
+* Ctrl-j or Ctrl-m: Newline / Carriage return, mapped to `Return`
+
+Download
+--------
+
+ * [slock-20160618-terminalkeys.diff](slock-20160618-terminalkeys.diff)
+
+Authors
+-------
+
+ * Matthias Schoth - mschoth_AT_gmail.com
+
Received on Sat Jun 18 2016 - 15:36:51 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 18 2016 - 15:48:15 CEST