From 331be2b5897de4bbe9cfbe97e084d568e65d8b81 Mon Sep 17 00:00:00 2001 From: lethosor Date: Mon, 30 Mar 2015 19:03:16 -0400 Subject: [PATCH] Make "keybinding list" accept a context See #588 --- library/Core.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Core.cpp b/library/Core.cpp index 02f1296b8..4606179d0 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -1978,13 +1978,16 @@ std::vector Core::ListKeyBindings(std::string keyspec) { int sym, mod; std::vector rv; - if (!parseKeySpec(keyspec, &sym, &mod)) + std::string focus; + if (!parseKeySpec(keyspec, &sym, &mod, &focus)) return rv; tthread::lock_guard lock(*HotkeyMutex); std::vector &bindings = key_bindings[sym]; for (int i = bindings.size()-1; i >= 0; --i) { + if (focus.size() && focus != bindings[i].focus) + continue; if (bindings[i].modifiers == mod) { std::string cmd = bindings[i].cmdline;