summaryrefslogtreecommitdiffstats
path: root/Panel.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-08-19 18:55:24 -0300
committerHisham Muhammad <hisham@gobolinux.org>2015-08-19 18:55:24 -0300
commitb003636958377ecad3ee5df4ca2de8717c4530b9 (patch)
tree187106d1eae07e5f1dfd8dfb3a63d288863f3e8a /Panel.c
parent3e93f9b85243e1edf1d3b73658fdf3f8a5b13032 (diff)
Support for NCurses 6.0 and mouse wheel
Diffstat (limited to 'Panel.c')
-rw-r--r--Panel.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Panel.c b/Panel.c
index 08d04022..f421a0d5 100644
--- a/Panel.c
+++ b/Panel.c
@@ -412,6 +412,21 @@ bool Panel_onKey(Panel* this, int key) {
this->scrollV += (this->h - 1);
this->needsRedraw = true;
break;
+ case KEY_WHEELUP:
+ this->selected -= CRT_scrollWheelVAmount;
+ this->scrollV -= CRT_scrollWheelVAmount;
+ this->needsRedraw = true;
+ break;
+ case KEY_WHEELDOWN:
+ {
+ this->selected += CRT_scrollWheelVAmount;
+ this->scrollV += CRT_scrollWheelVAmount;
+ if (this->scrollV > Vector_size(this->items) - this->h) {
+ this->scrollV = Vector_size(this->items) - this->h;
+ }
+ this->needsRedraw = true;
+ break;
+ }
case KEY_HOME:
this->selected = 0;
break;

© 2014-2024 Faster IT GmbH | imprint | privacy policy