diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-08-19 18:55:24 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-08-19 18:55:24 -0300 |
commit | b003636958377ecad3ee5df4ca2de8717c4530b9 (patch) | |
tree | 187106d1eae07e5f1dfd8dfb3a63d288863f3e8a /Panel.c | |
parent | 3e93f9b85243e1edf1d3b73658fdf3f8a5b13032 (diff) |
Support for NCurses 6.0 and mouse wheel
Diffstat (limited to 'Panel.c')
-rw-r--r-- | Panel.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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; |