mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 22:53:03 +01:00
Backspace key should now work on more terminals in toxic.
This commit is contained in:
parent
e72ff9de6d
commit
498ead2866
2
chat.c
2
chat.c
@ -95,7 +95,7 @@ static void chat_onKey(ToxWindow* self, int key) {
|
|||||||
ctx->line[0] = '\0';
|
ctx->line[0] = '\0';
|
||||||
ctx->pos = 0;
|
ctx->pos = 0;
|
||||||
}
|
}
|
||||||
else if(key == 0x107) {
|
else if(key == 0x107 || key == 0x8 || key == 0x7f) {
|
||||||
if(ctx->pos != 0) {
|
if(ctx->pos != 0) {
|
||||||
ctx->line[--ctx->pos] = '\0';
|
ctx->line[--ctx->pos] = '\0';
|
||||||
}
|
}
|
||||||
|
2
prompt.c
2
prompt.c
@ -256,7 +256,7 @@ static void prompt_onKey(ToxWindow* self, int key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// BACKSPACE key: Remove one character from line.
|
// BACKSPACE key: Remove one character from line.
|
||||||
else if(key == 0x107) {
|
else if(key == 0x107 || key == 0x8 || key == 0x7f) {
|
||||||
|
|
||||||
if(prompt_buf_pos != 0) {
|
if(prompt_buf_pos != 0) {
|
||||||
prompt_buf[--prompt_buf_pos] = 0;
|
prompt_buf[--prompt_buf_pos] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user