From 115fd43f09e1551fdf24484685e06108c4238fd7 Mon Sep 17 00:00:00 2001 From: dece Date: Mon, 31 May 2021 16:30:26 +0200 Subject: [PATCH] browser: support arrows and page {up,down} --- bebop/browser/browser.py | 12 ++++++------ bebop/help.py | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bebop/browser/browser.py b/bebop/browser/browser.py index f087c90..413c7ba 100644 --- a/bebop/browser/browser.py +++ b/bebop/browser/browser.py @@ -186,19 +186,19 @@ class Browser: self.quick_command("") elif char == ord("r"): self.reload_page() - elif char == ord("h"): + elif char == ord("h") or char == curses.KEY_LEFT: self.scroll_page_horizontally(-3) elif char == ord("H"): self.scroll_whole_page_left() - elif char == ord("j"): + elif char == ord("j") or char == curses.KEY_DOWN: self.scroll_page_vertically(3) - elif char == ord("J"): + elif char == ord("J") or char == curses.KEY_NPAGE: self.scroll_whole_page_down() - elif char == ord("k"): + elif char == ord("k") or char == curses.KEY_UP: self.scroll_page_vertically(-3) - elif char == ord("K"): + elif char == ord("K") or char == curses.KEY_PPAGE: self.scroll_whole_page_up() - elif char == ord("l"): + elif char == ord("l") or char == curses.KEY_RIGHT: self.scroll_page_horizontally(3) elif char == ord("L"): self.scroll_whole_page_right() diff --git a/bebop/help.py b/bebop/help.py index cb6792c..e3cd9c1 100644 --- a/bebop/help.py +++ b/bebop/help.py @@ -11,13 +11,13 @@ Keybinds using the SHIFT key are written uppercase. Keybinds using the ALT (or M * colon: focus the command-line * r: reload page -* h: scroll left a bit -* j: scroll down a bit -* k: scroll up a bit -* l: scroll right a bit +* h (or left): scroll left a bit +* j (or down): scroll down a bit +* k (or up): scroll up a bit +* l (or right): scroll right a bit * H: scroll left a whole page -* J: scroll down a whole page -* K: scroll up a whole page +* J (or page down): scroll down a whole page +* K (or page up): scroll up a whole page * L: scroll right a whole page * M-h: scroll one column left * M-j: scroll one line down