From 5cb629f4c32c79b5544c572caf5796487bf03cf8 Mon Sep 17 00:00:00 2001 From: makeworld Date: Thu, 6 Aug 2020 15:08:19 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20F1=20&=20F2=20keys=20for=20tab=20na?= =?UTF-8?q?v.=20-=20#64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + display/display.go | 8 ++++++++ display/help.go | 2 ++ 3 files changed, 11 insertions(+) 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.