1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-23 19:45:21 -04:00

keybinds: fix mouse wheel keysims on Hyprland and Mango

fixes #2683
This commit is contained in:
bbedward
2026-06-23 11:21:38 -04:00
parent 73f3a72d00
commit 0e7901ebbe
8 changed files with 230 additions and 5 deletions
@@ -236,6 +236,9 @@ func (m *MangoWCProvider) SetBind(key, action, description string, options map[s
if optionPrefix := m.bindPrefixFromOptions(options); optionPrefix != "" {
prefix = optionPrefix
}
if _, leaf := m.parseKeyString(key); isScrollKey(leaf) {
prefix = mangowcAxisBindPrefix
}
existingBinds[normalizedKey] = &mangowcOverrideBind{
Key: key,
@@ -346,6 +349,12 @@ func (m *MangoWCProvider) parseOverrideBindLine(line, precedingComment string) (
keyName := strings.TrimSpace(fields[1])
command := strings.TrimSpace(fields[2])
if prefix == mangowcAxisBindPrefix {
if canonical, ok := mangowcDirectionToScroll(keyName); ok {
keyName = canonical
}
}
var params string
if len(fields) > 3 {
params = strings.TrimSpace(fields[3])
@@ -365,6 +374,9 @@ func (m *MangoWCProvider) parseOverrideBindLine(line, precedingComment string) (
}
func (m *MangoWCProvider) isBindPrefix(prefix string) bool {
if prefix == mangowcAxisBindPrefix {
return true
}
if !strings.HasPrefix(prefix, "bind") {
return false
}
@@ -591,6 +603,11 @@ func (m *MangoWCProvider) writeBindLine(sb *strings.Builder, bind *mangowcOverri
if prefix == "" {
prefix = "bind"
}
if prefix == mangowcAxisBindPrefix {
if direction, ok := mangowcScrollToDirection(key); ok {
key = direction
}
}
sb.WriteString(prefix)
sb.WriteString("=")
if mods == "" {