keyboard.js

Keyboard handling.


Functions


OAT.Keyboard.add(key, downCallback, upCallback, group, id, obj)

Listens for pressing a given key. downCallback and upCallback are executed during onkeydown and onkeyup events. obj is the element which should handle these events; defaults to document. group is a arbitrary string - one can then enable/disable groups of keyboard shortcuts. id is not used yet.

var key = "ctrl-alt-7";
var callback = function() { alert('Pressed!'); }
OAT.Keyboard.add(key, callback, false, "mygroup", false, false);

OAT.Keyboard.disable(group)

Disables all shortcuts, containing into group.

OAT.Keyboard.enable(group)

Enables all shortcuts, containing into group.