Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- event.preventDefault()
- // defining flags
- var isCtrl = false;
- var isShift = false;
- $(document).ready(function () {
- // action on key up
- $(document).keyup(function (e) {
- if (e.which == 17) {
- isCtrl = false;
- }
- if (e.which == 16) {
- isShift = false;
- }
- });
- $(document).keydown(function (e) {
- if (e.which == 17) {
- isCtrl = true;
- }
- if (e.which == 16) {
- isShift = true;
- }
- if ((e.which == 110 || e.which == 78) && isCtrl) {
- e.preventDefault(true);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement