mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Updates SDL to 2.0.5
This commit is contained in:
parent
00a4a21e3f
commit
1e671bfc7a
274 changed files with 11502 additions and 4656 deletions
|
|
@ -26,21 +26,73 @@
|
|||
#include "SDL_events_c.h"
|
||||
#include "SDL_dropevents_c.h"
|
||||
|
||||
#include "../video/SDL_sysvideo.h" /* for SDL_Window internals. */
|
||||
|
||||
int
|
||||
SDL_SendDropFile(const char *file)
|
||||
|
||||
static int
|
||||
SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const char *data)
|
||||
{
|
||||
int posted;
|
||||
static SDL_bool app_is_dropping = SDL_FALSE;
|
||||
int posted = 0;
|
||||
|
||||
/* Post the event, if desired */
|
||||
posted = 0;
|
||||
if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
|
||||
if (SDL_GetEventState(evtype) == SDL_ENABLE) {
|
||||
const SDL_bool need_begin = window ? !window->is_dropping : !app_is_dropping;
|
||||
SDL_Event event;
|
||||
event.type = SDL_DROPFILE;
|
||||
event.drop.file = SDL_strdup(file);
|
||||
|
||||
if (need_begin) {
|
||||
SDL_zero(event);
|
||||
event.type = SDL_DROPBEGIN;
|
||||
|
||||
if (window) {
|
||||
event.drop.windowID = window->id;
|
||||
}
|
||||
|
||||
posted = (SDL_PushEvent(&event) > 0);
|
||||
if (!posted) {
|
||||
return 0;
|
||||
}
|
||||
if (window) {
|
||||
window->is_dropping = SDL_TRUE;
|
||||
} else {
|
||||
app_is_dropping = SDL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
SDL_zero(event);
|
||||
event.type = evtype;
|
||||
event.drop.file = data ? SDL_strdup(data) : NULL;
|
||||
event.drop.windowID = window ? window->id : 0;
|
||||
posted = (SDL_PushEvent(&event) > 0);
|
||||
|
||||
if (posted && (evtype == SDL_DROPCOMPLETE)) {
|
||||
if (window) {
|
||||
window->is_dropping = SDL_FALSE;
|
||||
} else {
|
||||
app_is_dropping = SDL_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (posted);
|
||||
return posted;
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SendDropFile(SDL_Window *window, const char *file)
|
||||
{
|
||||
return SDL_SendDrop(window, SDL_DROPFILE, file);
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SendDropText(SDL_Window *window, const char *text)
|
||||
{
|
||||
return SDL_SendDrop(window, SDL_DROPTEXT, text);
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SendDropComplete(SDL_Window *window)
|
||||
{
|
||||
return SDL_SendDrop(window, SDL_DROPCOMPLETE, NULL);
|
||||
}
|
||||
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@
|
|||
#ifndef _SDL_dropevents_c_h
|
||||
#define _SDL_dropevents_c_h
|
||||
|
||||
extern int SDL_SendDropFile(const char *file);
|
||||
extern int SDL_SendDropFile(SDL_Window *window, const char *file);
|
||||
extern int SDL_SendDropText(SDL_Window *window, const char *text);
|
||||
extern int SDL_SendDropComplete(SDL_Window *window);
|
||||
|
||||
#endif /* _SDL_dropevents_c_h */
|
||||
|
||||
|
|
|
|||
|
|
@ -73,15 +73,15 @@ typedef struct _SDL_SysWMEntry
|
|||
static struct
|
||||
{
|
||||
SDL_mutex *lock;
|
||||
volatile SDL_bool active;
|
||||
volatile int count;
|
||||
volatile int max_events_seen;
|
||||
SDL_atomic_t active;
|
||||
SDL_atomic_t count;
|
||||
int max_events_seen;
|
||||
SDL_EventEntry *head;
|
||||
SDL_EventEntry *tail;
|
||||
SDL_EventEntry *free;
|
||||
SDL_SysWMEntry *wmmsg_used;
|
||||
SDL_SysWMEntry *wmmsg_free;
|
||||
} SDL_EventQ = { NULL, SDL_TRUE, 0, 0, NULL, NULL, NULL, NULL, NULL };
|
||||
} SDL_EventQ = { NULL, { 1 }, { 0 }, 0, NULL, NULL, NULL, NULL, NULL };
|
||||
|
||||
|
||||
/* Public functions */
|
||||
|
|
@ -98,7 +98,7 @@ SDL_StopEventLoop(void)
|
|||
SDL_LockMutex(SDL_EventQ.lock);
|
||||
}
|
||||
|
||||
SDL_EventQ.active = SDL_FALSE;
|
||||
SDL_AtomicSet(&SDL_EventQ.active, 0);
|
||||
|
||||
if (report && SDL_atoi(report)) {
|
||||
SDL_Log("SDL EVENT QUEUE: Maximum events in-flight: %d\n",
|
||||
|
|
@ -127,7 +127,7 @@ SDL_StopEventLoop(void)
|
|||
wmmsg = next;
|
||||
}
|
||||
|
||||
SDL_EventQ.count = 0;
|
||||
SDL_AtomicSet(&SDL_EventQ.count, 0);
|
||||
SDL_EventQ.max_events_seen = 0;
|
||||
SDL_EventQ.head = NULL;
|
||||
SDL_EventQ.tail = NULL;
|
||||
|
|
@ -171,7 +171,7 @@ SDL_StartEventLoop(void)
|
|||
SDL_EventQ.lock = SDL_CreateMutex();
|
||||
}
|
||||
if (SDL_EventQ.lock == NULL) {
|
||||
return (-1);
|
||||
return -1;
|
||||
}
|
||||
#endif /* !SDL_THREADS_DISABLED */
|
||||
|
||||
|
|
@ -180,9 +180,9 @@ SDL_StartEventLoop(void)
|
|||
SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE);
|
||||
SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE);
|
||||
|
||||
SDL_EventQ.active = SDL_TRUE;
|
||||
SDL_AtomicSet(&SDL_EventQ.active, 1);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -191,9 +191,11 @@ static int
|
|||
SDL_AddEvent(SDL_Event * event)
|
||||
{
|
||||
SDL_EventEntry *entry;
|
||||
const int initial_count = SDL_AtomicGet(&SDL_EventQ.count);
|
||||
int final_count;
|
||||
|
||||
if (SDL_EventQ.count >= SDL_MAX_QUEUED_EVENTS) {
|
||||
SDL_SetError("Event queue is full (%d events)", SDL_EventQ.count);
|
||||
if (initial_count >= SDL_MAX_QUEUED_EVENTS) {
|
||||
SDL_SetError("Event queue is full (%d events)", initial_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -225,10 +227,10 @@ SDL_AddEvent(SDL_Event * event)
|
|||
entry->prev = NULL;
|
||||
entry->next = NULL;
|
||||
}
|
||||
++SDL_EventQ.count;
|
||||
|
||||
if (SDL_EventQ.count > SDL_EventQ.max_events_seen) {
|
||||
SDL_EventQ.max_events_seen = SDL_EventQ.count;
|
||||
final_count = SDL_AtomicAdd(&SDL_EventQ.count, 1) + 1;
|
||||
if (final_count > SDL_EventQ.max_events_seen) {
|
||||
SDL_EventQ.max_events_seen = final_count;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
@ -256,8 +258,8 @@ SDL_CutEvent(SDL_EventEntry *entry)
|
|||
|
||||
entry->next = SDL_EventQ.free;
|
||||
SDL_EventQ.free = entry;
|
||||
SDL_assert(SDL_EventQ.count > 0);
|
||||
--SDL_EventQ.count;
|
||||
SDL_assert(SDL_AtomicGet(&SDL_EventQ.count) > 0);
|
||||
SDL_AtomicAdd(&SDL_EventQ.count, -1);
|
||||
}
|
||||
|
||||
/* Lock the event queue, take a peep at it, and unlock it */
|
||||
|
|
@ -268,7 +270,7 @@ SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action,
|
|||
int i, used;
|
||||
|
||||
/* Don't look after we've quit */
|
||||
if (!SDL_EventQ.active) {
|
||||
if (!SDL_AtomicGet(&SDL_EventQ.active)) {
|
||||
/* We get a few spurious events at shutdown, so don't warn then */
|
||||
if (action != SDL_ADDEVENT) {
|
||||
SDL_SetError("The event system has been shut down");
|
||||
|
|
@ -285,56 +287,54 @@ SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action,
|
|||
} else {
|
||||
SDL_EventEntry *entry, *next;
|
||||
SDL_SysWMEntry *wmmsg, *wmmsg_next;
|
||||
SDL_Event tmpevent;
|
||||
Uint32 type;
|
||||
|
||||
/* If 'events' is NULL, just see if they exist */
|
||||
if (events == NULL) {
|
||||
action = SDL_PEEKEVENT;
|
||||
numevents = 1;
|
||||
events = &tmpevent;
|
||||
if (action == SDL_GETEVENT) {
|
||||
/* Clean out any used wmmsg data
|
||||
FIXME: Do we want to retain the data for some period of time?
|
||||
*/
|
||||
for (wmmsg = SDL_EventQ.wmmsg_used; wmmsg; wmmsg = wmmsg_next) {
|
||||
wmmsg_next = wmmsg->next;
|
||||
wmmsg->next = SDL_EventQ.wmmsg_free;
|
||||
SDL_EventQ.wmmsg_free = wmmsg;
|
||||
}
|
||||
SDL_EventQ.wmmsg_used = NULL;
|
||||
}
|
||||
|
||||
/* Clean out any used wmmsg data
|
||||
FIXME: Do we want to retain the data for some period of time?
|
||||
*/
|
||||
for (wmmsg = SDL_EventQ.wmmsg_used; wmmsg; wmmsg = wmmsg_next) {
|
||||
wmmsg_next = wmmsg->next;
|
||||
wmmsg->next = SDL_EventQ.wmmsg_free;
|
||||
SDL_EventQ.wmmsg_free = wmmsg;
|
||||
}
|
||||
SDL_EventQ.wmmsg_used = NULL;
|
||||
|
||||
for (entry = SDL_EventQ.head; entry && used < numevents; entry = next) {
|
||||
for (entry = SDL_EventQ.head; entry && (!events || used < numevents); entry = next) {
|
||||
next = entry->next;
|
||||
type = entry->event.type;
|
||||
if (minType <= type && type <= maxType) {
|
||||
events[used] = entry->event;
|
||||
if (entry->event.type == SDL_SYSWMEVENT) {
|
||||
/* We need to copy the wmmsg somewhere safe.
|
||||
For now we'll guarantee it's valid at least until
|
||||
the next call to SDL_PeepEvents()
|
||||
*/
|
||||
if (SDL_EventQ.wmmsg_free) {
|
||||
wmmsg = SDL_EventQ.wmmsg_free;
|
||||
SDL_EventQ.wmmsg_free = wmmsg->next;
|
||||
} else {
|
||||
wmmsg = (SDL_SysWMEntry *)SDL_malloc(sizeof(*wmmsg));
|
||||
if (events) {
|
||||
events[used] = entry->event;
|
||||
if (entry->event.type == SDL_SYSWMEVENT) {
|
||||
/* We need to copy the wmmsg somewhere safe.
|
||||
For now we'll guarantee it's valid at least until
|
||||
the next call to SDL_PeepEvents()
|
||||
*/
|
||||
if (SDL_EventQ.wmmsg_free) {
|
||||
wmmsg = SDL_EventQ.wmmsg_free;
|
||||
SDL_EventQ.wmmsg_free = wmmsg->next;
|
||||
} else {
|
||||
wmmsg = (SDL_SysWMEntry *)SDL_malloc(sizeof(*wmmsg));
|
||||
}
|
||||
wmmsg->msg = *entry->event.syswm.msg;
|
||||
wmmsg->next = SDL_EventQ.wmmsg_used;
|
||||
SDL_EventQ.wmmsg_used = wmmsg;
|
||||
events[used].syswm.msg = &wmmsg->msg;
|
||||
}
|
||||
|
||||
if (action == SDL_GETEVENT) {
|
||||
SDL_CutEvent(entry);
|
||||
}
|
||||
wmmsg->msg = *entry->event.syswm.msg;
|
||||
wmmsg->next = SDL_EventQ.wmmsg_used;
|
||||
SDL_EventQ.wmmsg_used = wmmsg;
|
||||
events[used].syswm.msg = &wmmsg->msg;
|
||||
}
|
||||
++used;
|
||||
|
||||
if (action == SDL_GETEVENT) {
|
||||
SDL_CutEvent(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SDL_UnlockMutex(SDL_EventQ.lock);
|
||||
if (SDL_EventQ.lock) {
|
||||
SDL_UnlockMutex(SDL_EventQ.lock);
|
||||
}
|
||||
} else {
|
||||
return SDL_SetError("Couldn't lock event queue");
|
||||
}
|
||||
|
|
@ -363,7 +363,7 @@ void
|
|||
SDL_FlushEvents(Uint32 minType, Uint32 maxType)
|
||||
{
|
||||
/* Don't look after we've quit */
|
||||
if (!SDL_EventQ.active) {
|
||||
if (!SDL_AtomicGet(&SDL_EventQ.active)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -376,7 +376,7 @@ SDL_FlushEvents(Uint32 minType, Uint32 maxType)
|
|||
#endif
|
||||
|
||||
/* Lock the event queue */
|
||||
if (SDL_LockMutex(SDL_EventQ.lock) == 0) {
|
||||
if (SDL_EventQ.lock && SDL_LockMutex(SDL_EventQ.lock) == 0) {
|
||||
SDL_EventEntry *entry, *next;
|
||||
Uint32 type;
|
||||
for (entry = SDL_EventQ.head; entry; entry = next) {
|
||||
|
|
@ -437,8 +437,6 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout)
|
|||
switch (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) {
|
||||
case -1:
|
||||
return 0;
|
||||
case 1:
|
||||
return 1;
|
||||
case 0:
|
||||
if (timeout == 0) {
|
||||
/* Polling and no events, just return */
|
||||
|
|
@ -450,6 +448,9 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout)
|
|||
}
|
||||
SDL_Delay(10);
|
||||
break;
|
||||
default:
|
||||
/* Has events */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include "../SDL_internal.h"
|
||||
|
||||
/* General mouse handling code for SDL */
|
||||
/* General gesture handling code for SDL */
|
||||
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_endian.h"
|
||||
|
|
|
|||
|
|
@ -322,15 +322,13 @@ static SDL_MouseClickState *GetMouseClickState(SDL_Mouse *mouse, Uint8 button)
|
|||
return &mouse->clickstate[button];
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
|
||||
static int
|
||||
SDL_PrivateSendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button, int clicks)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
int posted;
|
||||
Uint32 type;
|
||||
Uint32 buttonstate = mouse->buttonstate;
|
||||
SDL_MouseClickState *clickstate = GetMouseClickState(mouse, button);
|
||||
Uint8 click_count;
|
||||
|
||||
/* Figure out which event to perform */
|
||||
switch (state) {
|
||||
|
|
@ -358,25 +356,28 @@ SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8
|
|||
}
|
||||
mouse->buttonstate = buttonstate;
|
||||
|
||||
if (clickstate) {
|
||||
if (state == SDL_PRESSED) {
|
||||
Uint32 now = SDL_GetTicks();
|
||||
if (clicks < 0) {
|
||||
SDL_MouseClickState *clickstate = GetMouseClickState(mouse, button);
|
||||
if (clickstate) {
|
||||
if (state == SDL_PRESSED) {
|
||||
Uint32 now = SDL_GetTicks();
|
||||
|
||||
if (SDL_TICKS_PASSED(now, clickstate->last_timestamp + SDL_double_click_time) ||
|
||||
SDL_abs(mouse->x - clickstate->last_x) > SDL_double_click_radius ||
|
||||
SDL_abs(mouse->y - clickstate->last_y) > SDL_double_click_radius) {
|
||||
clickstate->click_count = 0;
|
||||
}
|
||||
clickstate->last_timestamp = now;
|
||||
clickstate->last_x = mouse->x;
|
||||
clickstate->last_y = mouse->y;
|
||||
if (clickstate->click_count < 255) {
|
||||
++clickstate->click_count;
|
||||
if (SDL_TICKS_PASSED(now, clickstate->last_timestamp + SDL_double_click_time) ||
|
||||
SDL_abs(mouse->x - clickstate->last_x) > SDL_double_click_radius ||
|
||||
SDL_abs(mouse->y - clickstate->last_y) > SDL_double_click_radius) {
|
||||
clickstate->click_count = 0;
|
||||
}
|
||||
clickstate->last_timestamp = now;
|
||||
clickstate->last_x = mouse->x;
|
||||
clickstate->last_y = mouse->y;
|
||||
if (clickstate->click_count < 255) {
|
||||
++clickstate->click_count;
|
||||
}
|
||||
}
|
||||
clicks = clickstate->click_count;
|
||||
} else {
|
||||
clicks = 1;
|
||||
}
|
||||
click_count = clickstate->click_count;
|
||||
} else {
|
||||
click_count = 1;
|
||||
}
|
||||
|
||||
/* Post the event, if desired */
|
||||
|
|
@ -388,7 +389,7 @@ SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8
|
|||
event.button.which = mouseID;
|
||||
event.button.state = state;
|
||||
event.button.button = button;
|
||||
event.button.clicks = click_count;
|
||||
event.button.clicks = (Uint8) SDL_min(clicks, 255);
|
||||
event.button.x = mouse->x;
|
||||
event.button.y = mouse->y;
|
||||
posted = (SDL_PushEvent(&event) > 0);
|
||||
|
|
@ -398,10 +399,23 @@ SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8
|
|||
if (window && state == SDL_RELEASED) {
|
||||
SDL_UpdateMouseFocus(window, mouse->x, mouse->y, buttonstate);
|
||||
}
|
||||
|
||||
|
||||
return posted;
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SendMouseButtonClicks(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button, int clicks)
|
||||
{
|
||||
clicks = SDL_max(clicks, 0);
|
||||
return SDL_PrivateSendMouseButton(window, mouseID, state, button, clicks);
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button)
|
||||
{
|
||||
return SDL_PrivateSendMouseButton(window, mouseID, state, button, -1);
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y, SDL_MouseWheelDirection direction)
|
||||
{
|
||||
|
|
@ -550,21 +564,11 @@ SDL_WarpMouseGlobal(int x, int y)
|
|||
static SDL_bool
|
||||
ShouldUseRelativeModeWarp(SDL_Mouse *mouse)
|
||||
{
|
||||
const char *hint;
|
||||
|
||||
if (!mouse->SetRelativeMouseMode) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
hint = SDL_GetHint(SDL_HINT_MOUSE_RELATIVE_MODE_WARP);
|
||||
if (hint) {
|
||||
if (*hint == '0') {
|
||||
return SDL_FALSE;
|
||||
} else {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
return SDL_FALSE;
|
||||
return SDL_GetHintBoolean(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, SDL_FALSE);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -119,6 +119,9 @@ extern int SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int rel
|
|||
/* Send a mouse button event */
|
||||
extern int SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button);
|
||||
|
||||
/* Send a mouse button event with a click count */
|
||||
extern int SDL_SendMouseButtonClicks(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button, int clicks);
|
||||
|
||||
/* Send a mouse wheel event */
|
||||
extern int SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y, SDL_MouseWheelDirection direction);
|
||||
|
||||
|
|
|
|||
|
|
@ -91,9 +91,7 @@ SDL_QuitInit_Internal(void)
|
|||
int
|
||||
SDL_QuitInit(void)
|
||||
{
|
||||
const char *hint = SDL_GetHint(SDL_HINT_NO_SIGNAL_HANDLERS);
|
||||
disable_signals = hint && (SDL_atoi(hint) == 1);
|
||||
if (!disable_signals) {
|
||||
if (!SDL_GetHintBoolean(SDL_HINT_NO_SIGNAL_HANDLERS, SDL_FALSE)) {
|
||||
return SDL_QuitInit_Internal();
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -70,6 +70,20 @@ RemovePendingMoveEvents(void * userdata, SDL_Event *event)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
RemovePendingExposedEvents(void * userdata, SDL_Event *event)
|
||||
{
|
||||
SDL_Event *new_event = (SDL_Event *)userdata;
|
||||
|
||||
if (event->type == SDL_WINDOWEVENT &&
|
||||
event->window.event == SDL_WINDOWEVENT_EXPOSED &&
|
||||
event->window.windowID == new_event->window.windowID) {
|
||||
/* We're about to post a new exposed event, drop the old one */
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1,
|
||||
int data2)
|
||||
|
|
@ -195,7 +209,9 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1,
|
|||
if (windowevent == SDL_WINDOWEVENT_MOVED) {
|
||||
SDL_FilterEvents(RemovePendingMoveEvents, &event);
|
||||
}
|
||||
|
||||
if (windowevent == SDL_WINDOWEVENT_EXPOSED) {
|
||||
SDL_FilterEvents(RemovePendingExposedEvents, &event);
|
||||
}
|
||||
posted = (SDL_PushEvent(&event) > 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ static SDL_Scancode const linux_scancode_table[] = {
|
|||
/* 82 */ SDL_SCANCODE_KP_0,
|
||||
/* 83 */ SDL_SCANCODE_KP_PERIOD,
|
||||
0,
|
||||
/* 85 */ SDL_SCANCODE_UNKNOWN, /* KEY_ZENKAKUHANKAKU */
|
||||
/* 85 */ SDL_SCANCODE_LANG5, /* KEY_ZENKAKUHANKAKU */
|
||||
/* 86 */ SDL_SCANCODE_NONUSBACKSLASH, /* KEY_102ND */
|
||||
/* 87 */ SDL_SCANCODE_F11,
|
||||
/* 88 */ SDL_SCANCODE_F12,
|
||||
|
|
@ -153,7 +153,7 @@ static SDL_Scancode const linux_scancode_table[] = {
|
|||
/* 124 */ SDL_SCANCODE_INTERNATIONAL3, /* KEY_YEN */
|
||||
/* 125 */ SDL_SCANCODE_LGUI,
|
||||
/* 126 */ SDL_SCANCODE_RGUI,
|
||||
/* 127 */ SDL_SCANCODE_UNKNOWN, /* KEY_COMPOSE */
|
||||
/* 127 */ SDL_SCANCODE_APPLICATION, /* KEY_COMPOSE */
|
||||
/* 128 */ SDL_SCANCODE_STOP,
|
||||
/* 129 */ SDL_SCANCODE_AGAIN,
|
||||
/* 130 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROPS */
|
||||
|
|
@ -174,9 +174,9 @@ static SDL_Scancode const linux_scancode_table[] = {
|
|||
/* 145 */ SDL_SCANCODE_UNKNOWN, /* KEY_SENDFILE */
|
||||
/* 146 */ SDL_SCANCODE_UNKNOWN, /* KEY_DELETEFILE */
|
||||
/* 147 */ SDL_SCANCODE_UNKNOWN, /* KEY_XFER */
|
||||
/* 148 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG1 */
|
||||
/* 149 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG2 */
|
||||
/* 150 */ SDL_SCANCODE_UNKNOWN, /* KEY_WWW */
|
||||
/* 148 */ SDL_SCANCODE_APP1, /* KEY_PROG1 */
|
||||
/* 149 */ SDL_SCANCODE_APP2, /* KEY_PROG2 */
|
||||
/* 150 */ SDL_SCANCODE_WWW, /* KEY_WWW */
|
||||
/* 151 */ SDL_SCANCODE_UNKNOWN, /* KEY_MSDOS */
|
||||
/* 152 */ SDL_SCANCODE_UNKNOWN, /* KEY_COFFEE */
|
||||
/* 153 */ SDL_SCANCODE_UNKNOWN, /* KEY_DIRECTION */
|
||||
|
|
@ -192,7 +192,7 @@ static SDL_Scancode const linux_scancode_table[] = {
|
|||
/* 163 */ SDL_SCANCODE_AUDIONEXT, /* KEY_NEXTSONG */
|
||||
/* 164 */ SDL_SCANCODE_AUDIOPLAY, /* KEY_PLAYPAUSE */
|
||||
/* 165 */ SDL_SCANCODE_AUDIOPREV, /* KEY_PREVIOUSSONG */
|
||||
/* 166 */ SDL_SCANCODE_UNKNOWN, /* KEY_STOPCD */
|
||||
/* 166 */ SDL_SCANCODE_AUDIOSTOP, /* KEY_STOPCD */
|
||||
/* 167 */ SDL_SCANCODE_UNKNOWN, /* KEY_RECORD */
|
||||
/* 168 */ SDL_SCANCODE_UNKNOWN, /* KEY_REWIND */
|
||||
/* 169 */ SDL_SCANCODE_UNKNOWN, /* KEY_PHONE */
|
||||
|
|
@ -221,7 +221,7 @@ static SDL_Scancode const linux_scancode_table[] = {
|
|||
/* 192 */ SDL_SCANCODE_F22,
|
||||
/* 193 */ SDL_SCANCODE_F23,
|
||||
/* 194 */ SDL_SCANCODE_F24,
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
/* 200 */ SDL_SCANCODE_UNKNOWN, /* KEY_PLAYCD */
|
||||
/* 201 */ SDL_SCANCODE_UNKNOWN, /* KEY_PAUSECD */
|
||||
/* 202 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG3 */
|
||||
|
|
|
|||
|
|
@ -418,4 +418,89 @@ static const SDL_Scancode xfree86_scancode_table2[] = {
|
|||
/* 238 */ SDL_SCANCODE_UNKNOWN, /* XF86WLAN */
|
||||
};
|
||||
|
||||
/* Xvnc / Xtightvnc scancodes from xmodmap -pk */
|
||||
static const SDL_Scancode xvnc_scancode_table[] = {
|
||||
/* 0 */ SDL_SCANCODE_LCTRL,
|
||||
/* 1 */ SDL_SCANCODE_RCTRL,
|
||||
/* 2 */ SDL_SCANCODE_LSHIFT,
|
||||
/* 3 */ SDL_SCANCODE_RSHIFT,
|
||||
/* 4 */ SDL_SCANCODE_UNKNOWN, /* Meta_L */
|
||||
/* 5 */ SDL_SCANCODE_UNKNOWN, /* Meta_R */
|
||||
/* 6 */ SDL_SCANCODE_LALT,
|
||||
/* 7 */ SDL_SCANCODE_RALT,
|
||||
/* 8 */ SDL_SCANCODE_SPACE,
|
||||
/* 9 */ SDL_SCANCODE_0,
|
||||
/* 10 */ SDL_SCANCODE_1,
|
||||
/* 11 */ SDL_SCANCODE_2,
|
||||
/* 12 */ SDL_SCANCODE_3,
|
||||
/* 13 */ SDL_SCANCODE_4,
|
||||
/* 14 */ SDL_SCANCODE_5,
|
||||
/* 15 */ SDL_SCANCODE_6,
|
||||
/* 16 */ SDL_SCANCODE_7,
|
||||
/* 17 */ SDL_SCANCODE_8,
|
||||
/* 18 */ SDL_SCANCODE_9,
|
||||
/* 19 */ SDL_SCANCODE_MINUS,
|
||||
/* 20 */ SDL_SCANCODE_EQUALS,
|
||||
/* 21 */ SDL_SCANCODE_LEFTBRACKET,
|
||||
/* 22 */ SDL_SCANCODE_RIGHTBRACKET,
|
||||
/* 23 */ SDL_SCANCODE_SEMICOLON,
|
||||
/* 24 */ SDL_SCANCODE_APOSTROPHE,
|
||||
/* 25 */ SDL_SCANCODE_GRAVE,
|
||||
/* 26 */ SDL_SCANCODE_COMMA,
|
||||
/* 27 */ SDL_SCANCODE_PERIOD,
|
||||
/* 28 */ SDL_SCANCODE_SLASH,
|
||||
/* 29 */ SDL_SCANCODE_BACKSLASH,
|
||||
/* 30 */ SDL_SCANCODE_A,
|
||||
/* 31 */ SDL_SCANCODE_B,
|
||||
/* 32 */ SDL_SCANCODE_C,
|
||||
/* 33 */ SDL_SCANCODE_D,
|
||||
/* 34 */ SDL_SCANCODE_E,
|
||||
/* 35 */ SDL_SCANCODE_F,
|
||||
/* 36 */ SDL_SCANCODE_G,
|
||||
/* 37 */ SDL_SCANCODE_H,
|
||||
/* 38 */ SDL_SCANCODE_I,
|
||||
/* 39 */ SDL_SCANCODE_J,
|
||||
/* 40 */ SDL_SCANCODE_K,
|
||||
/* 41 */ SDL_SCANCODE_L,
|
||||
/* 42 */ SDL_SCANCODE_M,
|
||||
/* 43 */ SDL_SCANCODE_N,
|
||||
/* 44 */ SDL_SCANCODE_O,
|
||||
/* 45 */ SDL_SCANCODE_P,
|
||||
/* 46 */ SDL_SCANCODE_Q,
|
||||
/* 47 */ SDL_SCANCODE_R,
|
||||
/* 48 */ SDL_SCANCODE_S,
|
||||
/* 49 */ SDL_SCANCODE_T,
|
||||
/* 50 */ SDL_SCANCODE_U,
|
||||
/* 51 */ SDL_SCANCODE_V,
|
||||
/* 52 */ SDL_SCANCODE_W,
|
||||
/* 53 */ SDL_SCANCODE_X,
|
||||
/* 54 */ SDL_SCANCODE_Y,
|
||||
/* 55 */ SDL_SCANCODE_Z,
|
||||
/* 56 */ SDL_SCANCODE_BACKSPACE,
|
||||
/* 57 */ SDL_SCANCODE_RETURN,
|
||||
/* 58 */ SDL_SCANCODE_TAB,
|
||||
/* 59 */ SDL_SCANCODE_ESCAPE,
|
||||
/* 60 */ SDL_SCANCODE_DELETE,
|
||||
/* 61 */ SDL_SCANCODE_HOME,
|
||||
/* 62 */ SDL_SCANCODE_END,
|
||||
/* 63 */ SDL_SCANCODE_PAGEUP,
|
||||
/* 64 */ SDL_SCANCODE_PAGEDOWN,
|
||||
/* 65 */ SDL_SCANCODE_UP,
|
||||
/* 66 */ SDL_SCANCODE_DOWN,
|
||||
/* 67 */ SDL_SCANCODE_LEFT,
|
||||
/* 68 */ SDL_SCANCODE_RIGHT,
|
||||
/* 69 */ SDL_SCANCODE_F1,
|
||||
/* 70 */ SDL_SCANCODE_F2,
|
||||
/* 71 */ SDL_SCANCODE_F3,
|
||||
/* 72 */ SDL_SCANCODE_F4,
|
||||
/* 73 */ SDL_SCANCODE_F5,
|
||||
/* 74 */ SDL_SCANCODE_F6,
|
||||
/* 75 */ SDL_SCANCODE_F7,
|
||||
/* 76 */ SDL_SCANCODE_F8,
|
||||
/* 77 */ SDL_SCANCODE_F9,
|
||||
/* 78 */ SDL_SCANCODE_F10,
|
||||
/* 79 */ SDL_SCANCODE_F11,
|
||||
/* 80 */ SDL_SCANCODE_F12,
|
||||
};
|
||||
|
||||
/* *INDENT-ON* */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue