mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 02:23:02 +01:00
fix setting custom keybinding
This commit is contained in:
parent
55ada8ad2f
commit
8a882916fb
23
src/input.c
23
src/input.c
@ -33,6 +33,9 @@
|
||||
#include "line_info.h"
|
||||
#include "notify.h"
|
||||
#include "groupchat.h"
|
||||
#include "settings.h"
|
||||
|
||||
extern struct user_settings *user_settings;
|
||||
|
||||
/* add a char to input field and buffer */
|
||||
void input_new_char(ToxWindow *self, wint_t key, int x, int y, int mx_x, int mx_y)
|
||||
@ -256,18 +259,22 @@ bool input_handle(ToxWindow *self, wint_t key, int x, int y, int mx_x, int mx_y)
|
||||
force_refresh(self->chatwin->history);
|
||||
break;
|
||||
|
||||
case T_KEY_C_B:
|
||||
if (self->is_groupchat) {
|
||||
self->show_peerlist ^= 1;
|
||||
redraw_groupchat_win(self);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
|
||||
/* TODO: this special case is ugly.
|
||||
maybe convert entire function to if/else and make them all customizable keys? */
|
||||
if (!match && key == user_settings->key_toggle_peerlist) {
|
||||
if (self->is_groupchat) {
|
||||
self->show_peerlist ^= 1;
|
||||
redraw_groupchat_win(self);
|
||||
}
|
||||
|
||||
match = true;
|
||||
}
|
||||
|
||||
|
||||
return match;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user