Versions in this module Expand all Collapse all v0 v0.1.4 Jun 1, 2024 Changes in this version type Listeners + func (ls *Listeners) HandlesEventType(typ Types) bool v0.1.3 May 5, 2024 v0.1.2 May 1, 2024 v0.1.1 May 1, 2024 Changes in this version + type Source struct + Deque Deque + Last SourceState + PaintCount int + ResettingPos bool + func (es *Source) Custom(data any) + func (es *Source) DropExternal(where image.Point, md mimedata.Mimes) + func (es *Source) Key(typ Types, rn rune, code key.Codes, mods key.Modifiers) + func (es *Source) KeyChord(rn rune, code key.Codes, mods key.Modifiers) + func (es *Source) Magnify(scaleFactor float32, where image.Point) + func (es *Source) MouseButton(typ Types, but Buttons, where image.Point, mods key.Modifiers) + func (es *Source) MouseMove(where image.Point) + func (es *Source) Scroll(where image.Point, delta math32.Vector2) + func (es *Source) Touch(typ Types, seq Sequence, where image.Point) + func (es *Source) Window(act WinActions) + func (es *Source) WindowPaint() + func (es *Source) WindowResize() + type SourceState struct + Key key.Codes + Mods key.Modifiers + MouseButton Buttons + MouseButtonType Types + MouseDownPos image.Point + MouseDownTime nptime.Time + MouseMoveTime nptime.Time + MousePos image.Point v0.1.0 Apr 14, 2024 v0.0.10 Apr 14, 2024 v0.0.9 Mar 20, 2024 v0.0.8 Mar 19, 2024 v0.0.7 Mar 1, 2024 v0.0.6 Feb 21, 2024 v0.0.5 Feb 18, 2024 Changes in this version type Event + ClearHandled func() v0.0.4 Feb 5, 2024 v0.0.3 Jan 25, 2024 v0.0.2 Jan 17, 2024 Changes in this version + var ScrollWheelSpeed = float32(1) + var TraceEventCompression = false + var TraceWindowPaint = false + type Base struct + Button Buttons + Code key.Codes + Data any + Flags EventFlags + GenTime nptime.Time + LocalOffset image.Point + Mods key.Modifiers + Prev image.Point + PrevLocal image.Point + PrvTime nptime.Time + Rune rune + StTime nptime.Time + Start image.Point + StartLocal image.Point + Typ Types + Where image.Point + WhereLocal image.Point + func (ev *Base) AsBase() *Base + func (ev *Base) ClearHandled() + func (ev *Base) Init() + func (ev *Base) SetHandled() + func (ev *Base) SetLocalOff(off image.Point) + func (ev *Base) SetModifiers(mods ...enums.BitFlag) + func (ev *Base) SetTime() + func (ev *Base) SetUnique() + func (ev Base) Clone() Event + func (ev Base) HasAllModifiers(mods ...enums.BitFlag) bool + func (ev Base) HasAnyModifier(mods ...enums.BitFlag) bool + func (ev Base) HasPos() bool + func (ev Base) IsHandled() bool + func (ev Base) IsSame(oth Event) bool + func (ev Base) IsUnique() bool + func (ev Base) KeyChord() key.Chord + func (ev Base) KeyCode() key.Codes + func (ev Base) KeyRune() rune + func (ev Base) LocalOff() image.Point + func (ev Base) Modifiers() key.Modifiers + func (ev Base) MouseButton() Buttons + func (ev Base) NeedsFocus() bool + func (ev Base) NewFromClone(typ Types) Event + func (ev Base) OnWinFocus() bool + func (ev Base) Pos() image.Point + func (ev Base) PrevDelta() image.Point + func (ev Base) PrevPos() image.Point + func (ev Base) PrevTime() time.Time + func (ev Base) SelectMode() SelectModes + func (ev Base) SincePrev() time.Duration + func (ev Base) SinceStart() time.Duration + func (ev Base) StartDelta() image.Point + func (ev Base) StartPos() image.Point + func (ev Base) StartTime() time.Time + func (ev Base) String() string + func (ev Base) Time() time.Time + func (ev Base) Type() Types + func (ev Base) WindowPos() image.Point + func (ev Base) WindowPrevPos() image.Point + func (ev Base) WindowStartPos() image.Point + type Buttons int32 + const ButtonsN + const Left + const Middle + const NoButton + const Right + func ButtonsValues() []Buttons + func (i *Buttons) SetInt64(in int64) + func (i *Buttons) SetString(s string) error + func (i *Buttons) UnmarshalText(text []byte) error + func (i Buttons) Desc() string + func (i Buttons) Int64() int64 + func (i Buttons) IsValid() bool + func (i Buttons) MarshalText() ([]byte, error) + func (i Buttons) String() string + func (i Buttons) Values() []enums.Enum + type CustomEvent struct + PosAvail bool + func (ce CustomEvent) HasPos() bool + func (ce CustomEvent) String() string + type Deque struct + Back []Event + Cond sync.Cond + Front []Event + Mu sync.Mutex + func (q *Deque) LockAndInit() + func (q *Deque) NextEvent() Event + func (q *Deque) PollEvent() (Event, bool) + func (q *Deque) Send(ev Event) + func (q *Deque) SendFirst(ev Event) + type DragDrop struct + Data any + DropMod DropMods + Source any + Target any + func NewDragDrop(typ Types, mdrag *Mouse) *DragDrop + func NewExternalDrop(typ Types, but Buttons, where image.Point, mods key.Modifiers, data any) *DragDrop + func (e *DragDrop) DefaultMod() + func (ev *DragDrop) HasPos() bool + func (ev *DragDrop) String() string + type DropMods int32 + const DropCopy + const DropIgnore + const DropLink + const DropModsN + const DropMove + const NoDropMod + func DefaultModBits(mods key.Modifiers) DropMods + func DropModsValues() []DropMods + func (i *DropMods) SetInt64(in int64) + func (i *DropMods) SetString(s string) error + func (i *DropMods) UnmarshalText(text []byte) error + func (i DropMods) Desc() string + func (i DropMods) Int64() int64 + func (i DropMods) IsValid() bool + func (i DropMods) MarshalText() ([]byte, error) + func (i DropMods) String() string + func (i DropMods) Values() []enums.Enum + type Event interface + AsBase func() *Base + Clone func() Event + HasAllModifiers func(mods ...enums.BitFlag) bool + HasAnyModifier func(mods ...enums.BitFlag) bool + HasPos func() bool + Init func() + IsHandled func() bool + IsSame func(oth Event) bool + IsUnique func() bool + KeyChord func() key.Chord + KeyCode func() key.Codes + KeyRune func() rune + LocalOff func() image.Point + Modifiers func() key.Modifiers + MouseButton func() Buttons + NeedsFocus func() bool + NewFromClone func(typ Types) Event + Pos func() image.Point + PrevDelta func() image.Point + PrevPos func() image.Point + PrevTime func() time.Time + SelectMode func() SelectModes + SetHandled func() + SetLocalOff func(off image.Point) + SetTime func() + SincePrev func() time.Duration + SinceStart func() time.Duration + StartDelta func() image.Point + StartPos func() image.Point + StartTime func() time.Time + Time func() time.Time + Type func() Types + WindowPos func() image.Point + WindowPrevPos func() image.Point + WindowStartPos func() image.Point + type EventFlags int64 + const EventFlagsN + const Handled + const Unique + func EventFlagsValues() []EventFlags + func (i *EventFlags) SetFlag(on bool, f ...enums.BitFlag) + func (i *EventFlags) SetInt64(in int64) + func (i *EventFlags) SetString(s string) error + func (i *EventFlags) SetStringOr(s string) error + func (i *EventFlags) UnmarshalText(text []byte) error + func (i EventFlags) BitIndexString() string + func (i EventFlags) Desc() string + func (i EventFlags) HasFlag(f enums.BitFlag) bool + func (i EventFlags) Int64() int64 + func (i EventFlags) IsValid() bool + func (i EventFlags) MarshalText() ([]byte, error) + func (i EventFlags) String() string + func (i EventFlags) Values() []enums.Enum + type Key struct + func NewKey(typ Types, rn rune, code key.Codes, mods key.Modifiers) *Key + func (ev *Key) HasPos() bool + func (ev *Key) NeedsFocus() bool + func (ev *Key) String() string + type Listeners map[Types][]func(ev Event) + func (ls *Listeners) Add(typ Types, fun func(Event)) + func (ls *Listeners) AddLastCall(typ Types, fun func(Event)) + func (ls *Listeners) Call(ev Event) + func (ls *Listeners) CopyFromExtra(fr Listeners) + func (ls *Listeners) Init() + type Mgr struct + Deque Deque + Last MgrState + PaintCount int + ResettingPos bool + func (em *Mgr) Custom(data any) + func (em *Mgr) DropExternal(where image.Point, md mimedata.Mimes) + func (em *Mgr) Key(typ Types, rn rune, code key.Codes, mods key.Modifiers) + func (em *Mgr) KeyChord(rn rune, code key.Codes, mods key.Modifiers) + func (em *Mgr) Magnify(scaleFactor float32, where image.Point) + func (em *Mgr) MouseButton(typ Types, but Buttons, where image.Point, mods key.Modifiers) + func (em *Mgr) MouseMove(where image.Point) + func (em *Mgr) Scroll(where image.Point, delta mat32.Vec2) + func (em *Mgr) Touch(typ Types, seq Sequence, where image.Point) + func (em *Mgr) Window(act WinActions) + func (em *Mgr) WindowPaint() + func (em *Mgr) WindowResize() + type MgrState struct + Key key.Codes + Mods key.Modifiers + MouseButton Buttons + MouseButtonType Types + MouseDownPos image.Point + MouseDownTime nptime.Time + MouseMoveTime nptime.Time + MousePos image.Point + type Mouse struct + func NewMouse(typ Types, but Buttons, where image.Point, mods key.Modifiers) *Mouse + func NewMouseDrag(but Buttons, where, prev, start image.Point, mods key.Modifiers) *Mouse + func NewMouseMove(but Buttons, where, prev image.Point, mods key.Modifiers) *Mouse + func (ev *Mouse) String() string + func (ev Mouse) HasPos() bool + type MouseScroll struct + Delta mat32.Vec2 + func NewScroll(where image.Point, delta mat32.Vec2, mods key.Modifiers) *MouseScroll + func (ev *MouseScroll) String() string + type OSEvent struct + func NewOSEvent(typ Types) *OSEvent + func (ev *OSEvent) String() string + type OSFiles struct + Files []string + func NewOSFiles(typ Types, files []string) *OSFiles + type SelectModes int32 + const ExtendContinuous + const ExtendOne + const NoSelect + const SelectModesN + const SelectOne + const SelectQuiet + const Unselect + const UnselectQuiet + func SelectModeBits(mods key.Modifiers) SelectModes + func SelectModesValues() []SelectModes + func (i *SelectModes) SetInt64(in int64) + func (i *SelectModes) SetString(s string) error + func (i *SelectModes) UnmarshalText(text []byte) error + func (i SelectModes) Desc() string + func (i SelectModes) Int64() int64 + func (i SelectModes) IsValid() bool + func (i SelectModes) MarshalText() ([]byte, error) + func (i SelectModes) String() string + func (i SelectModes) Values() []enums.Enum + type Sequence int64 + type Touch struct + Sequence Sequence + func NewTouch(typ Types, seq Sequence, where image.Point) *Touch + func (ev *Touch) HasPos() bool + func (ev *Touch) String() string + type TouchMagnify struct + ScaleFactor float32 + func NewMagnify(scaleFactor float32, where image.Point) *TouchMagnify + type Types int32 + const Change + const Click + const Close + const ContextMenu + const Custom + const DoubleClick + const DragEnter + const DragLeave + const DragMove + const DragStart + const Drop + const DropDeleteSource + const Focus + const FocusLost + const Input + const KeyChord + const KeyDown + const KeyUp + const LongHoverEnd + const LongHoverStart + const LongPressEnd + const LongPressStart + const Magnify + const MouseDown + const MouseDrag + const MouseEnter + const MouseLeave + const MouseMove + const MouseUp + const OS + const OSOpenFiles + const Rotate + const Scroll + const Select + const Show + const SlideMove + const SlideStart + const SlideStop + const TouchEnd + const TouchMove + const TouchStart + const TripleClick + const TypesN + const UnknownType + const Window + const WindowPaint + const WindowResize + func TypesValues() []Types + func (i *Types) SetInt64(in int64) + func (i *Types) SetString(s string) error + func (i *Types) UnmarshalText(text []byte) error + func (i Types) Desc() string + func (i Types) Int64() int64 + func (i Types) IsValid() bool + func (i Types) MarshalText() ([]byte, error) + func (i Types) String() string + func (i Types) Values() []enums.Enum + func (tp Types) IsDrag() bool + func (tp Types) IsKey() bool + func (tp Types) IsMouse() bool + func (tp Types) IsSlide() bool + func (tp Types) IsTouch() bool + func (tp Types) IsWindow() bool + type WinActions int32 + const NoWinAction + const ScreenUpdate + const WinActionsN + const WinClose + const WinFocus + const WinFocusLost + const WinMinimize + const WinMove + const WinShow + func WinActionsValues() []WinActions + func (i *WinActions) SetInt64(in int64) + func (i *WinActions) SetString(s string) error + func (i *WinActions) UnmarshalText(text []byte) error + func (i WinActions) Desc() string + func (i WinActions) Int64() int64 + func (i WinActions) IsValid() bool + func (i WinActions) MarshalText() ([]byte, error) + func (i WinActions) String() string + func (i WinActions) Values() []enums.Enum + type WindowEvent struct + Action WinActions + func NewWindow(act WinActions) *WindowEvent + func NewWindowPaint() *WindowEvent + func NewWindowResize() *WindowEvent + func (ev *WindowEvent) HasPos() bool + func (ev *WindowEvent) String() string