* @param {!Event} e * @private
(e)
| 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_() { |