begin defining GUI events
This commit is contained in:
parent
ff89fc7ca7
commit
8154aa84cc
@ -53,7 +53,9 @@ bool Gui_Init()
|
|||||||
RootWindow(g_display, g_vi->screen), g_vi->visual, AllocNone);
|
RootWindow(g_display, g_vi->screen), g_vi->visual, AllocNone);
|
||||||
g_swa.colormap = colormap;
|
g_swa.colormap = colormap;
|
||||||
g_swa.border_pixel = 0;
|
g_swa.border_pixel = 0;
|
||||||
g_swa.event_mask = StructureNotifyMask;
|
g_swa.event_mask = StructureNotifyMask |
|
||||||
|
KeyPressMask | KeyReleaseMask |
|
||||||
|
ButtonPressMask | ButtonReleaseMask;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,31 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define GUI_EVENT_CLOSE_WINDOW 1u
|
#define GUI_EVENT_CLOSE_WINDOW 1u
|
||||||
|
#define GUI_EVENT_EXPOSE 2u
|
||||||
|
#define GUI_EVENT_KEY_PRESS 3u
|
||||||
|
#define GUI_EVENT_KEY_RELEASE 4u
|
||||||
|
#define GUI_EVENT_BUTTON_PRESS 5u
|
||||||
|
#define GUI_EVENT_BUTTON_RELEASE 6u
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t key;
|
||||||
|
uint8_t mods;
|
||||||
|
} Gui_KeyEvent;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t button;
|
||||||
|
} Gui_ButtonEvent;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
Gui_KeyEvent key;
|
||||||
|
Gui_ButtonEvent button;
|
||||||
|
};
|
||||||
} Gui_Event;
|
} Gui_Event;
|
||||||
|
|
||||||
bool Gui_Init();
|
bool Gui_Init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user