make Alt C and Alt F9 and Escape work from anywhere

This commit is contained in:
John McLear 2015-03-31 13:45:11 +01:00
parent a82e692bdd
commit 35948989b3
3 changed files with 17 additions and 4 deletions

View file

@ -225,6 +225,16 @@ var chat = (function()
}
});
$('body:not(#chatinput)').on("keydown", function(evt){
if (evt.altKey && evt.which == 67){
// Alt c focuses on the Chat window
$(this).blur();
parent.parent.chat.show();
parent.parent.chat.focus();
evt.preventDefault();
}
});
$("#chatinput").keypress(function(evt){
//if the user typed enter, fire the send
if(evt.which == 13 || evt.which == 10)