1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-24 03:55:23 -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
@@ -244,7 +244,7 @@ func (p *MangoWCParser) ParseKeys() []MangoWCKeyBinding {
}
continue
}
if !strings.HasPrefix(trimmed, "bind") {
if !strings.HasPrefix(trimmed, "bind") && !strings.HasPrefix(trimmed, mangowcAxisBindPrefix) {
pendingComment = ""
continue
}
@@ -427,7 +427,7 @@ func (p *MangoWCParser) parseFileWithSource(filePath string) ([]MangoWCKeyBindin
continue
}
if !strings.HasPrefix(trimmed, "bind") {
if !strings.HasPrefix(trimmed, "bind") && !strings.HasPrefix(trimmed, mangowcAxisBindPrefix) {
pendingComment = ""
continue
}
@@ -493,7 +493,7 @@ func (p *MangoWCParser) parseDMSBindsDirectly(dmsBindsPath string) []MangoWCKeyB
// line directly above) is the description: mango feeds inline comments to spawn
// as argv, so DMS keeps descriptions on the line above; inline `#` is a fallback.
func (p *MangoWCParser) getKeybindAtLineContent(line string, precedingComment string) *MangoWCKeyBinding {
bindMatch := regexp.MustCompile(`^(bind[lsrp]*)\s*=\s*(.+)$`)
bindMatch := regexp.MustCompile(`^(bind[lsrp]*|axisbind)\s*=\s*(.+)$`)
matches := bindMatch.FindStringSubmatch(line)
if len(matches) < 3 {
return nil
@@ -527,6 +527,12 @@ func (p *MangoWCParser) getKeybindAtLineContent(line string, precedingComment st
key := strings.TrimSpace(keyFields[1])
command := strings.TrimSpace(keyFields[2])
if matches[1] == mangowcAxisBindPrefix {
if canonical, ok := mangowcDirectionToScroll(key); ok {
key = canonical
}
}
var params string
if len(keyFields) > 3 {
params = strings.TrimSpace(keyFields[3])