Documentation ¶
Overview ¶
Package eventx attempts to provide a concrete go type for different events related to the DOM. Not all the events and their functionality can be supported. It exists has a package to allow access to this events without any tie into the corresponding js primitive. If you prefer a fuller support. Use GopherJS (https://github.com/gopherjs/gopherjs).
Index ¶
- Constants
- type AnimationEvent
- type AudioBuffer
- type AudioProcessingEvent
- type BaseEvent
- type BasicEventMap
- type BeforeInputEvent
- type BeforeUnloadEvent
- type BlobEvent
- type Button
- type CSSFontFaceLoadEvent
- type ChangeEvent
- type ClipboardEvent
- type CloseEvent
- type CompositionEvent
- type CustomEvent
- type DOMTransactionEvent
- type DataTransfer
- type DataTransferItem
- type DataTransferItemList
- type DeltaMode
- type DeviceLightEvent
- type DeviceMotionEvent
- type DeviceOrientationEvent
- type DeviceProximityEvent
- type DragEndEvent
- type DragEnterEvent
- type DragEvent
- type DragExitEvent
- type DragLeaveEvent
- type DragOverEvent
- type DragStartEvent
- type DropEvent
- type EditingBeforeInputEvent
- type Element
- type ErrorEvent
- type FetchEvent
- type FocusEvent
- type Gamepad
- type GamepadEvent
- type HashChangeEvent
- type IDBVersionChangeEvent
- type InputDeviceCapabilities
- type InputEvent
- type KeyCode
- type KeyLocation
- type KeyboardEvent
- type MediaAudioTrackSettings
- type MediaStream
- type MediaStreamEvent
- type MediaStreamTrack
- type MediaTrackSettings
- type MediaVideoTrackSettings
- type MessageEvent
- type MotionData
- type MouseEvent
- type MutationEvent
- type MutationRecord
- type OfflineAudioCompletionEvent
- type PageTransitionEvent
- type PointerEvent
- type PopStateEvent
- type ProgressEvent
- type RTCIdentityEvent
- type RTCPeerConnectionIceEvent
- type RelatedEvent
- type RotationData
- type SVGEvent
- type SVGZoomEvent
- type SensorEvent
- type StorageEvent
- type TimeEvent
- type Touch
- type TouchEvent
- type TouchList
- type TrackEvent
- type TransitionEvent
- type UIEvent
- type UserProximityEvent
- type WebGLContextEvent
- type WheelEvent
Constants ¶
const ( // DeltaPixel defines the mouse movement state. DeltaPixel = 0 // DeltaLine defines the mouse movement state. DeltaLine = 1 // DeltaPage defines the mouse movement state. DeltaPage = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnimationEvent ¶
type AnimationEvent struct { Core interface{} `json:"-"` AnimationName string PseudoElement string ElapsedTime float64 }
AnimationEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type AudioBuffer ¶
type AudioBuffer struct { SampleRate float64 Duration time.Duration Channels int SampleFramesLength int ChannelData [][]byte }
AudioBuffer defines a struct to represent the buffer associated with with a giving AudioProcessingEvent. When copying channel data from javascript ensure to follow this: myArrayBuffer.copyFromChannel(destination,channelNumber,startInChannel); Where: destination => the array buffer channelNumber => channel number (starts from 0....totalChannels) startInChannel => index of internal channel array var myArrayBuffer = audioCtx.createBuffer(2, frameCount, audioCtx.sampleRate); var anotherArray = new Float32Array; myArrayBuffer.copyFromChannel(anotherArray,1,0);
type AudioProcessingEvent ¶
type AudioProcessingEvent struct { Core interface{} `json:"-"` PlaybackTime float64 InputBuffer AudioBuffer OutputBuffer AudioBuffer }
AudioProcessingEvent defines a struct to contain the values of a promiximity event fired from a giving DOM. Deprecated Event.
type BaseEvent ¶
type BaseEvent struct { Core interface{} `json:"-"` // contains filtered or unexported fields }
BaseEvent defines the standard event returned to wrap a core event.
func GetEvent ¶
func GetEvent() *BaseEvent
GetEvent returns the base event type expected from the provided value.
func NewBaseEvent ¶
NewBaseEvent returns a new instance of the base evet.
func (*BaseEvent) RemoveEvent ¶
func (b *BaseEvent) RemoveEvent()
RemoveEvent calls the finalizer of the giving event.
func (*BaseEvent) Underlying ¶
func (b *BaseEvent) Underlying() interface{}
Underlying returns the core event object returned by the base.
type BasicEventMap ¶
BasicEventMap defines a event type which defines a event type which is not supported by this package.
type BeforeInputEvent ¶
type BeforeInputEvent struct {
Core interface{} `json:"-"`
}
BeforeInputEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type BeforeUnloadEvent ¶
type BeforeUnloadEvent struct {
Core interface{} `json:"-"`
}
BeforeUnloadEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type BlobEvent ¶
type BlobEvent struct { Core interface{} `json:"-"` Data []byte }
BlobEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type CSSFontFaceLoadEvent ¶
type CSSFontFaceLoadEvent struct {
Core interface{} `json:"-"`
}
CSSFontFaceLoadEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type ChangeEvent ¶
type ChangeEvent struct { Core interface{} `json:"-"` Value string }
ChangeEvent represents the data passed in a onchange event.
type ClipboardEvent ¶
type ClipboardEvent struct { Core interface{} `json:"-"` Data DataTransfer }
ClipboardEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type CloseEvent ¶
CloseEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type CompositionEvent ¶
CompositionEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type CustomEvent ¶
type CustomEvent struct { Core interface{} `json:"-"` Detail interface{} }
CustomEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DOMTransactionEvent ¶
type DOMTransactionEvent struct {
Core interface{} `json:"-"`
}
DOMTransactionEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DataTransfer ¶
type DataTransfer struct { DropEffect string EffectAllowed string Files []DataTransferItem Items DataTransferItemList Types []string }
DataTransfer defines a struct to represent the data retrieved from the data transfer object.
type DataTransferItem ¶
DataTransferItem defines a DataTransferItem file item.
type DataTransferItemList ¶
type DataTransferItemList struct {
Items []DataTransferItem
}
DataTransferItemList defines a struct which contains a list of DataTransferItems.
type DeltaMode ¶
type DeltaMode uint64
DeltaMode is an indication of the units of measurement for a delta value.
type DeviceLightEvent ¶
type DeviceLightEvent struct { Core interface{} `json:"-"` Value float64 }
DeviceLightEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DeviceMotionEvent ¶
type DeviceMotionEvent struct { Core interface{} `json:"-"` Interval float64 Acceleration MotionData AccelerationIncludingGravity MotionData RotationRate RotationData }
DeviceMotionEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DeviceOrientationEvent ¶
type DeviceOrientationEvent struct { Core interface{} `json:"-"` Absolute bool Alpha float64 Beta float64 Gamma float64 }
DeviceOrientationEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DeviceProximityEvent ¶
type DeviceProximityEvent struct { Core interface{} `json:"-"` Max float64 Min float64 Value float64 }
DeviceProximityEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DragEndEvent ¶
type DragEndEvent struct { *MouseEvent Core interface{} `json:"-"` DataTransfer DataTransfer }
DragEndEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DragEnterEvent ¶
type DragEnterEvent struct { *MouseEvent Core interface{} `json:"-"` DataTransfer DataTransfer }
DragEnterEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DragEvent ¶
type DragEvent struct { *MouseEvent Core interface{} `json:"-"` DataTransfer DataTransfer }
DragEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DragExitEvent ¶
type DragExitEvent struct { *MouseEvent Core interface{} `json:"-"` DataTransfer DataTransfer }
DragExitEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DragLeaveEvent ¶
type DragLeaveEvent struct { *MouseEvent Core interface{} `json:"-"` DataTransfer DataTransfer }
DragLeaveEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DragOverEvent ¶
type DragOverEvent struct { *MouseEvent Core interface{} `json:"-"` DataTransfer DataTransfer }
DragOverEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DragStartEvent ¶
type DragStartEvent struct { *MouseEvent Core interface{} `json:"-"` DataTransfer DataTransfer }
DragStartEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type DropEvent ¶
type DropEvent struct { *MouseEvent Core interface{} `json:"-"` DataTransfer DataTransfer }
DropEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type EditingBeforeInputEvent ¶
type EditingBeforeInputEvent struct {
Core interface{} `json:"-"`
}
EditingBeforeInputEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type Element ¶
type Element string
Element defines a string type which contains the markup of the giving element.
type ErrorEvent ¶
type ErrorEvent struct { Core interface{} `json:"-"` Message string Filename string LineNumber int ColNumber int Error error }
ErrorEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type FetchEvent ¶
type FetchEvent struct { Core interface{} `json:"-"` IsReload bool Request cache.Request ClientID string }
FetchEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type FocusEvent ¶
type FocusEvent struct {
Core interface{} `json:"-"`
}
FocusEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type Gamepad ¶
type Gamepad struct { DisplayID string ID string Index int Mapping string Connected bool Buttons []Button Axes []float64 Timestamp float64 }
Gamepad defines a struct which holds the gamepad object porperties.
type GamepadEvent ¶
type GamepadEvent struct { Core interface{} `json:"-"` Gamepad Gamepad }
GamepadEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type HashChangeEvent ¶
HashChangeEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type IDBVersionChangeEvent ¶
IDBVersionChangeEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type InputDeviceCapabilities ¶
type InputDeviceCapabilities struct {
FiresTouchEvent bool
}
InputDeviceCapabilities defines a struct to contain input capbilities for a inputtype.
type InputEvent ¶
InputEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type KeyCode ¶
type KeyCode uint8
KeyCode represents a system and implementation dependent numerical code identifying the unmodified value of the pressed key.
const ( KeyBackspace KeyCode = 8 KeyTab KeyCode = 9 KeyEnter KeyCode = 13 KeyShift KeyCode = 16 KeyCtrl KeyCode = 17 KeyAlt KeyCode = 18 KeyPauseBreak KeyCode = 19 KeyCapsLock KeyCode = 20 KeyEsc KeyCode = 27 KeySpace KeyCode = 32 KeyPageUp KeyCode = 33 KeyPageDown KeyCode = 34 KeyEnd KeyCode = 35 KeyHome KeyCode = 36 KeyLeft KeyCode = 37 KeyUp KeyCode = 38 KeyRight KeyCode = 39 KeyDown KeyCode = 40 KeyPrintScreen KeyCode = 44 KeyInsert KeyCode = 45 KeyDelete KeyCode = 46 Key0 KeyCode = 48 Key1 KeyCode = 49 Key2 KeyCode = 50 Key3 KeyCode = 51 Key4 KeyCode = 52 Key5 KeyCode = 53 Key6 KeyCode = 54 Key7 KeyCode = 55 Key8 KeyCode = 56 Key9 KeyCode = 57 KeyA KeyCode = 65 KeyB KeyCode = 66 KeyC KeyCode = 67 KeyD KeyCode = 68 KeyE KeyCode = 69 KeyF KeyCode = 70 KeyG KeyCode = 71 KeyH KeyCode = 72 KeyI KeyCode = 73 KeyJ KeyCode = 74 KeyK KeyCode = 75 KeyL KeyCode = 76 KeyM KeyCode = 77 KeyN KeyCode = 78 KeyO KeyCode = 79 KeyP KeyCode = 80 KeyQ KeyCode = 81 KeyR KeyCode = 82 KeyS KeyCode = 83 KeyT KeyCode = 84 KeyU KeyCode = 85 KeyV KeyCode = 86 KeyW KeyCode = 87 KeyX KeyCode = 88 KeyY KeyCode = 88 KeyZ KeyCode = 90 KeyMeta KeyCode = 91 KeyMenu KeyCode = 93 KeyNumPad0 KeyCode = 96 KeyNumPad1 KeyCode = 97 KeyNumPad2 KeyCode = 98 KeyNumPad3 KeyCode = 99 KeyNumPad4 KeyCode = 100 KeyNumPad5 KeyCode = 101 KeyNumPad6 KeyCode = 102 KeyNumPad7 KeyCode = 103 KeyNumPad8 KeyCode = 104 KeyNumPad9 KeyCode = 105 KeyNumPadMult KeyCode = 106 KeyNumPadPlus KeyCode = 107 KeyNumPadMin KeyCode = 109 KeyNumPadDot KeyCode = 110 KeyNumPadDecimal KeyCode = 111 KeyF1 KeyCode = 112 KeyF2 KeyCode = 113 KeyF3 KeyCode = 114 KeyF4 KeyCode = 115 KeyF5 KeyCode = 116 KeyF6 KeyCode = 117 KeyF7 KeyCode = 118 KeyF8 KeyCode = 119 KeyF9 KeyCode = 120 KeyF10 KeyCode = 121 KeyF11 KeyCode = 122 KeyF12 KeyCode = 123 KeyNumLock KeyCode = 144 KeyMute KeyCode = 173 KeyVolumeDown KeyCode = 174 KeyVolumeUp KeyCode = 175 KeySemicolon KeyCode = 186 KeyEqual KeyCode = 187 KeyComa KeyCode = 188 KeyDash KeyCode = 189 KeyDot KeyCode = 190 KeySlash KeyCode = 191 KeyBackquote KeyCode = 192 KeySquareBracketLeft KeyCode = 219 KeyBackslash KeyCode = 220 KeySquareBracketRight KeyCode = 221 KeyQuote KeyCode = 222 )
Keyboard keys.
type KeyLocation ¶
type KeyLocation uint8
KeyLocation represents the location of the key on the keyboard or other input device.
const ( KeyLocationStandard KeyLocation = iota KeyLocationLeft KeyLocationRight KeyLocationNumpad )
Keyboard locations constants.
type KeyboardEvent ¶
type KeyboardEvent struct { Core interface{} `json:"-"` CharCode int KeyCode KeyCode KeyLocation KeyLocation Location int Key string KeyIdentifier string Locale string AltKey bool CtrlKey bool MetaKey bool ShiftKey bool Repeat bool ModifiedState bool }
KeyboardEvent represents data fired when the keyboard is used.
type MediaAudioTrackSettings ¶
type MediaAudioTrackSettings struct { MediaTrackSettings ChannelCount int EchoCancellation bool Latency float64 SampleRate int64 SampleSize int64 Volume float64 }
MediaAudioTrackSettings defines the struct which contains settiings for the MediaTrack API.
type MediaStream ¶
type MediaStream struct { Active bool Ended bool ID string Audios []MediaStreamTrack Videos []MediaStreamTrack }
MediaStream defines a struct for the media stream event. API: MediaStream.onaddtrack, MediaStream.onremovetrack. API: MediaStream.getTracks, MediaStream.getAudioTracks, MediaStream.getVideoTracks.
type MediaStreamEvent ¶
type MediaStreamEvent struct { Core interface{} `json:"-"` Stream MediaStream }
MediaStreamEvent defines a struct to contain the values of a promiximity event fired from a giving DOM. When using this combine them with the MediaStreamTrack.
type MediaStreamTrack ¶
type MediaStreamTrack struct { Core interface{} `json:"-"` Enabled bool ID string Kind string Label string Muted bool ReadyState bool Remote bool AudioSettings *MediaAudioTrackSettings VideoSettings *MediaVideoTrackSettings }
MediaStreamTrack defines a track of a MediaStream.
type MediaTrackSettings ¶
MediaTrackSettings defines the struct which contains settiings for the MediaTrack API.
type MediaVideoTrackSettings ¶
type MediaVideoTrackSettings struct { MediaTrackSettings AspectRatio float64 FacingMode string FrameRate float64 Height int64 Width int64 }
MediaVideoTrackSettings defines the struct which contains settiings for the MediaTrack API.
type MessageEvent ¶
type MessageEvent struct { Core interface{} `json:"-"` Data []byte Origin string Source string Port int }
MessageEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type MotionData ¶
MotionData defines a struct contain motion data.
type MouseEvent ¶
type MouseEvent struct { *UIEvent Core interface{} `json:"-"` ClientX float64 ClientY float64 PageX float64 PageY float64 OffsetX float64 OffsetY float64 ScreenX float64 ScreenY float64 MovemenX float64 MovemenY float64 Region int Button int Detail int AltKey bool CtrlKey bool MetaKey bool ShiftKey bool }
MouseEvent represents data fired when interacting with a pointing device (such as a mouse).
type MutationEvent ¶
type MutationEvent struct {
Core interface{} `json:"-"`
}
MutationEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type MutationRecord ¶
type MutationRecord struct { Type string AddedNodes []Element RemovedNodes []Element PreSibling Element NextSibling Element AttributeName string AttributreNameNS string }
MutationRecord defines a struct to contain the values of a promiximity event fired from a giving DOM.
type OfflineAudioCompletionEvent ¶
type OfflineAudioCompletionEvent struct { Core interface{} `json:"-"` RenderedBuffer AudioBuffer }
OfflineAudioCompletionEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type PageTransitionEvent ¶
type PageTransitionEvent struct { Core interface{} `json:"-"` Persisted bool }
PageTransitionEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type PointerEvent ¶
type PointerEvent struct { Core interface{} `json:"-"` PointerID int Width int Height int Pressure float64 TiltX float64 TiltY float64 IsPrimary bool PointerType string }
PointerEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type PopStateEvent ¶
type PopStateEvent struct {
Core interface{} `json:"-"`
}
PopStateEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type ProgressEvent ¶
type ProgressEvent struct { Core interface{} `json:"-"` LengthComputable bool Loaded uint64 Total int }
ProgressEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type RTCIdentityEvent ¶
type RTCIdentityEvent struct { Core interface{} `json:"-"` Assertion string }
RTCIdentityEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type RTCPeerConnectionIceEvent ¶
type RTCPeerConnectionIceEvent struct { Core interface{} `json:"-"` Candidate string }
RTCPeerConnectionIceEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type RelatedEvent ¶
type RelatedEvent struct { Core interface{} `json:"-"` RelatedTarget Element }
RelatedEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type RotationData ¶
RotationData defines a struct contain motion data.
type SVGEvent ¶
type SVGEvent struct {
Core interface{} `json:"-"`
}
SVGEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type SVGZoomEvent ¶
type SVGZoomEvent struct {
Core interface{} `json:"-"`
}
SVGZoomEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type SensorEvent ¶
type SensorEvent struct {
Core interface{} `json:"-"`
}
SensorEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type StorageEvent ¶
type StorageEvent struct { Core interface{} `json:"-"` Key string NewValue string OldValue string URL string StorageArea interface{} }
StorageEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type TimeEvent ¶
type TimeEvent struct { Core interface{} `json:"-"` Long interface{} AbstractView interface{} }
TimeEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type Touch ¶
type Touch struct { Identifier float64 ClientX float64 ClientY float64 PageX float64 PageY float64 OffsetX float64 OffsetY float64 ScreenX float64 ScreenY float64 Target Element }
Touch defines a struct which holds touch list data related to touch events.
type TouchEvent ¶
type TouchEvent struct { Core interface{} `json:"-"` AltKey bool CtrlKey bool MetaKey bool ShiftKey bool TargetTouches TouchList Touches TouchList }
TouchEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type TrackEvent ¶
type TrackEvent struct {
Core interface{} `json:"-"`
}
TrackEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type TransitionEvent ¶
type TransitionEvent struct { Core interface{} `json:"-"` PropertyName string ElapsedTime float64 PseudoElement string }
TransitionEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type UIEvent ¶
type UIEvent struct { Core interface{} `json:"-"` IsChar bool LayerX float64 LayerY float64 PageX float64 PageY float64 Detail int SourceCapabilities *InputDeviceCapabilities }
UIEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type UserProximityEvent ¶
type UserProximityEvent struct { Core interface{} `json:"-"` Near bool }
UserProximityEvent defines a struct to contain the values of a promiximity event fired from a giving DOM.
type WebGLContextEvent ¶
type WebGLContextEvent struct {
StatusMessage string
}
WebGLContextEvent represents data fired when a wheel button of a pointing device (usually a mouse) is rotated.