Fix inverted buttons.

This commit is contained in:
Anna Rose Wiggins 2025-07-04 19:11:39 -04:00
parent 288a07eb73
commit 1f6c2517c0
2 changed files with 7 additions and 4 deletions

View file

@ -20,10 +20,13 @@ func (target *RuleTargetBase) GetDevice() *evdev.InputDevice {
}
func (target *RuleTargetButton) NormalizeValue(value int32) int32 {
if value == 0 {
return 1
if target.Inverted {
if value == 0 {
return 1
}
return 0
}
return 0
return value
}
func (target *RuleTargetButton) CreateEvent(value int32, mode *string) *evdev.InputEvent {