MCPcopy
hub / github.com/palantir/plottable / onKeyPress

Method onKeyPress

src/interactions/keyInteraction.ts:74–80  ·  view source on GitHub ↗

* Adds a callback to be called when the key with the given keyCode is * pressed and the user is moused over the Component. * * @param {number} keyCode * @param {KeyCallback} callback * @returns {Interactions.Key} The calling Key Interaction.

(keyCode: number, callback: KeyCallback)

Source from the content-addressed store, hash-verified

72 * @returns {Interactions.Key} The calling Key Interaction.
73 */
74 public onKeyPress(keyCode: number, callback: KeyCallback) {
75 if (!this._keyPressCallbacks[keyCode]) {
76 this._keyPressCallbacks[keyCode] = new Utils.CallbackSet<KeyCallback>();
77 }
78 this._keyPressCallbacks[keyCode].add(callback);
79 return this;
80 }
81
82 /**
83 * Removes a callback that would be called when the key with the given keyCode is

Callers 5

runFunction · 0.95
runFunction · 0.95
runFunction · 0.95
registerEventFunction · 0.80

Calls 1

addMethod · 0.45

Tested by

no test coverage detected