event

package
v1.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CPIPrimary   = CopyPasteIndex(CIPrimary)
	CPIClipboard = CopyPasteIndex(CIClipboard)
)
View Source
const (
	ModNum   = Mod2 // TODO: rename ModNumLock
	ModAlt   = Mod1
	ModAltGr = Mod5
)

Variables

View Source
var UseMultiKey = false

Functions

func ComposeDiacritic

func ComposeDiacritic(ks *KeySym, ru *rune) (isLatch bool)

Types

type ClipboardIndex added in v1.1.0

type ClipboardIndex int
const (
	CIPrimary ClipboardIndex = iota
	CIClipboard
)

type CopyPasteIndex deprecated

type CopyPasteIndex int

Deprecated: in favor of ClipboardIndex

type Cursor

type Cursor int
const (
	NoneCursor Cursor = iota // none means not set
	DefaultCursor
	NSResizeCursor
	WEResizeCursor
	CloseCursor
	MoveCursor
	PointerCursor
	BeamCursor // text cursor
	WaitCursor // watch cursor
)

type DndAction

type DndAction int
const (
	DndADeny DndAction = iota
	DndACopy
	DndAMove
	DndALink
	DndAAsk
	DndAPrivate
)

type DndDrop

type DndDrop struct {
	Point       image.Point
	ReplyAccept func(bool)
	RequestData func(DndType) ([]byte, error)
}

type DndPosition

type DndPosition struct {
	Point image.Point
	Types []DndType
	Reply func(DndAction)
}

type DndType

type DndType int
const (
	TextURLListDndT DndType = iota // a list separated by '\n'
)

type Event added in v1.1.0

type Event any

type Handled

type Handled bool

type KeyDown

type KeyDown struct {
	Point   image.Point
	KeySym  KeySym
	Mods    KeyModifiers
	Buttons MouseButtons
	Rune    rune
}

type KeyModifiers

type KeyModifiers uint16
const (
	// TODO: rename to KMod
	ModNone  KeyModifiers = 0
	ModShift KeyModifiers = 1 << (iota - 1)
	ModLock               // caps // TODO: rename ModCapsLock
	ModCtrl
	Mod1 // ~ alt
	Mod2 // ~ num lock
	Mod3
	Mod4 // ~ windows key
	Mod5 // ~ alt gr
)

func (KeyModifiers) ClearLocks

func (km KeyModifiers) ClearLocks() KeyModifiers

func (KeyModifiers) HasAny

func (km KeyModifiers) HasAny(m KeyModifiers) bool

func (KeyModifiers) Is

func (km KeyModifiers) Is(m KeyModifiers) bool

type KeySym

type KeySym int
const (
	KSymNone KeySym = 0

	// let ascii codes keep their values (adding 256 ensures gap)
	KSym_dummy_ KeySym = 256 + iota

	KSym0
	KSym1
	KSym2
	KSym3
	KSym4
	KSym5
	KSym6
	KSym7
	KSym8
	KSym9

	KSymA
	KSymB
	KSymC
	KSymD
	KSymE
	KSymF
	KSymG
	KSymH
	KSymI
	KSymJ
	KSymK
	KSymL
	KSymM
	KSymN
	KSymO
	KSymP
	KSymQ
	KSymR
	KSymS
	KSymT
	KSymU
	KSymV
	KSymW
	KSymX
	KSymY
	KSymZ

	KSymSpace
	KSymBackspace
	KSymReturn
	KSymEscape
	KSymHome
	KSymLeft
	KSymUp
	KSymRight
	KSymDown
	KSymPageUp
	KSymPageDown
	KSymEnd
	KSymInsert
	KSymShiftL
	KSymShiftR
	KSymControlL
	KSymControlR
	KSymAltL
	KSymAltR
	KSymAltGr
	KSymSuperL // windows key
	KSymSuperR
	KSymDelete
	KSymTab
	KSymTabLeft

	KSymNumLock
	KSymCapsLock  // only capitalizes letters
	KSymShiftLock // prints all keys secondary symbols

	KSymExclam      // !
	KSymDoubleQuote // "
	KSymNumberSign  // #
	KSymDollar      // $
	KSymPercent     // %
	KSymAmpersand   // &
	KSymApostrophe  // '
	KSymParentL     // (
	KSymParentR     // )
	KSymAsterisk    // *
	KSymPlus        // +
	KSymComma       // ,
	KSymMinus       // -
	KSymPeriod      // .
	KSymSlash       // /
	KSymBackSlash   // \
	KSymColon       // :
	KSymSemicolon   // ;
	KSymLess        // <
	KSymEqual       // =
	KSymGreater     // >
	KSymQuestion    // ?
	KSymAt          // @
	KSymBracketL    // [
	KSymBracketR    // ]

	KSymGrave      // `
	KSymAcute      // ´
	KSymCircumflex // ^
	KSymTilde      // ~
	KSymCedilla    // ¸
	KSymBreve      // ˘
	KSymCaron      // ˇ
	KSymDiaresis   // ¨
	KSymRingAbove  // ˚
	KSymMacron     // ¯

	KSymF1
	KSymF2
	KSymF3
	KSymF4
	KSymF5
	KSymF6
	KSymF7
	KSymF8
	KSymF9
	KSymF10
	KSymF11
	KSymF12
	KSymF13
	KSymF14
	KSymF15
	KSymF16

	KSymKeypad0
	KSymKeypad1
	KSymKeypad2
	KSymKeypad3
	KSymKeypad4
	KSymKeypad5
	KSymKeypad6
	KSymKeypad7
	KSymKeypad8
	KSymKeypad9
	KSymKeypadMultiply
	KSymKeypadAdd
	KSymKeypadSubtract
	KSymKeypadDecimal
	KSymKeypadDivide

	KSymVolumeUp
	KSymVolumeDown
	KSymMute

	KSymMultiKey
	KSymMenu
)

func (KeySym) String

func (i KeySym) String() string

type KeyUp

type KeyUp struct {
	Point   image.Point
	KeySym  KeySym
	Mods    KeyModifiers
	Buttons MouseButtons
	Rune    rune
}

type MouseButton

type MouseButton uint16
const (
	ButtonNone MouseButton = 0
	ButtonLeft MouseButton = 1 << (iota - 1)
	ButtonMiddle
	ButtonRight
	ButtonWheelUp
	ButtonWheelDown
	ButtonWheelLeft
	ButtonWheelRight
	ButtonBackward // TODO: rename X1?
	ButtonForward  // TODO: rename X2?
)

type MouseButtons

type MouseButtons uint16

func (MouseButtons) Has

func (mb MouseButtons) Has(b MouseButton) bool

func (MouseButtons) HasAny

func (mb MouseButtons) HasAny(bs MouseButtons) bool

func (MouseButtons) Is

func (mb MouseButtons) Is(b MouseButton) bool

type MouseClick

type MouseClick struct {
	Point   image.Point
	Button  MouseButton
	Buttons MouseButtons // contains Button
	Mods    KeyModifiers
}

type MouseDoubleClick

type MouseDoubleClick struct {
	Point   image.Point
	Button  MouseButton
	Buttons MouseButtons // contains Button
	Mods    KeyModifiers
}

type MouseDown

type MouseDown struct {
	Point   image.Point
	Button  MouseButton
	Buttons MouseButtons // contains Button
	Mods    KeyModifiers
}

type MouseDragEnd

type MouseDragEnd struct {
	Point   image.Point
	Button  MouseButton
	Buttons MouseButtons // contains Button
	Mods    KeyModifiers
}

type MouseDragMove

type MouseDragMove struct {
	Point   image.Point
	Buttons MouseButtons
	Mods    KeyModifiers
}

type MouseDragStart

type MouseDragStart struct {
	Point   image.Point // starting (press) point (older then point2)
	Point2  image.Point // current point (move detection) (newest point)
	Button  MouseButton
	Buttons MouseButtons // contains Button
	Mods    KeyModifiers
}

type MouseEnter

type MouseEnter struct{}

type MouseLeave

type MouseLeave struct{}

type MouseMove

type MouseMove struct {
	Point   image.Point
	Buttons MouseButtons
	Mods    KeyModifiers
}

type MouseTripleClick

type MouseTripleClick struct {
	Point   image.Point
	Button  MouseButton
	Buttons MouseButtons // contains Button
	Mods    KeyModifiers
}

type MouseUp

type MouseUp struct {
	Point   image.Point
	Button  MouseButton
	Buttons MouseButtons // contains Button
	Mods    KeyModifiers
}

type ReqClipboardDataGet added in v1.1.0

type ReqClipboardDataGet struct {
	Index  ClipboardIndex
	ReplyS string
}

type ReqClipboardDataSet added in v1.1.0

type ReqClipboardDataSet struct {
	Index ClipboardIndex
	Str   string
}

type ReqClose added in v1.1.0

type ReqClose struct{}

type ReqCursorSet added in v1.1.0

type ReqCursorSet struct{ Cursor Cursor }

type ReqImage added in v1.1.0

type ReqImage struct{ ReplyImg draw.Image }

type ReqImagePut added in v1.1.0

type ReqImagePut struct{ Rect image.Rectangle }

type ReqImageResize added in v1.1.0

type ReqImageResize struct{ Rect image.Rectangle }

type ReqPointerQuery added in v1.1.0

type ReqPointerQuery struct{ ReplyP image.Point }

type ReqPointerWarp added in v1.1.0

type ReqPointerWarp struct{ P image.Point }

type ReqWindowSetName added in v1.1.0

type ReqWindowSetName struct{ Name string }

type Request added in v1.1.0

type Request any

type WindowClose

type WindowClose struct{}

type WindowExpose

type WindowExpose struct{ Rect image.Rectangle } // empty = full area

type WindowInput

type WindowInput struct {
	Point image.Point
	Event Event
}

type WindowResize

type WindowResize struct{ Rect image.Rectangle }

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL