X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..c8256059947f3aa8f5b0a9a2acf55e2142bb4742:/docs/output/Ext.KeyMap.html diff --git a/docs/output/Ext.KeyMap.html b/docs/output/Ext.KeyMap.html index 37dc8cc8..b0edc7ab 100644 --- a/docs/output/Ext.KeyMap.html +++ b/docs/output/Ext.KeyMap.html @@ -1,83 +1,83 @@ -
Package: | Ext |
Defined In: | KeyMap.js |
Class: | KeyMap |
Extends: | Object |
// map one key by key code
-var map = new Ext.KeyMap("my-element", {
- key: 13, // or Ext.EventObject.ENTER
- fn: myHandler,
- scope: myObject
-});
-
-// map multiple keys to one action by string
-var map = new Ext.KeyMap("my-element", {
- key: "a\r\n\t",
- fn: myHandler,
- scope: myObject
-});
-
-// map multiple keys to multiple actions by strings and array of codes
-var map = new Ext.KeyMap("my-element", [
- {
- key: [10,13],
- fn: function(){ alert("Return was pressed"); }
- }, {
- key: "abc",
- fn: function(){ alert('a, b or c was pressed'); }
- }, {
- key: "\t",
- ctrl:true,
- shift:true,
- fn: function(){ alert('Control + shift + tab was pressed.'); }
- }
-]);
-Note: A KeyMap starts enabledProperty | Defined By | |
---|---|---|
stopEvent : Boolean True to stop the event from bubbling and prevent the default browser action if the
-key was handled by the KeyMap (de... True to stop the event from bubbling and prevent the default browser action if the
-key was handled by the KeyMap (defaults to false) | KeyMap |
Method | Defined By | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
KeyMap( Mixed el , Object config , [String eventName ] )
- Parameters:
| KeyMap | ||||||||||||||||||||||||||||||||||||||
addBinding( Object/Array config )
- :
- voidAdd a new binding to this KeyMap. The following config object properties are supported:
-
-Property Type ... Add a new binding to this KeyMap. The following config object properties are supported:
- -Property Type Description ----------- --------------- ---------------------------------------------------------------------- -key String/Array A single keycode or an array of keycodes to handle -shift Boolean True to handle key only when shift is pressed, False to handle the key only when shift is not pressed (defaults to undefined) -ctrl Boolean True to handle key only when ctrl is pressed, False to handle the key only when ctrl is not pressed (defaults to undefined) -alt Boolean True to handle key only when alt is pressed, False to handle the key only when alt is not pressed (defaults to undefined) -handler Function The function to call when KeyMap finds the expected key combination -fn Function Alias of handler (for backwards-compatibility) -scope Object The scope of the callback function -stopEvent Boolean True to stop the event from bubbling and prevent the default browser action if the key was handled by the KeyMap (defaults to false) --Usage: -
Parameters:
| KeyMap | ||||||||||||||||||||||||||||||||||||||
disable()
- :
- void Disable this KeyMap Disable this KeyMap Parameters:
| KeyMap | ||||||||||||||||||||||||||||||||||||||
enable()
- :
- void Enables this KeyMap Enables this KeyMap Parameters:
| KeyMap | ||||||||||||||||||||||||||||||||||||||
isEnabled()
- :
- Boolean Returns true if this KeyMap is enabled Returns true if this KeyMap is enabled Parameters:
| KeyMap | ||||||||||||||||||||||||||||||||||||||
on( Number/Array/Object key , Function fn , [Object scope ] )
- :
- voidShorthand for adding a single key listener Shorthand for adding a single key listener Parameters:
| KeyMap | ||||||||||||||||||||||||||||||||||||||
setDisabled( Boolean disabled )
- :
+Class Ext.KeyMap
Handles mapping keys to actions for an element. One key map can be used for multiple actions.
+The constructor accepts the same config object as defined by addBinding.
+If you bind a callback function to a KeyMap, anytime the KeyMap handles an expected key
+combination it will call the function with this signature (if the match is a multi-key
+combination the callback will still be called only once): (String key, Ext.EventObject e)
+A KeyMap can also handle a string representation of keys. +Usage: +
+Note: A KeyMap starts enabledPublic Properties
Public Methods
Public EventsThis class has no public events. |