diff --git a/src/input.c b/src/input.c index 644b010..0024455 100644 --- a/src/input.c +++ b/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; }