browser: support arrows and page {up,down}

This commit is contained in:
dece 2021-05-31 16:30:26 +02:00
parent 2ea8f60739
commit 115fd43f09
2 changed files with 12 additions and 12 deletions

View file

@ -186,19 +186,19 @@ class Browser:
self.quick_command("") self.quick_command("")
elif char == ord("r"): elif char == ord("r"):
self.reload_page() self.reload_page()
elif char == ord("h"): elif char == ord("h") or char == curses.KEY_LEFT:
self.scroll_page_horizontally(-3) self.scroll_page_horizontally(-3)
elif char == ord("H"): elif char == ord("H"):
self.scroll_whole_page_left() self.scroll_whole_page_left()
elif char == ord("j"): elif char == ord("j") or char == curses.KEY_DOWN:
self.scroll_page_vertically(3) self.scroll_page_vertically(3)
elif char == ord("J"): elif char == ord("J") or char == curses.KEY_NPAGE:
self.scroll_whole_page_down() self.scroll_whole_page_down()
elif char == ord("k"): elif char == ord("k") or char == curses.KEY_UP:
self.scroll_page_vertically(-3) self.scroll_page_vertically(-3)
elif char == ord("K"): elif char == ord("K") or char == curses.KEY_PPAGE:
self.scroll_whole_page_up() self.scroll_whole_page_up()
elif char == ord("l"): elif char == ord("l") or char == curses.KEY_RIGHT:
self.scroll_page_horizontally(3) self.scroll_page_horizontally(3)
elif char == ord("L"): elif char == ord("L"):
self.scroll_whole_page_right() self.scroll_whole_page_right()

View file

@ -11,13 +11,13 @@ Keybinds using the SHIFT key are written uppercase. Keybinds using the ALT (or M
* colon: focus the command-line * colon: focus the command-line
* r: reload page * r: reload page
* h: scroll left a bit * h (or left): scroll left a bit
* j: scroll down a bit * j (or down): scroll down a bit
* k: scroll up a bit * k (or up): scroll up a bit
* l: scroll right a bit * l (or right): scroll right a bit
* H: scroll left a whole page * H: scroll left a whole page
* J: scroll down a whole page * J (or page down): scroll down a whole page
* K: scroll up a whole page * K (or page up): scroll up a whole page
* L: scroll right a whole page * L: scroll right a whole page
* M-h: scroll one column left * M-h: scroll one column left
* M-j: scroll one line down * M-j: scroll one line down