mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
add focus loss/gain events and fix a silly bug in IE_Set_Focus
This commit is contained in:
parent
dfc74deff7
commit
ac9dace768
2 changed files with 12 additions and 2 deletions
|
@ -52,6 +52,8 @@ typedef struct {
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ie_none,
|
ie_none,
|
||||||
|
ie_gain_focus,
|
||||||
|
ie_lose_focus,
|
||||||
ie_mouse,
|
ie_mouse,
|
||||||
ie_key,
|
ie_key,
|
||||||
ie_joystick,
|
ie_joystick,
|
||||||
|
|
|
@ -93,6 +93,14 @@ IE_Remove_Handler (int handle)
|
||||||
void
|
void
|
||||||
IE_Set_Focus (int handle)
|
IE_Set_Focus (int handle)
|
||||||
{
|
{
|
||||||
if (handle >= 0 && handle < eh_list_size && event_handler_list[handle])
|
if (handle >= 0 && handle < eh_list_size
|
||||||
focus = eh_list_size;
|
&& event_handler_list[handle]
|
||||||
|
&& focus != handle) {
|
||||||
|
IE_event_t event;
|
||||||
|
event.type = ie_lose_focus;
|
||||||
|
IE_Send_Event (&event);
|
||||||
|
focus = handle;
|
||||||
|
event.type = ie_gain_focus;
|
||||||
|
IE_Send_Event (&event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue