MCPcopy Create free account
hub / github.com/continuedev/continue / handleSpecialKeys

Method handleSpecialKeys

extensions/cli/src/ui/TextBuffer.ts:501–531  ·  view source on GitHub ↗
(input: string, key: Key)

Source from the content-addressed store, hash-verified

499 }
500
501 private handleSpecialKeys(input: string, key: Key): boolean {
502 // Detect option key combinations through escape sequences
503 const isOptionKey = input.startsWith("\u001b") && input.length > 1;
504
505 // Handle option key combinations (detected through escape sequences)
506 if (isOptionKey) {
507 return this.handleOptionKey(input.slice(1));
508 }
509
510 // Handle special key combinations based on input character
511 if (key.ctrl && this.handleCtrlKey(input)) {
512 return true;
513 }
514
515 // Handle meta key combinations (cmd on Mac)
516 if (key.meta && this.handleMetaKey(input, key)) {
517 return true;
518 }
519
520 // Handle arrow keys
521 if (this.handleArrowKeys(key)) {
522 return true;
523 }
524
525 // Handle backspace/delete
526 if (this.handleDeleteKeys(key)) {
527 return true;
528 }
529
530 return false;
531 }
532
533 private handleTextInput(input: string): boolean {
534 // Direct paste detection: single large input - but delay insertion to catch split pastes

Callers 1

handleInputMethod · 0.95

Calls 5

handleOptionKeyMethod · 0.95
handleCtrlKeyMethod · 0.95
handleMetaKeyMethod · 0.95
handleArrowKeysMethod · 0.95
handleDeleteKeysMethod · 0.95

Tested by

no test coverage detected