Begin to overhaul config to couple initialization logic closer to the structs themselves.
This commit is contained in:
parent
d9babf5dc0
commit
1b374bccc6
15 changed files with 122 additions and 33 deletions
|
@ -5,7 +5,7 @@ import (
|
|||
"slices"
|
||||
|
||||
// TODO: using config here feels like bad coupling... ButtonFromIndex might need a refactor / move
|
||||
"git.annabunches.net/annabunches/joyful/internal/config"
|
||||
"git.annabunches.net/annabunches/joyful/internal/configparser"
|
||||
"git.annabunches.net/annabunches/joyful/internal/logger"
|
||||
"github.com/holoplot/go-evdev"
|
||||
flag "github.com/spf13/pflag"
|
||||
|
@ -20,7 +20,7 @@ func isJoystickLike(device *evdev.InputDevice) bool {
|
|||
if slices.Contains(types, evdev.EV_KEY) {
|
||||
buttons := device.CapableEvents(evdev.EV_KEY)
|
||||
|
||||
for _, code := range config.ButtonFromIndex {
|
||||
for _, code := range configparser.ButtonFromIndex {
|
||||
if slices.Contains(buttons, code) {
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue