-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PAGE_UP, PAGE_DOWN, KEY_HOME, and KEY_END support in ScrollMenu #44
Comments
I think this would be worthwhile. I guess pageup, pagedown can move a set number of positions, and home/end moves to the top or bottom of the menu |
No time to submit a PR, but here are the implementations I used for page up and page down in my custom
|
This feature has been added to the v0.1.1-develop branch, and seems to work OK on my end. Unit tests still need to be expanded to account for this change. |
I've implemented directly on the custom def _handle_key_press(self, key_pressed):
super()._handle_key_press(key_pressed)
if key_pressed == curses.KEY_NPAGE:
# if next jump is on the groud
if self._selected_item + self._height - 2 < len(self._view_items):
self._selected_item += self._height - 2
self._top_view = self._selected_item
if key_pressed == curses.KEY_PPAGE:
self._selected_item -= self._height - 2
self._top_view = self._selected_item
if self._selected_item < 0:
self._selected_item = 0 maybe helps mybe not 🎮 |
Closing, included in new |
ScrollMenu
only supports moving up and down by a single line at a time. When a scroll menu contains hundreds and hundreds of items, navigating in this manner is too slow. It would be great to add support forPAGE_UP
,PAGE_DOWN
,KEY_HOME
, andKEY_END
.The text was updated successfully, but these errors were encountered: