void line_info_onKey(ToxWindow *self, wint_t key) { struct history *hst = self->chatwin->hst; switch (key) { case KEY_PPAGE: line_info_page_up(self, hst); break; case KEY_NPAGE: line_info_page_down(self, hst); break; case KEY_UP: line_info_scroll_up(hst); break; case KEY_DOWN: line_info_scroll_down(hst); break; case KEY_HOME: line_info_goto_root(hst); break; case KEY_END: line_info_reset_start(hst); break; } }
bool line_info_onKey(ToxWindow *self, wint_t key) { struct history *hst = self->chatwin->hst; bool match = true; if (key == user_settings->key_half_page_up) { line_info_page_up(self, hst); } else if (key == user_settings->key_half_page_down) { line_info_page_down(self, hst); } else if (key == user_settings->key_scroll_line_up) { line_info_scroll_up(hst); } else if (key == user_settings->key_scroll_line_down) { line_info_scroll_down(hst); } else if (key == user_settings->key_page_bottom) { line_info_reset_start(self, hst); } else { match = false; } return match; }
void line_info_toggle_scroll(ToxWindow *self, bool scroll) { WINDOW *win = self->chatwin->history; struct history *hst = self->chatwin->hst; if (scroll) { hst->scroll_mode = true; scrollok(win, 0); curs_set(0); } else { hst->scroll_mode = false; scrollok(win, 1); curs_set(1); line_info_reset_start(hst); } }
bool line_info_onKey(ToxWindow *self, wint_t key) { struct history *hst = self->chatwin->hst; bool match = true; switch (key) { /* TODO: Find good key bindings for all this stuff */ case T_KEY_C_F: line_info_page_up(self, hst); break; case T_KEY_C_V: line_info_page_down(self, hst); break; case KEY_PPAGE: line_info_scroll_up(hst); break; case KEY_NPAGE: line_info_scroll_down(hst); break; /* case ?: line_info_goto_root(hst); break; */ case T_KEY_C_H: line_info_reset_start(self, hst); break; default: match = false; break; } return match; }