From 1ee4b1efb7c04648c859e67cc7da52869062158d Mon Sep 17 00:00:00 2001 From: Adam0 Date: Sat, 15 Aug 2026 08:33:01 -0400 Subject: [PATCH] Cycle workspaces with Tab and Shift+Tab --- README.md | 6 +++--- modules/overview/Overview.qml | 17 +++++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d4b33e9..10fdae1 100644 --- a/README.md +++ b/README.md @@ -78,8 +78,8 @@ bind = Super, Tab, exec, overzicht ipc call overview cycle bind = Super Shift, Tab, exec, overzicht ipc call overview cycleBackwards ``` -The first press opens the overview, repeated presses cycle the selection, -`Shift`+`Tab` cycles backward, and releasing `Super` closes it. +The first press opens the overview. While it is open, `Tab` cycles forward and +`Shift`+`Tab` cycles backward. Close the overview with `Escape` or `Return`. When running from the flake directly, pass IPC arguments after `--`: @@ -92,7 +92,7 @@ Keyboard controls while the overview is open: | Key | Action | | --- | --- | | `Left` / `Right` / `Up` / `Down` | Move across the grid | -| Repeated `Super`+`Tab` / `Super`+`Shift`+`Tab` | Cycle forward/backward; release `Super` to close | +| `Tab` / `Shift`+`Tab` | Cycle forward/backward | | `h` / `j` / `k` / `l` | Vim-style grid movement | | `1` to `9` | Jump to that workspace position | | `0` | Jump to position 10 when available | diff --git a/modules/overview/Overview.qml b/modules/overview/Overview.qml index e813171..6148784 100644 --- a/modules/overview/Overview.qml +++ b/modules/overview/Overview.qml @@ -142,13 +142,6 @@ Scope { } } - Keys.onReleased: event => { - if (event.key === Qt.Key_Meta || event.key === Qt.Key_Super_L || event.key === Qt.Key_Super_R) { - GlobalStates.overviewOpen = false; - event.accepted = true; - } - } - Keys.onPressed: event => { if (event.key === Qt.Key_Escape || event.key === Qt.Key_Return) { GlobalStates.overviewOpen = false; @@ -194,14 +187,14 @@ Scope { let targetVisualRow = toVisualRow(currentNormalRow); let targetVisualColumn = toVisualColumn(currentNormalColumn); let targetId = null; - const superTab = event.key === Qt.Key_Tab && (event.modifiers & Qt.MetaModifier) && !(event.modifiers & Qt.ShiftModifier); - const superBacktab = (event.key === Qt.Key_Backtab || (event.key === Qt.Key_Tab && (event.modifiers & Qt.ShiftModifier))) && (event.modifiers & Qt.MetaModifier); + const tabForward = event.key === Qt.Key_Tab && !(event.modifiers & Qt.ShiftModifier); + const tabBackward = event.key === Qt.Key_Backtab || (event.key === Qt.Key_Tab && (event.modifiers & Qt.ShiftModifier)); - if (event.key === Qt.Key_Left || event.key === Qt.Key_H || superBacktab) { + if (event.key === Qt.Key_Left || event.key === Qt.Key_H || tabBackward) { const targetVisualIndex = (targetVisualRow * columns + targetVisualColumn - 1 + workspacesPerGroup) % workspacesPerGroup; targetVisualRow = Math.floor(targetVisualIndex / columns); targetVisualColumn = targetVisualIndex % columns; - } else if (event.key === Qt.Key_Right || event.key === Qt.Key_L || superTab) { + } else if (event.key === Qt.Key_Right || event.key === Qt.Key_L || tabForward) { const targetVisualIndex = (targetVisualRow * columns + targetVisualColumn + 1) % workspacesPerGroup; targetVisualRow = Math.floor(targetVisualIndex / columns); targetVisualColumn = targetVisualIndex % columns; @@ -218,7 +211,7 @@ Scope { targetId = minWorkspaceId + 9; } - if (targetId === null && (event.key === Qt.Key_Left || event.key === Qt.Key_H || event.key === Qt.Key_Right || event.key === Qt.Key_L || event.key === Qt.Key_Up || event.key === Qt.Key_K || event.key === Qt.Key_Down || event.key === Qt.Key_J || superTab || superBacktab)) { + if (targetId === null && (event.key === Qt.Key_Left || event.key === Qt.Key_H || event.key === Qt.Key_Right || event.key === Qt.Key_L || event.key === Qt.Key_Up || event.key === Qt.Key_K || event.key === Qt.Key_Down || event.key === Qt.Key_J || tabForward || tabBackward)) { const targetNormalRow = toNormalRow(targetVisualRow); const targetNormalColumn = toNormalColumn(targetVisualColumn); targetId = minWorkspaceId + targetNormalRow * columns + targetNormalColumn; -- 2.51.2