From 2af373aed743b1cb14a8ec471477aa055ebfccac Mon Sep 17 00:00:00 2001 From: bel Date: Fri, 24 Mar 2023 20:52:44 -0600 Subject: [PATCH] integrate button.Parser --- src/device/input/button/parser.go | 2 +- src/device/input/input.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/device/input/button/parser.go b/src/device/input/button/parser.go index ee5397b..69076ee 100644 --- a/src/device/input/button/parser.go +++ b/src/device/input/button/parser.go @@ -11,5 +11,5 @@ type Parser interface { } func New(ctx context.Context, src raw.Raw) Parser { - panic(nil) + return NewPlaintext(src) } diff --git a/src/device/input/input.go b/src/device/input/input.go index b77ebff..f1dfd15 100644 --- a/src/device/input/input.go +++ b/src/device/input/input.go @@ -2,16 +2,18 @@ package input import ( "context" + "mayhem-party/src/device/input/button" "mayhem-party/src/device/input/raw" "mayhem-party/src/device/input/wrap" ) type Input interface { - Read() []wrap.Button + Read() []button.Button Close() } func New(ctx context.Context) Input { src := raw.New(ctx) - return wrap.New(ctx, src) + parser := button.New(ctx, src) + return wrap.New(ctx, parser) }