From 2d618969e4c78c39700e6438a6cfcc777dcc4a87 Mon Sep 17 00:00:00 2001 From: William Boman Date: Fri, 19 Sep 2014 13:52:36 +0200 Subject: [PATCH] Added Unix-like chat clear keybindings. Now only clears the chat if the main input is focused. --- client/js/shout.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/js/shout.js b/client/js/shout.js index 8dc8eb3..0ad05c0 100644 --- a/client/js/shout.js +++ b/client/js/shout.js @@ -568,9 +568,14 @@ $(function() { }); Mousetrap.bind([ - "command+k" - ], function (e, keys) { - chat.find(".active .chat .messages").empty(); + "command+k", + "ctrl+l", + "ctrl+shift+l" + ], function (e) { + // Only clear the chat if the main input is focused. + if( e.target === input[0] ) { + chat.find(".active .chat .messages").empty(); + } }); function complete(word) {