• Topic
  • Discussion
  • OATWikiWeb.OATDOCkeyboard(Last) -- Owiki? , 2016-08-19 14:58:51 Edit owiki 2016-08-19 14:58:51

    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);
    

    Referenced by...