diff --git a/src/device/input/button/plaintext_test.go b/src/device/input/button/plaintext_test.go index f293aab..7370fc5 100644 --- a/src/device/input/button/plaintext_test.go +++ b/src/device/input/button/plaintext_test.go @@ -22,6 +22,8 @@ func TestPlaintext(t *testing.T) { type constSrc string +func (c constSrc) Refresh() {} + func (c constSrc) Close() {} func (c constSrc) Read() []byte { diff --git a/src/device/input/input.go b/src/device/input/input.go index c0d449f..f5d6d44 100644 --- a/src/device/input/input.go +++ b/src/device/input/input.go @@ -13,8 +13,9 @@ type Input interface { } func New(ctx context.Context) Input { + src := raw.New(ctx) return wrap.New(ctx, func() button.Parser { - src := raw.New(ctx) + src.Refresh() return button.New(ctx, src) }) } diff --git a/src/device/input/raw/keyboard.go b/src/device/input/raw/keyboard.go index f9d53ee..55ffef5 100644 --- a/src/device/input/raw/keyboard.go +++ b/src/device/input/raw/keyboard.go @@ -31,6 +31,9 @@ func NewKeyboard() Keyboard { return Keyboard{} } +func (kb Keyboard) Refresh() { +} + func (kb Keyboard) Close() { switch runtime.GOOS { case "linux": diff --git a/src/device/input/raw/random.go b/src/device/input/raw/random.go index 419041b..514f718 100644 --- a/src/device/input/raw/random.go +++ b/src/device/input/raw/random.go @@ -22,6 +22,9 @@ func NewRandom(generator func() byte) *Random { return &Random{generator: generator} } +func (r *Random) Refresh() { +} + func (r *Random) Close() { } diff --git a/src/device/input/raw/raw.go b/src/device/input/raw/raw.go index 712bb5f..cbc89ab 100644 --- a/src/device/input/raw/raw.go +++ b/src/device/input/raw/raw.go @@ -9,6 +9,7 @@ import ( type Raw interface { Read() []byte Close() + Refresh() } func New(ctx context.Context) Raw { diff --git a/src/device/input/raw/udp.go b/src/device/input/raw/udp.go index edfc7b4..148ebe0 100644 --- a/src/device/input/raw/udp.go +++ b/src/device/input/raw/udp.go @@ -55,6 +55,9 @@ func (udp UDP) Read() []byte { } } +func (udp UDP) Refresh() { +} + func (udp UDP) Close() { udp.conn.Close() }