jQuery.ui.keyCode

A mapping of key code descriptions to their numeric values.
jQuery.ui.keyCode
BACKSPACE
COMMA
DELETE
DOWN
END
ENTER
ESCAPE
HOME
LEFT
PAGE_DOWN
PAGE_UP
PERIOD
RIGHT
SPACE
TAB
UP
Examples:

Test for arrow key presses.

$( document ).on( "keydown", function( event ) {
  switch( event.keyCode ) {
    case $.ui.keyCode.LEFT:
      console.log( "left" );
      break;
    case $.ui.keyCode.RIGHT:
      console.log( "right" );
      break;
    case $.ui.keyCode.UP:
      console.log( "up" );
      break;
    case $.ui.keyCode.DOWN:
      console.log( "down" );
      break;
  }
});
doc_jQuery
2016-03-28 14:47:53
Comments
Leave a Comment

Please login to continue.