MCPcopy
hub / github.com/autoNumeric/autoNumeric / _onKeyupGlobal

Method _onKeyupGlobal

src/AutoNumeric.js:7832–7844  ·  view source on GitHub ↗

* Listen for the `alt` key keyup event globally, and if the event is caught, reformat the AutoNumeric element that is hovered by the mouse. * * @param {KeyboardEvent} e * @private

(e)

Source from the content-addressed store, hash-verified

7830 * @private
7831 */
7832 _onKeyupGlobal(e) {
7833 if (AutoNumericHelper.character(e) === AutoNumericEnum.keyName.Alt) {
7834 const hoveredElement = AutoNumericHelper.getHoveredElement();
7835 if (AutoNumeric.isManagedByAutoNumeric(hoveredElement)) {
7836 const anElement = AutoNumeric.getAutoNumericElement(hoveredElement);
7837 if (anElement.formulaMode || !anElement.settings.unformatOnHover) {
7838 return;
7839 }
7840
7841 this.constructor._reformatAltHovered(anElement);
7842 }
7843 }
7844 }
7845
7846 /**
7847 * Handler for 'compositionstart' events.

Callers 1

_createEventListenersMethod · 0.95

Calls 5

characterMethod · 0.80
getHoveredElementMethod · 0.80
getAutoNumericElementMethod · 0.80
_reformatAltHoveredMethod · 0.80

Tested by

no test coverage detected