Skip to content

Commit

Permalink
Merge pull request #247 from shorepine/editoresc
Browse files Browse the repository at this point in the history
fix esc in editor
  • Loading branch information
bwhitman authored Jul 4, 2024
2 parents 0becadb + d43c979 commit a38072b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
1 change: 0 additions & 1 deletion docs/music.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ Now, send the AMY setup commands for your patch. Make sure your patch is consecu

The WOOD PIANO patch is four operators, each with an envelope and different modulation amplitude.


```python
amy.send(osc=1,bp0="0,1,5300,0,0,0",phase=0.25,ratio=1,amp="0.3,0,0,1,0,0")
amy.send(osc=2,bp0="0,1,3400,0,0,0",phase=0.25,ratio=0.5,amp="1.68,0,0,1,0,0")
Expand Down
21 changes: 2 additions & 19 deletions tulip/shared/editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,32 +820,15 @@ void process_char(int c) {
editor_page_up();
} else if(c==22) { // control V, page down
editor_page_down();
} else if(c==27) { // ansi code, up / down / left / right / forward delete
char s = (char) mp_hal_stdin_rx_chr(); // Skip the [
s = (char)mp_hal_stdin_rx_chr(); // Get the code
if(s == 'D') { //left
editor_left();
} else if(s=='C') { // right
editor_right();
} else if(s=='B') { // down
editor_down();
} else if(s=='A') { // up
editor_up();
} else if(s=='3') { // forward delete
s = (char)mp_hal_stdin_rx_chr(); // skip the ~
// AFAIK this is what forward delete is
editor_right();
editor_backspace();
}
// local mode high bit arrows & forward delete
} else if(c == 259) { editor_up();
} else if(c == 258) { editor_down();
} else if(c == 260) { editor_left();
} else if(c == 261) { editor_right();
} else if(c == 330) { editor_right(); editor_backspace();
} else if(c == 330 || c == 262) { editor_right(); editor_backspace();
} else if(c>31 && c<127) {
editor_insert_character(c);
} else {
dbg("not supported %d\n", c);
// Ignore unsupported keycodes...
}
}
Expand Down

0 comments on commit a38072b

Please sign in to comment.