* Move all physical device initialization logic to main functions

* Move all virtual device initialization to virtualbuffer package.
* Factor out common eventcode helper logic into a new package.
This commit is contained in:
Anna Rose Wiggins 2025-08-11 14:54:02 -04:00
parent 1b374bccc6
commit 727985f91c
17 changed files with 777 additions and 771 deletions

View file

@ -5,7 +5,8 @@ import (
"slices"
// TODO: using config here feels like bad coupling... ButtonFromIndex might need a refactor / move
"git.annabunches.net/annabunches/joyful/internal/configparser"
"git.annabunches.net/annabunches/joyful/internal/eventcodes"
"git.annabunches.net/annabunches/joyful/internal/logger"
"github.com/holoplot/go-evdev"
flag "github.com/spf13/pflag"
@ -20,7 +21,7 @@ func isJoystickLike(device *evdev.InputDevice) bool {
if slices.Contains(types, evdev.EV_KEY) {
buttons := device.CapableEvents(evdev.EV_KEY)
for _, code := range configparser.ButtonFromIndex {
for _, code := range eventcodes.ButtonFromIndex {
if slices.Contains(buttons, code) {
return true
}