Skip to content

Javascript Prototype based keypress observer monitors a document's keypresses and if they match the specified combo it calls the callback.

Notifications You must be signed in to change notification settings

robhurring/prototype-keypress_observer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

About

Keypress observer monitors a document’s keypress event issues a callback if it matches our specified key combo. It supports multiple modifier keys and can be set to specific key combinations in a more human-readable format.

Author

Rob Hurring <rob@zerobased.com>

Homepage

github.com/robhurring

Date

1/27/09

Options

Keypress.observe accepts:

shift

we want the SHIFT key down

alt

we want the ALT key down

control

we want the CTRL key down

meta

we want the META key down

Usage

// monitor ctrl-shift-G new Keypress.observe(Ansi.G, function(e) { alert(‘Do something’); },{shift:true, control:true});

// monitor ctrl-meta-shift-P new Keypress.observe(Ansi.P, function(e) { print_document(); }, {control:true, meta:true, shift:true});

Dependencies

written against Prototype 1.6.0.1

About

Javascript Prototype based keypress observer monitors a document's keypresses and if they match the specified combo it calls the callback.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages