1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 16:16:46 +02:00

beep when it should beep

This commit is contained in:
Jfreegman
2013-12-15 20:52:10 -05:00
parent dfb5b16e7d
commit d04f5fa102
4 changed files with 54 additions and 5 deletions

View File

@ -314,24 +314,32 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
wmove(self->window, y-1, x2 - cur_len);
else
wmove(self->window, y, x - cur_len);
} else {
beep();
}
}
else if (key == KEY_DC) { /* DEL key: Remove character at pos */
if (ctx->pos != ctx->len)
del_char_buf_frnt(ctx->line, &ctx->pos, &ctx->len);
else
beep();
}
else if (key == T_KEY_DISCARD) { /* CTRL-U: Delete entire line behind pos */
if (ctx->pos > 0) {
discard_buf(ctx->line, &ctx->pos, &ctx->len);
wmove(self->window, y2 - CURS_Y_OFFSET, 0);
} else {
beep();
}
}
else if (key == T_KEY_KILL) { /* CTRL-K: Delete entire line in front of pos */
if (ctx->pos != ctx->len)
kill_buf(ctx->line, &ctx->pos, &ctx->len);
else
beep();
}
else if (key == KEY_HOME) { /* HOME key: Move cursor to beginning of line */
@ -357,6 +365,8 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
wmove(self->window, y-1, x2 - cur_len);
else
wmove(self->window, y, x - cur_len);
} else {
beep();
}
}
@ -369,6 +379,8 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
wmove(self->window, y+1, 0);
else
wmove(self->window, y, x + cur_len);
} else {
beep();
}
}
@ -396,7 +408,11 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
} else {
wmove(self->window, y, x+diff);
}
} else {
beep();
}
} else {
beep();
}
}