* screen.c (panel_event): Implement support for mouse wheel.

This commit is contained in:
Pavel Roskin 2002-09-24 05:16:19 +00:00
parent 2e3fc9234b
commit ac608302f8
3 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,7 @@
2002-09-24 Pavel Roskin <proski@gnu.org>
* screen.c (panel_event): Implement support for mouse wheel.
* view.c (display): Fix wrapping of tabs.
Reported by Arpad Biro <biro_arpad@yahoo.com>

View File

@ -14,8 +14,6 @@ Add support for mouse wheel with gpm.
Recheck all mouse handlers, make sure that they check button number.
Make mouse wheel work on the panels.
ncurses 5.2 turns off keypad under heavy load on xterm. Check if
anything can be done about it.

View File

@ -2282,16 +2282,29 @@ panel_event (Gpm_Event *event, WPanel *panel)
int my_index;
/* Mouse wheel events */
if ((event->buttons & GPM_B_UP) && (event->type & GPM_DOWN)) {
prev_page (panel);
return MOU_NORMAL;
}
if ((event->buttons & GPM_B_DOWN) && (event->type & GPM_DOWN)) {
next_page (panel);
return MOU_NORMAL;
}
/* "<" button */
if (event->type & GPM_DOWN && event->x == 1 + 1 && event->y == 0 + 1) {
directory_history_prev (panel);
return MOU_NORMAL;
}
/* ">" button */
if (event->type & GPM_DOWN && event->x == panel->widget.cols - 2 + 1 && event->y == 0 + 1) {
directory_history_next (panel);
return MOU_NORMAL;
}
/* "v" button */
if (event->type & GPM_DOWN && event->x == panel->widget.cols - 3 + 1 && event->y == 0 + 1) {
directory_history_list (panel);
return MOU_NORMAL;