Initial support for application specific overrides.

This commit is contained in:
Storm Dragon committed 2026-10-28 03:31:33 -04:00
1 parent 901fd58ba8
commit b45f800489
37 files changed
+3909 -475

No files matched your search

+3 -2
View File
@@ -66,6 +66,7 @@ const (
)
type Decision struct {
Code uint16 // physical key code, for forwarded application press/repeat hooks
Forward bool
Interrupt bool
Keypress bool // a fresh physical press, excluding repeats and state repair
@@ -191,7 +192,7 @@ func (r *Router) key(device int, key uint16, value int32, numLock, syncEvent, re
}
if state.forwarded {
typing := !syncEvent && r.typing_key(key, numLock)
return Decision{Forward: true, Deletion: !syncEvent && deletion_key(key, numLock), Typing: typing, WordBoundary: typing && key == KeySpace, Interrupt: !syncEvent && !pure_modifier(key)}
return Decision{Code: key, Forward: true, Deletion: !syncEvent && deletion_key(key, numLock), Typing: typing, WordBoundary: typing && key == KeySpace, Interrupt: !syncEvent && !pure_modifier(key)}
}
commandID := state.commandID
if value == 2 && repeatable(commandID) && !syncEvent {
@@ -237,7 +238,7 @@ func (r *Router) key(device int, key uint16, value int32, numLock, syncEvent, re
return Decision{Forward: forwarded}
}
typing := forwarded && r.typing_key(key, numLock)
return Decision{Keypress: true, Deletion: forwarded && deletion_key(key, numLock), Typing: typing, WordBoundary: typing && key == KeySpace, Forward: forwarded, Command: commandID, Interrupt: commandID != "" || forwarded && (!pure_modifier(key) || key == KeyCtrl || key == KeyRightCtrl)}
return Decision{Code: key, Keypress: true, Deletion: forwarded && deletion_key(key, numLock), Typing: typing, WordBoundary: typing && key == KeySpace, Forward: forwarded, Command: commandID, Interrupt: commandID != "" || forwarded && (!pure_modifier(key) || key == KeyCtrl || key == KeyRightCtrl)}
}
func (r *Router) typing_key(key uint16, numLock bool) bool {