mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 17:05:38 +00:00
ui/key: rename ChordEvent to just Event
Event is like pointer.Event and we don't want the stuttering of key.KeyEvent. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-3
@@ -14,8 +14,8 @@ import (
|
||||
"gioui.org/ui/input"
|
||||
"gioui.org/ui/key"
|
||||
"gioui.org/ui/layout"
|
||||
"gioui.org/ui/pointer"
|
||||
"gioui.org/ui/paint"
|
||||
"gioui.org/ui/pointer"
|
||||
|
||||
"golang.org/x/image/math/fixed"
|
||||
)
|
||||
@@ -118,7 +118,7 @@ func (e *Editor) Next(cfg ui.Config, queue input.Queue) (EditorEvent, bool) {
|
||||
switch ke := ke.(type) {
|
||||
case key.FocusEvent:
|
||||
e.focused = ke.Focus
|
||||
case key.ChordEvent:
|
||||
case key.Event:
|
||||
if !e.focused {
|
||||
break
|
||||
}
|
||||
@@ -559,7 +559,7 @@ func (e *Editor) scrollToCaret(cfg ui.Config) {
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Editor) command(k key.ChordEvent) bool {
|
||||
func (e *Editor) command(k key.Event) bool {
|
||||
switch k.Name {
|
||||
case key.NameReturn, key.NameEnter:
|
||||
e.append("\n")
|
||||
|
||||
Reference in New Issue
Block a user