commit 5693b4faabb9eef9b916df326405d9b025a2f4c8
parent ec16f059194411388da5c5046c9d20ee842ab909
Author: Bastien Dejean <nihilhill@gmail.com>
Date: Thu, 24 Dec 2015 11:50:51 +0100
Allow the replay and release prefix in combination
Diffstat:
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/doc/sxhkd.1 b/doc/sxhkd.1
@@ -2,12 +2,12 @@
.\" Title: sxhkd
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 07/16/2015
+.\" Date: 12/24/2015
.\" Manual: Sxhkd Manual
-.\" Source: Sxhkd 0.5.5
+.\" Source: Sxhkd 0.5.5-15-gec16f05
.\" Language: English
.\"
-.TH "SXHKD" "1" "07/16/2015" "Sxhkd 0\&.5\&.5" "Sxhkd Manual"
+.TH "SXHKD" "1" "12/24/2015" "Sxhkd 0\&.5\&.5\-15\-gec16f05" "Sxhkd Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -148,10 +148,10 @@ General syntax:
.\}
.nf
HOTKEY
- COMMAND
+ [;]COMMAND
HOTKEY := CHORD_1 ; CHORD_2 ; \&... ; CHORD_n
-CHORD_i := [MODIFIERS_i +] [@|;|~]KEYSYM_i
+CHORD_i := [MODIFIERS_i +] [~][@]KEYSYM_i
MODIFIERS_i := MODIFIER_i1 + MODIFIER_i2 + \&... + MODIFIER_ik
.fi
.if n \{\
diff --git a/doc/sxhkd.1.txt b/doc/sxhkd.1.txt
@@ -85,10 +85,10 @@ General syntax:
----
HOTKEY
- COMMAND
+ [;]COMMAND
HOTKEY := CHORD_1 ; CHORD_2 ; … ; CHORD_n
-CHORD_i := [MODIFIERS_i +] [@|;|~]KEYSYM_i
+CHORD_i := [MODIFIERS_i +] [~][@]KEYSYM_i
MODIFIERS_i := MODIFIER_i1 + MODIFIER_i2 + … + MODIFIER_ik
----
diff --git a/parse.c b/parse.c
@@ -2661,13 +2661,14 @@ bool parse_chain(char *string, chain_t *chain)
for (outer_advance = get_token(chord, ignored, string, LNK_SEP); chord[0] != '\0'; outer_advance = get_token(chord, ignored, outer_advance, LNK_SEP)) {
for (inner_advance = get_token(name, NULL, chord, SYM_SEP); name[0] != '\0'; inner_advance = get_token(name, NULL, inner_advance, SYM_SEP)) {
int offset = 0;
- if (name[0] == RELEASE_PREFIX) {
- event_type = XCB_KEY_RELEASE;
- offset++;
- } else if (name[0] == REPLAY_PREFIX) {
+ if (name[offset] == REPLAY_PREFIX) {
replay_event = true;
offset++;
}
+ if (name[offset] == RELEASE_PREFIX) {
+ event_type = XCB_KEY_RELEASE;
+ offset++;
+ }
char *nm = name + offset;
if (!parse_modifier(nm, &modfield) && !parse_keysym(nm, &keysym) && !parse_button(nm, &button)) {
warn("Unknown name: '%s'.\n", nm);