Table of Contents

Class EventType

Namespace
Gym.Rendering
Assembly
Gym.Rendering.dll

pygame's event types (pygame.QUIT, pygame.KEYDOWN, ...): the ones a Gym.NET window posts and Play reads, with pygame-ce 2.5.8's values, and Name(int) for every type pygame names.

public static class EventType
Inheritance
EventType
Inherited Members

Remarks

A type outside this list can still be posted (any int is accepted, as by pygame for user events); it prints by Name(int), which knows every type pygame-ce 2.5.8 knows. Reference: src_c/event.c (pygame-ce 2.5.8).

Fields

KeyDown

KEYDOWN (768): a key went down; its key attribute is the KeyCode.

public const int KeyDown = 768

Field Value

int

KeyUp

KEYUP (769): a key went up; its key attribute is the KeyCode.

public const int KeyUp = 769

Field Value

int

NoEvent

NOEVENT (0): what an empty queue's poll returns; an event of this type is falsy in pygame.

public const int NoEvent = 0

Field Value

int

NumEvents

NUMEVENTS (65535): one past the last user event type.

public const int NumEvents = 65535

Field Value

int

Quit

QUIT (256): the program should end. A window's close button posts it (after WindowClose); play stops at it.

public const int Quit = 256

Field Value

int

UserEvent

USEREVENT (32865): the first type free for a program's own events, up to NumEvents (excluded).

public const int UserEvent = 32865

Field Value

int

VideoResize

VIDEORESIZE (32769): pygame 1's resize event, still posted with size, w and h when the user resizes a window; play ignores it and reads WindowResized.

public const int VideoResize = 32769

Field Value

int

WindowClose

WINDOWCLOSE (32786): the window's close button was pressed; Quit follows it.

public const int WindowClose = 32786

Field Value

int

WindowResized

WINDOWRESIZED (32777): the user resized the window to x by y; by the time it is read, the display surface already has that size. play rescales its frames to fit.

public const int WindowResized = 32777

Field Value

int

WindowSizeChanged

WINDOWSIZECHANGED (32778): the window's size changed, for any reason; follows WindowResized after a user resize.

public const int WindowSizeChanged = 32778

Field Value

int

Methods

Name(int)

pygame's pygame.event.event_name(type): the name an event's repr shows, KeyDown for 768, UserEvent for a type in [UserEvent, NumEvents), else Unknown.

public static string Name(int type)

Parameters

type int

The event type.

Returns

string

The name.