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

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -