| ... | ... |
@@ -198,6 +198,16 @@ void run(tty_t *tty){
|
| 198 | 198 |
}else if(ch == 10){ /* Enter */
|
| 199 | 199 |
clear(tty); |
| 200 | 200 |
emit(tty); |
| 201 |
+ }else if(ch == 27){ /* ESC */
|
|
| 202 |
+ ch = tty_getchar(tty); |
|
| 203 |
+ if(ch == '['){
|
|
| 204 |
+ ch = tty_getchar(tty); |
|
| 205 |
+ if(ch == 'A'){ /* UP ARROW */
|
|
| 206 |
+ action_prev(); |
|
| 207 |
+ }else if(ch == 'B'){ /* DOWN ARROW */
|
|
| 208 |
+ action_next(); |
|
| 209 |
+ } |
|
| 210 |
+ } |
|
| 201 | 211 |
} |
| 202 | 212 |
}while(1); |
| 203 | 213 |
} |