Skip to content

Commit

Permalink
Merge pull request #58 from mvorisek/fix_event_which
Browse files Browse the repository at this point in the history
Fix obsolete event.which for key testing
  • Loading branch information
stof authored Oct 17, 2022
2 parents af6107c + a3d32e6 commit f038a14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web-fixtures/js_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@
});

$('.elements input.input.second').keypress(function(ev) {
$('.text-event').text('key pressed:' + ev.which + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1);
$('.text-event').text('key pressed:' + (ev.keyCode || ev.charCode) + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1);
});

$('.elements input.input.third').keyup(function(ev) {
$('.text-event').text('key upped:' + ev.which + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1);
$('.text-event').text('key upped:' + (ev.keyCode || ev.charCode) + ' / ' + ev.altKey * 1 + ' / ' + ev.ctrlKey * 1 + ' / ' + ev.shiftKey * 1 + ' / ' + ev.metaKey * 1);
});

$( "#draggable" ).draggable();
Expand Down

0 comments on commit f038a14

Please sign in to comment.