about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-08-23 09:28:56 -0400
committerJosh Rickmar <jrick@devio.us>2012-08-23 09:28:56 -0400
commit9ba0037babb7024626c43895eb216fda72485960 (patch)
tree7008ed2819eec5d5f555f36f2c82385cc87f47de
parent54dd137368f92cf303b1be02def5c53b23028217 (diff)
downloadxombrero-9ba0037babb7024626c43895eb216fda72485960.tar.gz
Add an unbind keybinding action, and document in the manpage.
Patch provided by Vadim Zhukov <persgray@gmail.com>, manpage bits by
me.
-rw-r--r--settings.c18
-rw-r--r--xombrero.16
2 files changed, 19 insertions, 5 deletions
diff --git a/settings.c b/settings.c
index e697e20..3140711 100644
--- a/settings.c
+++ b/settings.c
@@ -1587,13 +1587,13 @@ keybinding_clearall(void)
 }
 
 int
-keybinding_add(char *cmd, char *key, int use_in_entry)
+keybinding_set(char *cmd, char *key, int use_in_entry)
 {
 	struct key_binding	*k;
 	guint			keyval, mask = 0;
 	int			i;
 
-	DNPRINTF(XT_D_KEYBINDING, "keybinding_add: %s %s\n", cmd, key);
+	DNPRINTF(XT_D_KEYBINDING, "keybinding_set: %s %s\n", cmd, key);
 
 	/* Keys which are to be used in entry have been prefixed with an
 	 * exclamation mark. */
@@ -1641,6 +1641,14 @@ keybinding_add(char *cmd, char *key, int use_in_entry)
 			break;
 		}
 
+	if (strcmp(cmd, "unbind") == 0) {
+		DNPRINTF(XT_D_KEYBINDING, "keybinding_set: just unbinding: %s\n",
+		    gdk_keyval_name(keyval));
+		printf("keybinding_set: just unbinding: %s\n",
+		    gdk_keyval_name(keyval));
+		return (0);
+	}
+
 	/* add keyname */
 	k = g_malloc0(sizeof *k);
 	k->cmd = g_strdup(cmd);
@@ -1648,12 +1656,12 @@ keybinding_add(char *cmd, char *key, int use_in_entry)
 	k->use_in_entry = use_in_entry;
 	k->key = keyval;
 
-	DNPRINTF(XT_D_KEYBINDING, "keybinding_add: %s 0x%x %d 0x%x\n",
+	DNPRINTF(XT_D_KEYBINDING, "keybinding_set: %s 0x%x %d 0x%x\n",
 	    k->cmd,
 	    k->mask,
 	    k->use_in_entry,
 	    k->key);
-	DNPRINTF(XT_D_KEYBINDING, "keybinding_add: adding: %s %s\n",
+	DNPRINTF(XT_D_KEYBINDING, "keybinding_set: adding: %s %s\n",
 	    k->cmd, gdk_keyval_name(keyval));
 
 	TAILQ_INSERT_HEAD(&kbl, k, entry);
@@ -1724,7 +1732,7 @@ add_kb(struct settings *s, char *entry)
 	*kb = '\0';
 	key = kb + 1;
 
-	return (keybinding_add(entry, key, key[0] == '!'));
+	return (keybinding_set(entry, key, key[0] == '!'));
 }
 
 int
diff --git a/xombrero.1 b/xombrero.1
index c47e4fe..6abc90e 100644
--- a/xombrero.1
+++ b/xombrero.1
@@ -144,6 +144,12 @@ is the action and
 are
 the keystrokes.
 .Pp
+Actions may be any xombrero command that can be run from the command
+prompt.
+There is one additional action,
+.Cm unbind ,
+which will unbind any previous actions to that keybinding.
+.Pp
 If the action begins with a colon, the action will be entered into the
 command prompt instead of being executed.
 For example, "keybinding = :session open ,M1-s" will open the command