Tuesday, November 3, 2015

Disable Shift key combination OnKeyPress

                  var isShift;
                  if (window.event) {
                      key = window.event.keyCode;
                      isShift = !!window.event.shiftKey; // typecast to boolean
                  }
                  else {
                      key = e.which;
                      isShift = !!e.shiftKey;
                  }
                  if (isShift) {
                      switch (key) {
                          case 16:
                          // ignore shift key
                              break;
                          default:
                           //do whatever you want
                              break;
                      }
                  }

No comments:

Post a Comment