mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-08 12:13:31 -04:00
refactor(niri): Normalize key bindings to be case insensitive within DMS
This commit is contained in:
@@ -166,7 +166,7 @@ func (n *NiriProvider) convertKeybind(kb *NiriKeyBinding, subcategory string, co
|
||||
}
|
||||
|
||||
if source == "dms-default" && conflicts != nil {
|
||||
if conflictKb, ok := conflicts[keyStr]; ok {
|
||||
if conflictKb, ok := conflicts[normalizeNiriBindKey(keyStr)]; ok {
|
||||
bind.Conflict = &keybinds.Keybind{
|
||||
Key: keyStr,
|
||||
Description: conflictKb.Description,
|
||||
@@ -249,7 +249,7 @@ func (n *NiriProvider) SetBind(key, action, description string, options map[stri
|
||||
existingBinds = make(map[string]*overrideBind)
|
||||
}
|
||||
|
||||
existingBinds[key] = &overrideBind{
|
||||
existingBinds[normalizeNiriBindKey(key)] = &overrideBind{
|
||||
Key: key,
|
||||
Action: action,
|
||||
Description: description,
|
||||
@@ -265,7 +265,7 @@ func (n *NiriProvider) RemoveBind(key string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
delete(existingBinds, key)
|
||||
delete(existingBinds, normalizeNiriBindKey(key))
|
||||
return n.writeOverrideBinds(existingBinds)
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ func (n *NiriProvider) loadOverrideBinds() (map[string]*overrideBind, error) {
|
||||
action = n.formatRawAction(kb.Action, kb.Args)
|
||||
}
|
||||
|
||||
binds[keyStr] = &overrideBind{
|
||||
binds[normalizeNiriBindKey(keyStr)] = &overrideBind{
|
||||
Key: keyStr,
|
||||
Action: action,
|
||||
Description: kb.Description,
|
||||
|
||||
Reference in New Issue
Block a user