MCPcopy Create free account
hub / github.com/devforth/painterro / handleKeyDown

Method handleKeyDown

js/selecter.js:221–245  ·  view source on GitHub ↗
(evt)

Source from the content-addressed store, hash-verified

219 }
220
221 handleKeyDown(evt) {
222 if (this.main.inserter.handleKeyDown(evt)) {
223 return true;
224 }
225 if (this.shown && this.imagePlaced) {
226 if (evt.keyCode === KEYS.enter) {
227 this.finishPlacing();
228 return true;
229 } else if (evt.keyCode === KEYS.esc) {
230 this.cancelPlacing();
231 return true;
232 }
233 } else if (this.shown && evt.keyCode === KEYS.del) {
234 this.doClearArea();
235 return true;
236 } else if (evt.keyCode === KEYS.a && evt.ctrlKey) {
237 this.selectAll();
238 event.preventDefault();
239 return true;
240 } else if (evt.keyCode === KEYS.esc && this.shown) {
241 this.hide();
242 return true;
243 }
244 return false;
245 }
246
247 handleMouseDown(event) {
248

Callers

nothing calls this directly

Calls 5

finishPlacingMethod · 0.95
cancelPlacingMethod · 0.95
doClearAreaMethod · 0.95
selectAllMethod · 0.95
hideMethod · 0.95

Tested by

no test coverage detected