Struct Event
Represents a general event in SDL
public struct Event : ICommonEvent<Event>, ICommonEvent, ISpanFormattable, IFormattable
- Implements
- Inherited Members
Remarks
Even though SDL's *Event structures do not use inheritance (as they are all structs or ValueTypes),
you may think of Event as a common base representation of all the other *Event structures.
More specifically: all of the other *Event structures can be represented as an Event (this is usually achieved through implicit operator Event(in TSelf)), while an Event structure could potentially be represented as one of the *Event structures, depending on it's Type (this can be achieved through explicit operator TSelf(in Event), or copyless through TryAs<TEvent>(ref Event, out NullableRef<TEvent>) or TryAsReadOnly<TEvent>(ref readonly Event, out NullableRefReadOnly<TEvent>))
Associated EventTypes:
Constructors
Event(in AudioDeviceEvent)
Creates a new Event from an AudioDeviceEvent
public Event(in AudioDeviceEvent @event)
Parameters
eventAudioDeviceEventThe AudioDeviceEvent to store into the newly created Event
Event(in CameraDeviceEvent)
Creates a new Event from a CameraDeviceEvent
public Event(in CameraDeviceEvent @event)
Parameters
eventCameraDeviceEventThe CameraDeviceEvent to store into the newly created Event
Event(in ClipboardEvent)
Creates a new Event from a ClipboardEvent
public Event(in ClipboardEvent @event)
Parameters
eventClipboardEventThe ClipboardEvent to store into the newly created Event
Event(in DisplayEvent)
Creates a new Event from a DisplayEvent
public Event(in DisplayEvent @event)
Parameters
eventDisplayEventThe DisplayEvent to store into the newly created Event
Event(in DropEvent)
public Event(in DropEvent @event)
Parameters
Event(in GamepadAxisEvent)
Creates a new Event from a GamepadAxisEvent
public Event(in GamepadAxisEvent @event)
Parameters
eventGamepadAxisEventThe GamepadAxisEvent to store into the newly created Event
Event(in GamepadButtonEvent)
Creates a new Event from a GamepadButtonEvent
public Event(in GamepadButtonEvent @event)
Parameters
eventGamepadButtonEventThe GamepadButtonEvent to store into the newly created Event
Event(in GamepadDeviceEvent)
Creates a new Event from a GamepadDeviceEvent
public Event(in GamepadDeviceEvent @event)
Parameters
eventGamepadDeviceEventThe GamepadDeviceEvent to store into the newly created Event
Event(in GamepadSensorEvent)
Creates a new Event from a GamepadSensorEvent
public Event(in GamepadSensorEvent @event)
Parameters
eventGamepadSensorEventThe GamepadSensorEvent to store into the newly created Event
Event(in GamepadTouchpadEvent)
Creates a new Event from a GamepadTouchpadEvent
public Event(in GamepadTouchpadEvent @event)
Parameters
eventGamepadTouchpadEventThe GamepadTouchpadEvent to store into the newly created Event
Event(in JoyAxisEvent)
Creates a new Event from a JoyAxisEvent
public Event(in JoyAxisEvent @event)
Parameters
eventJoyAxisEventThe JoyAxisEvent to store into the newly created Event
Event(in JoyBallEvent)
Creates a new Event from a JoyBallEvent
public Event(in JoyBallEvent @event)
Parameters
eventJoyBallEventThe JoyBallEvent to store into the newly created Event
Event(in JoyBatteryEvent)
Creates a new Event from a JoyBatteryEvent
public Event(in JoyBatteryEvent @event)
Parameters
eventJoyBatteryEventThe JoyBatteryEvent to store into the newly created Event
Event(in JoyButtonEvent)
Creates a new Event from a JoyButtonEvent
public Event(in JoyButtonEvent @event)
Parameters
eventJoyButtonEventThe JoyButtonEvent to store into the newly created Event
Event(in JoyDeviceEvent)
Creates a new Event from a JoyDeviceEvent
public Event(in JoyDeviceEvent @event)
Parameters
eventJoyDeviceEventThe JoyDeviceEvent to store into the newly created Event
Event(in JoyHatEvent)
Creates a new Event from a JoyHatEvent
public Event(in JoyHatEvent @event)
Parameters
eventJoyHatEventThe JoyHatEvent to store into the newly created Event
Event(in KeyboardDeviceEvent)
Creates a new Event from a KeyboardDeviceEvent
public Event(in KeyboardDeviceEvent @event)
Parameters
eventKeyboardDeviceEventThe KeyboardDeviceEvent to store into the newly created Event
Event(in KeyboardEvent)
Creates a new Event from a KeyboardEvent
public Event(in KeyboardEvent @event)
Parameters
eventKeyboardEventThe KeyboardEvent to store into the newly created Event
Event(in MouseButtonEvent)
Creates a new Event from a MouseButtonEvent
public Event(in MouseButtonEvent @event)
Parameters
eventMouseButtonEventThe MouseButtonEvent to store into the newly created Event
Event(in MouseDeviceEvent)
Creates a new Event from a MouseDeviceEvent
public Event(in MouseDeviceEvent @event)
Parameters
eventMouseDeviceEventThe MouseDeviceEvent to store into the newly created Event
Event(in MouseMotionEvent)
Creates a new Event from a MouseMotionEvent
public Event(in MouseMotionEvent @event)
Parameters
eventMouseMotionEventThe MouseMotionEvent to store into the newly created Event
Event(in MouseWheelEvent)
Creates a new Event from a MouseWheelEvent
public Event(in MouseWheelEvent @event)
Parameters
eventMouseWheelEventThe MouseWheelEvent to store into the newly created Event
Event(in PenAxisEvent)
Creates a new Event from a PenAxisEvent
public Event(in PenAxisEvent @event)
Parameters
eventPenAxisEventThe PenAxisEvent to store into the newly created Event
Event(in PenButtonEvent)
Creates a new Event from a PenButtonEvent
public Event(in PenButtonEvent @event)
Parameters
eventPenButtonEventThe PenButtonEvent to store into the newly created Event
Event(in PenMotionEvent)
Creates a new Event from a PenMotionEvent
public Event(in PenMotionEvent @event)
Parameters
eventPenMotionEventThe PenMotionEvent to store into the newly created Event
Event(in PenProximityEvent)
Creates a new Event from a PenProximityEvent
public Event(in PenProximityEvent @event)
Parameters
eventPenProximityEventThe PenProximityEvent to store into the newly created Event
Event(in PenTouchEvent)
Creates a new Event from a PenTouchEvent
public Event(in PenTouchEvent @event)
Parameters
eventPenTouchEventThe PenTouchEvent to store into the newly created Event
Event(in PinchFingerEvent)
Creates a new Event from a PinchFingerEvent
public Event(in PinchFingerEvent @event)
Parameters
eventPinchFingerEventThe PinchFingerEvent to store into the newly created Event
Event(in QuitEvent)
public Event(in QuitEvent @event)
Parameters
Event(in RenderEvent)
Creates a new Event from a RenderEvent
public Event(in RenderEvent @event)
Parameters
eventRenderEventThe RenderEvent to store into the newly created Event
Event(in SensorEvent)
Creates a new Event from a SensorEvent
public Event(in SensorEvent @event)
Parameters
eventSensorEventThe SensorEvent to store into the newly created Event
Event(in TextEditingCandidatesEvent)
Creates a new Event from a TextEditingCandidatesEvent
public Event(in TextEditingCandidatesEvent @event)
Parameters
eventTextEditingCandidatesEventThe TextEditingCandidatesEvent to store into the newly created Event
Event(in TextEditingEvent)
Creates a new Event from a TextEditingEvent
public Event(in TextEditingEvent @event)
Parameters
eventTextEditingEventThe TextEditingEvent to store into the newly created Event
Event(in TextInputEvent)
Creates a new Event from a TextInputEvent
public Event(in TextInputEvent @event)
Parameters
eventTextInputEventThe TextInputEvent to store into the newly created Event
Event(in TouchFingerEvent)
Creates a new Event from a TouchFingerEvent
public Event(in TouchFingerEvent @event)
Parameters
eventTouchFingerEventThe TouchFingerEvent to store into the newly created Event
Event(in UserEvent)
public Event(in UserEvent @event)
Parameters
Event(in WindowEvent)
Creates a new Event from an WindowEvent
public Event(in WindowEvent @event)
Parameters
eventWindowEventThe WindowEvent to store into the newly created Event
Properties
Timestamp
Gets or sets the timestamp of the current event
public ulong Timestamp { readonly get; set; }
Property Value
- ulong
The timestamp of the current event, in nanoseconds in nanoseconds since the initialization of SDL
Remarks
The value of this property usually describes the time passed, in nanoseconds since the initialization of SDL. It can be properly populated by using NanosecondTicks.
Type
Gets or sets the type of the current event
public EventType Type { readonly get; set; }
Property Value
Remarks
Do not attempt to set this property on a base Event, instead set the Type property on an instance of a more specialized *Event structure. Setting this property on a base Event is not supported and will lead the property to throw a NotSupportedException.
Exceptions
- NotSupportedException
When setting this property
Methods
ToString()
Returns the fully qualified type name of this instance.
public override readonly string ToString()
Returns
- string
The fully qualified type name.
ToString(IFormatProvider?)
Formats the value of the current instance using the specified format.
public readonly string ToString(IFormatProvider? formatProvider)
Parameters
formatProviderIFormatProviderThe provider to use to format the value.
-or-
A null reference (
Nothingin Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
The value of the current instance in the specified format.
ToString(string?)
Formats the value of the current instance using the specified format.
public readonly string ToString(string? format)
Parameters
formatstringThe format to use.
-or-
A null reference (
Nothingin Visual Basic) to use the default format defined for the type of the IFormattable implementation.
Returns
- string
The value of the current instance in the specified format.
ToString(string?, IFormatProvider?)
Formats the value of the current instance using the specified format.
public readonly string ToString(string? format, IFormatProvider? formatProvider)
Parameters
formatstringThe format to use.
-or-
A null reference (
Nothingin Visual Basic) to use the default format defined for the type of the IFormattable implementation.formatProviderIFormatProviderThe provider to use to format the value.
-or-
A null reference (
Nothingin Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
The value of the current instance in the specified format.
TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)
Tries to format the value of the current instance into the provided span of characters.
public readonly bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)
Parameters
destinationSpan<char>The span in which to write this instance's value formatted as a span of characters.
charsWrittenintWhen this method returns, contains the number of characters that were written in
destination.formatReadOnlySpan<char>A span containing the characters that represent a standard or custom format string that defines the acceptable format for
destination.providerIFormatProviderAn optional object that supplies culture-specific formatting information for
destination.