goog.Disposable | |
goog.events.EventTarget | goog.Disposable |
goog.ui.KeyboardShortcutHandler | goog.events.EventTarget |
keyTarget
: goog.events.EventTarget | EventTarget
Event target that the
key event listener is attached to, typically the applications root
container.
|
Checks if a particular keyboard shortcut is registered.
|
code » | |||
![]()
Removes the listener that was added by link
#initializeKeyListener .
|
code » | |||
![]()
No description.
|
code » | |||
Returns whether all shortcuts (including modifier shortcuts) are treated as
if the keys had been passed to the setGlobalKeys function.
Returns: boolean
Whether all shortcuts are treated as globals.
|
code » | |||
Returns whether the default action will always be prevented when a shortcut
event is fired. The default value is true.
Returns: boolean
Whether preventDefault will always be called.
|
code » | |||
Returns whether the event will always be stopped from propagating beyond its
target when a shortcut event is fired. The default value is false.
Returns: boolean
Whether stopPropagation will always be called.
|
code » | |||
Returns event type for a specific shortcut.
|
code » | |||
No description.
|
code » | |||
Returns whether shortcuts with modifiers are treated as if the keys had been
passed to the setGlobalKeys function. Ignored if you have called
setAllShortcutsAreGlobal(true). Applies only to form elements (not
content-editable).
Returns: boolean
Whether shortcuts with modifiers are treated as globals.
|
code » | |||
Returns shortcut for a specific set of strokes.
|
code » | |||
![]()
Handler for when a keyup event is fired in Firefox (Gecko).
Arguments:
|
code » | |||
![]()
Keypress handler.
Arguments:
|
code » | |||
![]()
Handler for when a keypress event is fired on Windows.
Arguments:
|
code » | |||
![]()
Handler for when a keyup event is fired on Windows.
Arguments:
|
code » | |||
![]()
Adds a key event listener that triggers
#handleKeyDown_ when keys
are pressed.
Arguments:
|
code » | |||
Parses the variable arguments for registerShortcut and unregisterShortcut.
|
code » | |||
Returns whether this event is possibly used for typing a printable character.
Windows uses ctrl+alt (a.k.a. alt-graph) keys for typing characters on
European keyboards. Since only Firefox provides a method that can identify
whether ctrl+alt keys are used for typing characters, we need to check
whether Windows sends a keypress event to prevent firing shortcut event if
this event is used for typing characters.
Arguments:
Returns: boolean
Whether this event is a possible printable-key event.
|
code » | |||
Verifies if a particular keyboard shortcut is registered already. It has
the same interface as the unregistering of shortcuts.
param {number} keyCode Numeric code for key
param {number=} opt_modifiers Bitmap indicating required modifier keys.
goog.ui.KeyboardShortcutHandler.Modifiers.SHIFT, CONTROL,
ALT, or META.
The two parameters can be repeated any number of times to create a shortcut
using a sequence of strokes.
A string representation of the shortcut can be supplied instead see
#registerShortcut for syntax. In that case the method only takes one
argument.
|
code » | |||
Checks if a given keypress event may be treated as a shortcut.
Arguments:
Returns: boolean
Whether to attempt to process the event as a shortcut.
|
code » | |||
![]()
Registers a keyboard shortcut.
Arguments:
|
code » | |||
![]()
Sets whether to treat all shortcuts (including modifier shortcuts) as if the
keys had been passed to the setGlobalKeys function.
Arguments:
|
code » | |||
![]()
Sets whether to treat space key as a shortcut when the focused element is a
checkbox, radiobutton or button.
Arguments:
|
code » | |||
![]()
Sets whether to always prevent the default action when a shortcut event is
fired. If false, the default action is prevented only if preventDefault is
called on either of the corresponding SHORTCUT_TRIGGERED or SHORTCUT_PREFIX
events. If true, the default action is prevented whenever a shortcut event
is fired. The default value is true.
Arguments:
|
code » | |||
![]()
Sets whether to always stop propagation for the event when fired. If false,
the propagation is stopped only if stopPropagation is called on either of the
corresponding SHORT_CUT_TRIGGERED or SHORTCUT_PREFIX events. If true, the
event is prevented from propagating beyond its target whenever it is fired.
The default value is false.
Arguments:
|
code » | |||
![]()
Sets the global keys; keys that are safe to always regarded as shortcuts,
even if entered in a textarea or input field.
|
code » | |||
![]()
Sets whether to treat shortcuts with modifiers as if the keys had been
passed to the setGlobalKeys function. Ignored if you have called
setAllShortcutsAreGlobal(true). Applies only to form elements (not
content-editable).
Arguments:
|
code » | |||
![]()
Unregisters all keyboard shortcuts.
|
code » | |||
![]()
Unregisters a keyboard shortcut by keyCode and modifiers or string
representation of sequence.
param {number} keyCode Numeric code for key
param {number=} opt_modifiers Bitmap indicating required modifier keys.
goog.ui.KeyboardShortcutHandler.Modifiers.SHIFT, CONTROL,
ALT, or META.
The two parameters can be repeated any number of times to create a shortcut
using a sequence of strokes.
A string representation of the shortcut can be supplied instead see
#registerShortcut for syntax. In that case the method only takes one
argument.
|
code » |
![]()
Use
#listen instead, when possible. Otherwise, use
goog.events.listen if you are passing Object
(instead of Function) as handler.
Adds an event listener to the event target. The same handler can only be
added once per the type. Even if you add the same handler multiple times
using the same type then it will only be called once when the event is
dispatched.
Arguments:
|
code » | |||||
![]()
Asserts that the event target instance is initialized properly.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
Removes listeners from this object. Classes that extend EventTarget may
need to override this method in order to remove references to DOM Elements
and additional listeners.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
Returns the parent of this event target to use for bubbling.
Returns: goog.events.EventTarget
The parent EventTarget or null if
there is no parent.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
Use
#unlisten instead, when possible. Otherwise, use
goog.events.unlisten if you are passing Object
(instead of Function) as handler.
Removes an event listener from the event target. The handler must be the
same object as the one added. If the handler has not been added then
nothing is done.
Arguments:
|
code » | |||||
![]()
Sets the parent of this event target to use for capture/bubble
mechanism.
Arguments:
|
code » | |||||
![]()
Sets the target to be used for
event.target when firing
event. Mainly used for testing. For example, see
goog.testing.events.mixinListenable .
Arguments:
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » |
![]()
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
![]()
Disposes of the object. If the object hasn't already been disposed of, calls
#disposeInternal . Classes that extend goog.Disposable should
override #disposeInternal in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void
Nothing.
|
code » | |||
![]()
Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend
goog.Disposable should
override this method.
Not reentrant. To avoid calling it twice, it must only be called from the
subclass' disposeInternal method. Everywhere else the public
dispose method must be used.
For example:
mypackage.MyClass = function() { mypackage.MyClass.base(this, 'constructor'); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { // Dispose logic specific to MyClass. ... // Call superclass's disposeInternal at the end of the subclass's, like // in C++, to avoid hard-to-catch issues. mypackage.MyClass.base(this, 'disposeInternal'); }; |
code » | |||
Use
#isDisposed instead.
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
![]()
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
![]()
Tracks the currently pressed shortcut key, for Firefox.
|
Code » | |
![]()
Whether to treat all shortcuts as if they had been passed
to setGlobalKeys().
|
Code » | |
![]()
Whether to treat space key as a shortcut when the focused element is a
checkbox, radiobutton or button.
|
Code » | |
![]()
Whether to always prevent the default action if a shortcut event is fired.
|
Code » | |
![]()
Whether to always stop propagation if a shortcut event is fired.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
List of numeric key codes for keys that are safe to always regarded as
shortcuts, even if entered in a textarea or input field.
|
Code » | |
![]()
Whether a key event is a printable-key event. Windows uses ctrl+alt
(alt-graph) keys to type characters on European keyboards. For such keys, we
cannot identify whether these keys are used for typing characters when
receiving keydown events. Therefore, we set this flag when we receive their
respective keypress events and fire shortcut events only when we do not
receive them.
|
Code » | |
Target on which to listen for key events.
|
Code » | |
![]()
List of the last sequence of strokes. Object contains time last key was
pressed and an array of strokes, represented by numeric value.
|
Code » | |
![]()
Due to a bug in the way that Gecko on Mac handles cut/copy/paste key events
using the meta key, it is necessary to fake the keyDown for the action key
(C,V,X) by capturing it on keyUp.
Because users will often release the meta key a slight moment before they
release the action key, we need this variable that will store whether the
meta key has been released recently.
It will be cleared after a short delay in the key handling logic.
|
Code » | |
![]()
Whether to treat shortcuts with modifiers as if they had been passed
to setGlobalKeys(). Ignored if allShortcutsAreGlobal_ is true. Applies
only to form elements (not content-editable).
|
Code » | |
![]()
Registered keyboard shortcuts tree. Stored as a map with the keyCode and
modifier(s) as the key and either a list of further strokes or the shortcut
task identifier as the value.
|
Code » | |
![]()
List of input types that should only accept ENTER as a shortcut.
|
Code » |
The object to use for event.target. Useful when mixing in an
EventTarget to another object.
|
Code » | |
![]()
No description.
|
Code » | |
Maps of event type to an array of listeners.
|
Code » | |
Parent event target, used during event bubbling.
TODO(user): Change this to goog.events.Listenable. This
currently breaks people who expect getParentEventTarget to return
goog.events.EventTarget.
|
Code » |
Static method for getting the key code for a given key.
|
code » | |
Constructs key from key code and modifiers.
The lower 8 bits are used for the key code, the following 3 for modifiers and
the remaining bits are unused.
|
code » | |
Builds stroke array from string representation of shortcut.
|
code » | |
![]()
Adds or removes a stroke node to/from the given parent node.
|
code » |
![]()
Keys marked as global by default.
|
Code » | |
![]()
Text input types to allow only ENTER shortcuts.
Web Forms 2.0 for HTML5: Section 4.10.7 from 29 May 2012.
|
Code » | |
![]()
Maximum allowed delay, in milliseconds, allowed between the first and second
key in a key sequence.
|
Code » | |
![]()
Cache for name to key code lookup.
|
Code » | |
![]()
No description.
|
Code » |
![]()
Events.
Constants:
|
Code » | ||||||
![]()
Bit values for modifier keys.
Constants:
|
Code » |