mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
app,io/key,io/system: [API] replace system.CommandEvent with key.Event
It's much simpler to map the Android back button to a key.Event and let the usual key filtering determine whether to block its default behaviour. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-21
@@ -54,20 +54,9 @@ type StageEvent struct {
|
||||
Stage Stage
|
||||
}
|
||||
|
||||
// CommandEvent is a system event. Unlike most other events, CommandEvent is
|
||||
// delivered as a pointer to allow Cancel to suppress it.
|
||||
type CommandEvent struct {
|
||||
Type CommandType
|
||||
// Cancel suppress the default action of the command.
|
||||
Cancel bool
|
||||
}
|
||||
|
||||
// Stage of a Window.
|
||||
type Stage uint8
|
||||
|
||||
// CommandType is the type of a CommandEvent.
|
||||
type CommandType uint8
|
||||
|
||||
const (
|
||||
// StagePaused is the Stage for inactive Windows.
|
||||
// Inactive Windows don't receive FrameEvents.
|
||||
@@ -76,12 +65,6 @@ const (
|
||||
StageRunning
|
||||
)
|
||||
|
||||
const (
|
||||
// CommandBack is the command for a back action
|
||||
// such as the Android back button.
|
||||
CommandBack CommandType = iota
|
||||
)
|
||||
|
||||
func (l Stage) String() string {
|
||||
switch l {
|
||||
case StagePaused:
|
||||
@@ -93,7 +76,6 @@ func (l Stage) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
func (FrameEvent) ImplementsEvent() {}
|
||||
func (StageEvent) ImplementsEvent() {}
|
||||
func (*CommandEvent) ImplementsEvent() {}
|
||||
func (DestroyEvent) ImplementsEvent() {}
|
||||
func (FrameEvent) ImplementsEvent() {}
|
||||
func (StageEvent) ImplementsEvent() {}
|
||||
func (DestroyEvent) ImplementsEvent() {}
|
||||
|
||||
Reference in New Issue
Block a user