From ce22b13a4dc435cdbe72304917b4d53932bcbdef Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 4 Feb 2013 19:03:52 +0100 Subject: Close key binding window when reassigning the same key This allows for canceling a key reassignment. We cannot use a static key here since every key could potentially be used in a binding. Instead, just cancel if we are trying to reassign a key that has already been used for that action before. Signed-off-by: Michael Smith Signed-off-by: Lukas Fleischer --- src/custom.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/custom.c b/src/custom.c index df7feef..d569f00 100644 --- a/src/custom.c +++ b/src/custom.c @@ -980,6 +980,12 @@ void custom_keys_config(void) } else not_recognized = 0; + /* Is the binding used by this action already? If so, just end the reassignment */ + if (selrow == keys_get_action(keyval)) { + delwin(grabwin); + break; + } + used = keys_assign_binding(keyval, selrow); if (used) { enum key action; -- cgit v1.2.3