1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:27:34 +00:00

Add very basic KeyDown events to the GUI event stream.

The Terminal program now hosts an interactive shell. :^)
This commit is contained in:
Andreas Kling 2019-01-15 06:49:52 +01:00
parent c0ef060a7c
commit 78696236d3
4 changed files with 33 additions and 8 deletions

View file

@ -42,11 +42,18 @@ struct GUI_WindowBackingStoreInfo {
enum class GUI_MouseButton : unsigned char {
NoButton = 0,
Left = 1,
Right = 2,
Middle = 4,
Left = 1,
Right = 2,
Middle = 4,
};
struct GUI_KeyModifiers { enum {
Shift = 1 << 0,
Alt = 1 << 1,
Ctrl = 1 << 2,
}; };
struct GUI_Event {
enum Type : unsigned {
Invalid,
@ -54,6 +61,8 @@ struct GUI_Event {
MouseMove,
MouseDown,
MouseUp,
KeyDown,
KeyUp,
};
Type type { Invalid };
int window_id { -1 };
@ -66,6 +75,10 @@ struct GUI_Event {
GUI_Point position;
GUI_MouseButton button;
} mouse;
struct {
char character;
unsigned modifiers;
} key;
};
};