javascript - How to implement keyboard function shortcut key on websites? -
i want use keyboard function key in website. how can implement keyboard function shortcut key on website. everyone.......
use javascript:
// event.type should keypress function getchar(event) { if (event.which == null) { // ie if (event.keycode < 32) return null; // special character return string.fromcharcode(event.keycode) } if (event.which != 0 && event.charcode != 0) { // not ie if (event.which < 32) return null; // special character return string.fromcharcode(event.which); // other } return null; // special character }
for control keys use: event.shiftkey, event.ctrlkey, event.altkey or event.metakey.
Comments
Post a Comment