mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
ui/key,ui/pointer: replace Key types with input.Key
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-4
@@ -4,18 +4,17 @@ package key
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"gioui.org/ui"
|
"gioui.org/ui"
|
||||||
|
"gioui.org/ui/input"
|
||||||
"gioui.org/ui/internal/ops"
|
"gioui.org/ui/internal/ops"
|
||||||
)
|
)
|
||||||
|
|
||||||
type HandlerOp struct {
|
type HandlerOp struct {
|
||||||
Key Key
|
Key input.Key
|
||||||
Focus bool
|
Focus bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type HideInputOp struct{}
|
type HideInputOp struct{}
|
||||||
|
|
||||||
type Key interface{}
|
|
||||||
|
|
||||||
type FocusEvent struct {
|
type FocusEvent struct {
|
||||||
Focus bool
|
Focus bool
|
||||||
}
|
}
|
||||||
@@ -80,7 +79,7 @@ func (h *HandlerOp) Decode(d []byte, refs []interface{}) {
|
|||||||
}
|
}
|
||||||
*h = HandlerOp{
|
*h = HandlerOp{
|
||||||
Focus: d[1] != 0,
|
Focus: d[1] != 0,
|
||||||
Key: refs[0].(Key),
|
Key: refs[0].(input.Key),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
|
|
||||||
"gioui.org/ui"
|
"gioui.org/ui"
|
||||||
"gioui.org/ui/f32"
|
"gioui.org/ui/f32"
|
||||||
|
"gioui.org/ui/input"
|
||||||
"gioui.org/ui/internal/ops"
|
"gioui.org/ui/internal/ops"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ type areaOp struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type HandlerOp struct {
|
type HandlerOp struct {
|
||||||
Key Key
|
Key input.Key
|
||||||
Grab bool
|
Grab bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,8 +49,6 @@ type PassOp struct {
|
|||||||
Pass bool
|
Pass bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Key interface{}
|
|
||||||
|
|
||||||
type ID uint16
|
type ID uint16
|
||||||
type Type uint8
|
type Type uint8
|
||||||
type Priority uint8
|
type Priority uint8
|
||||||
@@ -120,7 +119,7 @@ func (h *HandlerOp) Decode(d []byte, refs []interface{}) {
|
|||||||
}
|
}
|
||||||
*h = HandlerOp{
|
*h = HandlerOp{
|
||||||
Grab: d[1] != 0,
|
Grab: d[1] != 0,
|
||||||
Key: refs[0].(Key),
|
Key: refs[0].(input.Key),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user