Skip to content

Commit

Permalink
Handle Meta (command) key and bind Meta-P inside input elements, too
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwins committed Jul 16, 2012
1 parent 9ad1e35 commit 2ecaa8b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.php
Expand Up @@ -495,7 +495,8 @@ function printChargeRecord(id) {
$.isShifted= 0;

$(document).keydown(function(ev) {
if (ev.keyCode == 16 || ev.keyCode == 17 || ev.keyCode == 18) {
if (ev.keyCode == 16 || ev.keyCode == 17 || ev.keyCode == 18
|| ev.keyCode == 91) {
$.isShifted++;
return true;
}
Expand All @@ -510,7 +511,8 @@ function printChargeRecord(id) {
});

$(document).keyup(function(ev) {
if (ev.keyCode == 16 || ev.keyCode == 17 || ev.keyCode == 18) {
if (ev.keyCode == 16 || ev.keyCode == 17 || ev.keyCode == 18
|| ev.keyCode == 91) {
$.isShifted--;
}
return true;
Expand All @@ -519,6 +521,9 @@ function printChargeRecord(id) {
$(document).bind('keydown', 'meta+p', function(ev) {
return printReceipt();
});
$('input').bind('keydown', 'meta+p', function(ev) {
return printReceipt();
});

$(document).bind('keydown', 'meta+shift+backspace', function(ev) {
txn= $('#txn').data('txn');
Expand Down

0 comments on commit 2ecaa8b

Please sign in to comment.