From c7eb9be9f3ea9a0d7daf008885d53c3a590a8cb7 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 12 Jul 2019 14:53:45 +0200 Subject: [PATCH] ui/key,ui/pointer: replace Key types with input.Key Signed-off-by: Elias Naur --- ui/key/key.go | 7 +++---- ui/pointer/pointer.go | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ui/key/key.go b/ui/key/key.go index c06e2328..43484933 100644 --- a/ui/key/key.go +++ b/ui/key/key.go @@ -4,18 +4,17 @@ package key import ( "gioui.org/ui" + "gioui.org/ui/input" "gioui.org/ui/internal/ops" ) type HandlerOp struct { - Key Key + Key input.Key Focus bool } type HideInputOp struct{} -type Key interface{} - type FocusEvent struct { Focus bool } @@ -80,7 +79,7 @@ func (h *HandlerOp) Decode(d []byte, refs []interface{}) { } *h = HandlerOp{ Focus: d[1] != 0, - Key: refs[0].(Key), + Key: refs[0].(input.Key), } } diff --git a/ui/pointer/pointer.go b/ui/pointer/pointer.go index 5ed446d4..f19331aa 100644 --- a/ui/pointer/pointer.go +++ b/ui/pointer/pointer.go @@ -9,6 +9,7 @@ import ( "gioui.org/ui" "gioui.org/ui/f32" + "gioui.org/ui/input" "gioui.org/ui/internal/ops" ) @@ -38,7 +39,7 @@ type areaOp struct { } type HandlerOp struct { - Key Key + Key input.Key Grab bool } @@ -48,8 +49,6 @@ type PassOp struct { Pass bool } -type Key interface{} - type ID uint16 type Type uint8 type Priority uint8 @@ -120,7 +119,7 @@ func (h *HandlerOp) Decode(d []byte, refs []interface{}) { } *h = HandlerOp{ Grab: d[1] != 0, - Key: refs[0].(Key), + Key: refs[0].(input.Key), } }