diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bccc07..4be83a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Emoji favicons can now be seen if `emoji_favicons` is enabled in the config (#62) - The `shift_numbers` key in the config was added, so that non US keyboard users can navigate tabs (#64) +- F1 and F2 keys for navigating to the previous and next tabs (#64) ### Changed diff --git a/display/display.go b/display/display.go index 6815e2d..d48220a 100644 --- a/display/display.go +++ b/display/display.go @@ -352,6 +352,14 @@ func Init() { case tcell.KeyCtrlC: Stop() return nil + case tcell.KeyF1: + // Wrap around, allow for modulo with negative numbers + n := NumTabs() + SwitchTab((((curTab - 1) % n) + n) % n) + return nil + case tcell.KeyF2: + SwitchTab((curTab + 1) % NumTabs()) + return nil case tcell.KeyRune: // Regular key was sent diff --git a/display/help.go b/display/help.go index 22d02b8..8edd4bc 100644 --- a/display/help.go +++ b/display/help.go @@ -28,6 +28,8 @@ Enter, Tab|On a page this will start link highlighting. |Press Enter again to go to one, or Esc to stop. Shift-NUMBER|Go to a specific tab. Shift-0, )|Go to the last tab. +F1|Previous tab +F2|Next tab Ctrl-H|Go home Ctrl-T|New tab, or if a link is selected, |this will open the link in a new tab.