jQuery.ui.keyCode
Description: A mapping of key code descriptions to their numeric values.
-
jQuery.ui.keyCode
- BACKSPACEType: Integer
- COMMAType: Integer
- DELETEType: Integer
- DOWNType: Integer
- ENDType: Integer
- ENTERType: Integer
- ESCAPEType: Integer
- HOMEType: Integer
- LEFTType: Integer
- PAGE_DOWNType: Integer
- PAGE_UPType: Integer
- PERIODType: Integer
- RIGHTType: Integer
- SPACEType: Integer
- TABType: Integer
- UPType: Integer
-
Example:
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; } });