Index | OAT homepage | OpenLink Software

keyboard.js

keyboard.js

Keyboard events and shortcut 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.obji 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.

OAT.Keyboard.disable(group)

Disables all shortcuts contained in group.

OAT.Keyboard.enable(group)

Enables all shortcuts contained in group.

Example


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