class type t =Inheritsobject
..end
method addBinding : 'a. 'a Js.t -> unit Js.meth
Add a new binding to this KeyMap.
Usage:
// Create a KeyMap
var map = new Ext.util.KeyMap(document, {
key: Ext.EventObject.ENTER,
fn: handleKey,
scope: this
});
//Add a new binding to the existing KeyMap later
map.addBinding({
key: 'abc',
shift: true,
fn: handleKey,
scope: this
});
Parameters:
_ Js.t
A single KeyMap config or an array of configs. The following config object properties are supported:
method destroy : bool Js.t -> unit Js.meth
Destroys the KeyMap instance and removes all handlers.
Parameters:
bool Js.t
True to also remove the target
method disable : unit Js.meth
Disable this KeyMap
method enable : unit Js.meth
Enables this KeyMap
method isEnabled : bool Js.t Js.meth
Returns true if this KeyMap is enabled
method on : 'b 'c 'd. 'b Js.t -> 'c Js.callback -> 'd Js.t Js.optdef -> unit Js.meth
Shorthand for adding a single key listener.
Parameters:
_ Js.t
Either the numeric key code, array of key codes or an object with the
following options: {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
_ Js.callback
The function to call
_ Js.t
(optional)
The scope (this
reference) in which the function is executed.
Defaults to the browser window.
method removeBinding : 'e. 'e Js.t -> unit Js.meth
method setDisabled : bool Js.t -> unit Js.meth
Convenience function for setting disabled/enabled by boolean.
Parameters:
bool Js.t
method un : 'f 'g 'h. 'f Js.t -> 'g Js.callback -> 'h Js.t Js.optdef -> unit Js.meth
Shorthand for removing a single key listener.
Parameters:
_ Js.t
Either the numeric key code, array of key codes or an object with the
following options: {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
_ Js.callback
The function to call
_ Js.t
(optional)
The scope (this
reference) in which the function is executed.
Defaults to the browser window.