diff --git a/src/ChangeLog b/src/ChangeLog index c5e8436d0..b8dd3af1b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2002-09-24 Pavel Roskin + * screen.c (panel_event): Implement support for mouse wheel. + * view.c (display): Fix wrapping of tabs. Reported by Arpad Biro diff --git a/src/TODO b/src/TODO index afa33e34e..683c29e75 100644 --- a/src/TODO +++ b/src/TODO @@ -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. diff --git a/src/screen.c b/src/screen.c index 8514f54ae..c7ad8d358 100644 --- a/src/screen.c +++ b/src/screen.c @@ -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;