1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-01 19:18:28 -04:00

fix(keybinds): respect niri mod-key when capturing binds

Hardens #2224
This commit is contained in:
purian23
2026-07-04 00:50:58 -04:00
parent c554d973ef
commit b34941e3b8
8 changed files with 85 additions and 10 deletions
+6 -2
View File
@@ -56,7 +56,7 @@ Item {
readonly property bool hasConfigConflict: configConflict !== null
readonly property string _originalKey: editingKeyIndex >= 0 && editingKeyIndex < keys.length ? keys[editingKeyIndex].key : ""
readonly property string _selectedDesc: editingKeyIndex >= 0 && editingKeyIndex < keys.length ? (keys[editingKeyIndex].desc || bindData.desc || "") : (bindData.desc || "")
readonly property var _conflicts: editKey ? KeyUtils.getConflictingBinds(editKey, bindData.action, KeybindsService.getFlatBinds()) : []
readonly property var _conflicts: editKey ? KeyUtils.getConflictingBinds(editKey, bindData.action, KeybindsService.getFlatBinds(), KeybindsService.currentProvider === "niri" ? KeybindsService.modKey : "Super") : []
readonly property bool hasConflict: _conflicts.length > 0
readonly property real _inputHeight: Math.round(Theme.fontSizeMedium * 3)
@@ -725,6 +725,8 @@ Item {
if (!mods.includes("Shift"))
mods.push("Shift");
}
if (KeybindsService.currentProvider === "niri")
mods = KeyUtils.withSymbolicMod(mods, KeybindsService.modKey);
const key = KeyUtils.xkbKeyFromQtKey(qtKey, !!(event.modifiers & Qt.KeypadModifier));
if (!key) {
@@ -756,7 +758,7 @@ Item {
}
wheel.accepted = true;
const mods = [];
let mods = [];
if (wheel.modifiers & Qt.ControlModifier)
mods.push("Ctrl");
if (wheel.modifiers & Qt.ShiftModifier)
@@ -765,6 +767,8 @@ Item {
mods.push("Alt");
if (wheel.modifiers & Qt.MetaModifier)
mods.push("Super");
if (KeybindsService.currentProvider === "niri")
mods = KeyUtils.withSymbolicMod(mods, KeybindsService.modKey);
let wheelKey = "";
if (wheel.angleDelta.y > 0)