MCPcopy
hub / github.com/ampproject/amphtml / onKeyDown_

Method onKeyDown_

src/input.js:179–204  ·  view source on GitHub ↗

* @param {!Event} e * @private

(e)

Source from the content-addressed store, hash-verified

177 * @private
178 */
179 onKeyDown_(e) {
180 if (this.keyboardActive_) {
181 return;
182 }
183
184 if (e.defaultPrevented) {
185 return;
186 }
187
188 // Ignore inputs.
189 const {target} = e;
190 if (
191 target &&
192 (target.tagName == 'INPUT' ||
193 target.tagName == 'TEXTAREA' ||
194 target.tagName == 'SELECT' ||
195 target.tagName == 'OPTION' ||
196 target.hasAttribute('contenteditable'))
197 ) {
198 return;
199 }
200
201 this.keyboardActive_ = true;
202 this.keyboardStateObservable_.fire(true);
203 dev().fine(TAG_, 'keyboard activated');
204 }
205
206 /** @private */
207 onMouseDown_() {

Callers

nothing calls this directly

Calls 3

devFunction · 0.90
fineMethod · 0.80
fireMethod · 0.45

Tested by

no test coverage detected