mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Updates SDL to version 2.0.4, which makes it compatible with VS2015.
This commit is contained in:
parent
7b52fed504
commit
b63ef177f4
924 changed files with 79241 additions and 39934 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -75,32 +75,21 @@ static struct
|
|||
SDL_mutex *lock;
|
||||
volatile SDL_bool active;
|
||||
volatile int count;
|
||||
volatile 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 };
|
||||
} SDL_EventQ = { NULL, SDL_TRUE, 0, 0, NULL, NULL, NULL, NULL, NULL };
|
||||
|
||||
|
||||
static SDL_INLINE SDL_bool
|
||||
SDL_ShouldPollJoystick()
|
||||
{
|
||||
#if !SDL_JOYSTICK_DISABLED
|
||||
if ((!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] ||
|
||||
SDL_JoystickEventState(SDL_QUERY)) &&
|
||||
SDL_PrivateJoystickNeedsPolling()) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
#endif
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
/* Public functions */
|
||||
|
||||
void
|
||||
SDL_StopEventLoop(void)
|
||||
{
|
||||
const char *report = SDL_GetHint("SDL_EVENT_QUEUE_STATISTICS");
|
||||
int i;
|
||||
SDL_EventEntry *entry;
|
||||
SDL_SysWMEntry *wmmsg;
|
||||
|
|
@ -111,6 +100,11 @@ SDL_StopEventLoop(void)
|
|||
|
||||
SDL_EventQ.active = SDL_FALSE;
|
||||
|
||||
if (report && SDL_atoi(report)) {
|
||||
SDL_Log("SDL EVENT QUEUE: Maximum events in-flight: %d\n",
|
||||
SDL_EventQ.max_events_seen);
|
||||
}
|
||||
|
||||
/* Clean out EventQ */
|
||||
for (entry = SDL_EventQ.head; entry; ) {
|
||||
SDL_EventEntry *next = entry->next;
|
||||
|
|
@ -132,7 +126,9 @@ SDL_StopEventLoop(void)
|
|||
SDL_free(wmmsg);
|
||||
wmmsg = next;
|
||||
}
|
||||
|
||||
SDL_EventQ.count = 0;
|
||||
SDL_EventQ.max_events_seen = 0;
|
||||
SDL_EventQ.head = NULL;
|
||||
SDL_EventQ.tail = NULL;
|
||||
SDL_EventQ.free = NULL;
|
||||
|
|
@ -231,6 +227,10 @@ SDL_AddEvent(SDL_Event * event)
|
|||
}
|
||||
++SDL_EventQ.count;
|
||||
|
||||
if (SDL_EventQ.count > SDL_EventQ.max_events_seen) {
|
||||
SDL_EventQ.max_events_seen = SDL_EventQ.count;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -315,7 +315,6 @@ SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action,
|
|||
For now we'll guarantee it's valid at least until
|
||||
the next call to SDL_PeepEvents()
|
||||
*/
|
||||
SDL_SysWMEntry *wmmsg;
|
||||
if (SDL_EventQ.wmmsg_free) {
|
||||
wmmsg = SDL_EventQ.wmmsg_free;
|
||||
SDL_EventQ.wmmsg_free = wmmsg->next;
|
||||
|
|
@ -403,10 +402,12 @@ SDL_PumpEvents(void)
|
|||
}
|
||||
#if !SDL_JOYSTICK_DISABLED
|
||||
/* Check for joystick state change */
|
||||
if (SDL_ShouldPollJoystick()) {
|
||||
if ((!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] || SDL_JoystickEventState(SDL_QUERY))) {
|
||||
SDL_JoystickUpdate();
|
||||
}
|
||||
#endif
|
||||
|
||||
SDL_SendPendingQuit(); /* in case we had a signal handler fire, etc. */
|
||||
}
|
||||
|
||||
/* Public functions */
|
||||
|
|
@ -550,7 +551,7 @@ SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)
|
|||
void
|
||||
SDL_FilterEvents(SDL_EventFilter filter, void *userdata)
|
||||
{
|
||||
if (SDL_LockMutex(SDL_EventQ.lock) == 0) {
|
||||
if (SDL_EventQ.lock && SDL_LockMutex(SDL_EventQ.lock) == 0) {
|
||||
SDL_EventEntry *entry, *next;
|
||||
for (entry = SDL_EventQ.head; entry; entry = next) {
|
||||
next = entry->next;
|
||||
|
|
@ -648,4 +649,10 @@ SDL_SendSysWMEvent(SDL_SysWMmsg * message)
|
|||
return (posted);
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SendKeymapChangedEvent(void)
|
||||
{
|
||||
return SDL_SendAppEvent(SDL_KEYMAPCHANGED);
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -38,11 +38,14 @@ extern void SDL_QuitInterrupt(void);
|
|||
|
||||
extern int SDL_SendAppEvent(SDL_EventType eventType);
|
||||
extern int SDL_SendSysWMEvent(SDL_SysWMmsg * message);
|
||||
extern int SDL_SendKeymapChangedEvent(void);
|
||||
|
||||
extern int SDL_QuitInit(void);
|
||||
extern int SDL_SendQuit(void);
|
||||
extern void SDL_QuitQuit(void);
|
||||
|
||||
extern void SDL_SendPendingQuit(void);
|
||||
|
||||
/* The event filter function */
|
||||
extern SDL_EventFilter SDL_EventOK;
|
||||
extern void *SDL_EventOKParam;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -24,16 +24,13 @@
|
|||
/* General mouse handling code for SDL */
|
||||
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_events_c.h"
|
||||
#include "SDL_gesture_c.h"
|
||||
|
||||
#if !defined(__PSP__)
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
/*
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
*/
|
||||
|
||||
/* TODO: Replace with malloc */
|
||||
|
||||
|
|
@ -118,14 +115,34 @@ static unsigned long SDL_HashDollar(SDL_FloatPoint* points)
|
|||
|
||||
static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops *dst)
|
||||
{
|
||||
if (dst == NULL) return 0;
|
||||
if (dst == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* No Longer storing the Hash, rehash on load */
|
||||
/* if (SDL_RWops.write(dst, &(templ->hash), sizeof(templ->hash), 1) != 1) return 0; */
|
||||
|
||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||
if (SDL_RWwrite(dst, templ->path,
|
||||
sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS)
|
||||
sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) {
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
{
|
||||
SDL_DollarTemplate copy = *templ;
|
||||
SDL_FloatPoint *p = copy.path;
|
||||
int i;
|
||||
for (i = 0; i < DOLLARNPOINTS; i++, p++) {
|
||||
p->x = SDL_SwapFloatLE(p->x);
|
||||
p->y = SDL_SwapFloatLE(p->y);
|
||||
}
|
||||
|
||||
if (SDL_RWwrite(dst, copy.path,
|
||||
sizeof(copy.path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -137,7 +154,7 @@ int SDL_SaveAllDollarTemplates(SDL_RWops *dst)
|
|||
for (i = 0; i < SDL_numGestureTouches; i++) {
|
||||
SDL_GestureTouch* touch = &SDL_gestureTouch[i];
|
||||
for (j = 0; j < touch->numDollarTemplates; j++) {
|
||||
rtrn += SaveTemplate(&touch->dollarTemplate[i], dst);
|
||||
rtrn += SaveTemplate(&touch->dollarTemplate[j], dst);
|
||||
}
|
||||
}
|
||||
return rtrn;
|
||||
|
|
@ -149,8 +166,8 @@ int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *dst)
|
|||
for (i = 0; i < SDL_numGestureTouches; i++) {
|
||||
SDL_GestureTouch* touch = &SDL_gestureTouch[i];
|
||||
for (j = 0; j < touch->numDollarTemplates; j++) {
|
||||
if (touch->dollarTemplate[i].hash == gestureId) {
|
||||
return SaveTemplate(&touch->dollarTemplate[i], dst);
|
||||
if (touch->dollarTemplate[j].hash == gestureId) {
|
||||
return SaveTemplate(&touch->dollarTemplate[j], dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -188,7 +205,7 @@ static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch, SDL_FloatPoint* path)
|
|||
int index = -1;
|
||||
int i = 0;
|
||||
if (inTouch == NULL) {
|
||||
if (SDL_numGestureTouches == 0) return -1;
|
||||
if (SDL_numGestureTouches == 0) return SDL_SetError("no gesture touch devices registered");
|
||||
for (i = 0; i < SDL_numGestureTouches; i++) {
|
||||
inTouch = &SDL_gestureTouch[i];
|
||||
index = SDL_AddDollarGesture_one(inTouch, path);
|
||||
|
|
@ -207,17 +224,33 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src)
|
|||
SDL_GestureTouch *touch = NULL;
|
||||
if (src == NULL) return 0;
|
||||
if (touchId >= 0) {
|
||||
for (i = 0; i < SDL_numGestureTouches; i++)
|
||||
if (SDL_gestureTouch[i].id == touchId)
|
||||
for (i = 0; i < SDL_numGestureTouches; i++) {
|
||||
if (SDL_gestureTouch[i].id == touchId) {
|
||||
touch = &SDL_gestureTouch[i];
|
||||
if (touch == NULL) return -1;
|
||||
}
|
||||
}
|
||||
if (touch == NULL) {
|
||||
return SDL_SetError("given touch id not found");
|
||||
}
|
||||
}
|
||||
|
||||
while (1) {
|
||||
SDL_DollarTemplate templ;
|
||||
|
||||
if (SDL_RWread(src,templ.path,sizeof(templ.path[0]),DOLLARNPOINTS) <
|
||||
DOLLARNPOINTS) break;
|
||||
if (SDL_RWread(src,templ.path,sizeof(templ.path[0]),DOLLARNPOINTS) < DOLLARNPOINTS) {
|
||||
if (loaded == 0) {
|
||||
return SDL_SetError("could not read any dollar gesture from rwops");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#if SDL_BYTEORDER != SDL_LIL_ENDIAN
|
||||
for (i = 0; i < DOLLARNPOINTS; i++) {
|
||||
SDL_FloatPoint *p = &templ.path[i];
|
||||
p->x = SDL_SwapFloatLE(p->x);
|
||||
p->y = SDL_SwapFloatLE(p->y);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (touchId >= 0) {
|
||||
/* printf("Adding loaded gesture to 1 touch\n"); */
|
||||
|
|
@ -454,8 +487,8 @@ static int SDL_SendGestureDollar(SDL_GestureTouch* touch,
|
|||
SDL_Event event;
|
||||
event.dgesture.type = SDL_DOLLARGESTURE;
|
||||
event.dgesture.touchId = touch->id;
|
||||
event.mgesture.x = touch->centroid.x;
|
||||
event.mgesture.y = touch->centroid.y;
|
||||
event.dgesture.x = touch->centroid.x;
|
||||
event.dgesture.y = touch->centroid.y;
|
||||
event.dgesture.gestureId = gestureId;
|
||||
event.dgesture.error = error;
|
||||
/* A finger came up to trigger this event. */
|
||||
|
|
@ -477,7 +510,6 @@ static int SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId)
|
|||
void SDL_GestureProcessEvent(SDL_Event* event)
|
||||
{
|
||||
float x,y;
|
||||
SDL_FloatPoint path[DOLLARNPOINTS];
|
||||
int index;
|
||||
int i;
|
||||
float pathDx, pathDy;
|
||||
|
|
@ -501,6 +533,8 @@ void SDL_GestureProcessEvent(SDL_Event* event)
|
|||
|
||||
/* Finger Up */
|
||||
if (event->type == SDL_FINGERUP) {
|
||||
SDL_FloatPoint path[DOLLARNPOINTS];
|
||||
|
||||
inTouch->numDownFingers--;
|
||||
|
||||
#ifdef ENABLE_DOLLAR
|
||||
|
|
@ -615,8 +649,7 @@ void SDL_GestureProcessEvent(SDL_Event* event)
|
|||
break;
|
||||
pressure? */
|
||||
}
|
||||
|
||||
if (event->type == SDL_FINGERDOWN) {
|
||||
else if (event->type == SDL_FINGERDOWN) {
|
||||
|
||||
inTouch->numDownFingers++;
|
||||
inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers - 1)+
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -25,6 +25,7 @@
|
|||
#include "SDL_timer.h"
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_events_c.h"
|
||||
#include "SDL_assert.h"
|
||||
#include "../video/SDL_sysvideo.h"
|
||||
|
||||
|
||||
|
|
@ -619,6 +620,16 @@ SDL_SetKeyboardFocus(SDL_Window * window)
|
|||
|
||||
/* See if the current window has lost focus */
|
||||
if (keyboard->focus && keyboard->focus != window) {
|
||||
|
||||
/* new window shouldn't think it has mouse captured. */
|
||||
SDL_assert(!window || !(window->flags & SDL_WINDOW_MOUSE_CAPTURE));
|
||||
|
||||
/* old window must lose an existing mouse capture. */
|
||||
if (keyboard->focus->flags & SDL_WINDOW_MOUSE_CAPTURE) {
|
||||
SDL_CaptureMouse(SDL_FALSE); /* drop the capture. */
|
||||
SDL_assert(!(keyboard->focus->flags & SDL_WINDOW_MOUSE_CAPTURE));
|
||||
}
|
||||
|
||||
SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_LOST,
|
||||
0, 0);
|
||||
|
||||
|
|
@ -651,6 +662,8 @@ SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
|
|||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
int posted;
|
||||
SDL_Keymod modifier;
|
||||
SDL_Keycode keycode;
|
||||
Uint16 modstate;
|
||||
Uint32 type;
|
||||
Uint8 repeat;
|
||||
|
|
@ -662,82 +675,6 @@ SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
|
|||
printf("The '%s' key has been %s\n", SDL_GetScancodeName(scancode),
|
||||
state == SDL_PRESSED ? "pressed" : "released");
|
||||
#endif
|
||||
if (state == SDL_PRESSED) {
|
||||
modstate = keyboard->modstate;
|
||||
switch (scancode) {
|
||||
case SDL_SCANCODE_NUMLOCKCLEAR:
|
||||
keyboard->modstate ^= KMOD_NUM;
|
||||
break;
|
||||
case SDL_SCANCODE_CAPSLOCK:
|
||||
keyboard->modstate ^= KMOD_CAPS;
|
||||
break;
|
||||
case SDL_SCANCODE_LCTRL:
|
||||
keyboard->modstate |= KMOD_LCTRL;
|
||||
break;
|
||||
case SDL_SCANCODE_RCTRL:
|
||||
keyboard->modstate |= KMOD_RCTRL;
|
||||
break;
|
||||
case SDL_SCANCODE_LSHIFT:
|
||||
keyboard->modstate |= KMOD_LSHIFT;
|
||||
break;
|
||||
case SDL_SCANCODE_RSHIFT:
|
||||
keyboard->modstate |= KMOD_RSHIFT;
|
||||
break;
|
||||
case SDL_SCANCODE_LALT:
|
||||
keyboard->modstate |= KMOD_LALT;
|
||||
break;
|
||||
case SDL_SCANCODE_RALT:
|
||||
keyboard->modstate |= KMOD_RALT;
|
||||
break;
|
||||
case SDL_SCANCODE_LGUI:
|
||||
keyboard->modstate |= KMOD_LGUI;
|
||||
break;
|
||||
case SDL_SCANCODE_RGUI:
|
||||
keyboard->modstate |= KMOD_RGUI;
|
||||
break;
|
||||
case SDL_SCANCODE_MODE:
|
||||
keyboard->modstate |= KMOD_MODE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (scancode) {
|
||||
case SDL_SCANCODE_NUMLOCKCLEAR:
|
||||
case SDL_SCANCODE_CAPSLOCK:
|
||||
break;
|
||||
case SDL_SCANCODE_LCTRL:
|
||||
keyboard->modstate &= ~KMOD_LCTRL;
|
||||
break;
|
||||
case SDL_SCANCODE_RCTRL:
|
||||
keyboard->modstate &= ~KMOD_RCTRL;
|
||||
break;
|
||||
case SDL_SCANCODE_LSHIFT:
|
||||
keyboard->modstate &= ~KMOD_LSHIFT;
|
||||
break;
|
||||
case SDL_SCANCODE_RSHIFT:
|
||||
keyboard->modstate &= ~KMOD_RSHIFT;
|
||||
break;
|
||||
case SDL_SCANCODE_LALT:
|
||||
keyboard->modstate &= ~KMOD_LALT;
|
||||
break;
|
||||
case SDL_SCANCODE_RALT:
|
||||
keyboard->modstate &= ~KMOD_RALT;
|
||||
break;
|
||||
case SDL_SCANCODE_LGUI:
|
||||
keyboard->modstate &= ~KMOD_LGUI;
|
||||
break;
|
||||
case SDL_SCANCODE_RGUI:
|
||||
keyboard->modstate &= ~KMOD_RGUI;
|
||||
break;
|
||||
case SDL_SCANCODE_MODE:
|
||||
keyboard->modstate &= ~KMOD_MODE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
modstate = keyboard->modstate;
|
||||
}
|
||||
|
||||
/* Figure out what type of event this is */
|
||||
switch (state) {
|
||||
|
|
@ -764,6 +701,59 @@ SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
|
|||
/* Update internal keyboard state */
|
||||
keyboard->keystate[scancode] = state;
|
||||
|
||||
keycode = keyboard->keymap[scancode];
|
||||
|
||||
/* Update modifiers state if applicable */
|
||||
switch (keycode) {
|
||||
case SDLK_LCTRL:
|
||||
modifier = KMOD_LCTRL;
|
||||
break;
|
||||
case SDLK_RCTRL:
|
||||
modifier = KMOD_RCTRL;
|
||||
break;
|
||||
case SDLK_LSHIFT:
|
||||
modifier = KMOD_LSHIFT;
|
||||
break;
|
||||
case SDLK_RSHIFT:
|
||||
modifier = KMOD_RSHIFT;
|
||||
break;
|
||||
case SDLK_LALT:
|
||||
modifier = KMOD_LALT;
|
||||
break;
|
||||
case SDLK_RALT:
|
||||
modifier = KMOD_RALT;
|
||||
break;
|
||||
case SDLK_LGUI:
|
||||
modifier = KMOD_LGUI;
|
||||
break;
|
||||
case SDLK_RGUI:
|
||||
modifier = KMOD_RGUI;
|
||||
break;
|
||||
case SDLK_MODE:
|
||||
modifier = KMOD_MODE;
|
||||
break;
|
||||
default:
|
||||
modifier = KMOD_NONE;
|
||||
break;
|
||||
}
|
||||
if (SDL_KEYDOWN == type) {
|
||||
modstate = keyboard->modstate;
|
||||
switch (keycode) {
|
||||
case SDLK_NUMLOCKCLEAR:
|
||||
keyboard->modstate ^= KMOD_NUM;
|
||||
break;
|
||||
case SDLK_CAPSLOCK:
|
||||
keyboard->modstate ^= KMOD_CAPS;
|
||||
break;
|
||||
default:
|
||||
keyboard->modstate |= modifier;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
keyboard->modstate &= ~modifier;
|
||||
modstate = keyboard->modstate;
|
||||
}
|
||||
|
||||
/* Post the event, if desired */
|
||||
posted = 0;
|
||||
if (SDL_GetEventState(type) == SDL_ENABLE) {
|
||||
|
|
@ -772,7 +762,7 @@ SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
|
|||
event.key.state = state;
|
||||
event.key.repeat = repeat;
|
||||
event.key.keysym.scancode = scancode;
|
||||
event.key.keysym.sym = keyboard->keymap[scancode];
|
||||
event.key.keysym.sym = keycode;
|
||||
event.key.keysym.mod = modstate;
|
||||
event.key.windowID = keyboard->focus ? keyboard->focus->id : 0;
|
||||
posted = (SDL_PushEvent(&event) > 0);
|
||||
|
|
@ -855,6 +845,19 @@ SDL_SetModState(SDL_Keymod modstate)
|
|||
keyboard->modstate = modstate;
|
||||
}
|
||||
|
||||
/* Note that SDL_ToggleModState() is not a public API. SDL_SetModState() is. */
|
||||
void
|
||||
SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
if (toggle) {
|
||||
keyboard->modstate |= modstate;
|
||||
} else {
|
||||
keyboard->modstate &= ~modstate;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SDL_Keycode
|
||||
SDL_GetKeyFromScancode(SDL_Scancode scancode)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -62,6 +62,9 @@ extern void SDL_KeyboardQuit(void);
|
|||
/* Convert to UTF-8 */
|
||||
extern char *SDL_UCS4ToUTF8(Uint32 ch, char *dst);
|
||||
|
||||
/* Toggle on or off pieces of the keyboard mod state. */
|
||||
extern void SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle);
|
||||
|
||||
#endif /* _SDL_keyboard_c_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -140,14 +140,14 @@ static SDL_bool
|
|||
SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint32 buttonstate)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
int w, h;
|
||||
SDL_bool inWindow;
|
||||
SDL_bool inWindow = SDL_TRUE;
|
||||
|
||||
SDL_GetWindowSize(window, &w, &h);
|
||||
if (x < 0 || y < 0 || x >= w || y >= h) {
|
||||
inWindow = SDL_FALSE;
|
||||
} else {
|
||||
inWindow = SDL_TRUE;
|
||||
if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
|
||||
int w, h;
|
||||
SDL_GetWindowSize(window, &w, &h);
|
||||
if (x < 0 || y < 0 || x >= w || y >= h) {
|
||||
inWindow = SDL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Linux doesn't give you mouse events outside your window unless you grab
|
||||
|
|
@ -204,7 +204,6 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ
|
|||
int posted;
|
||||
int xrel;
|
||||
int yrel;
|
||||
int x_max = 0, y_max = 0;
|
||||
|
||||
if (mouse->relative_mode_warp) {
|
||||
int center_x = 0, center_y = 0;
|
||||
|
|
@ -246,23 +245,29 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ
|
|||
mouse->y += yrel;
|
||||
}
|
||||
|
||||
SDL_GetWindowSize(mouse->focus, &x_max, &y_max);
|
||||
--x_max;
|
||||
--y_max;
|
||||
/* make sure that the pointers find themselves inside the windows,
|
||||
unless we have the mouse captured. */
|
||||
if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) {
|
||||
int x_max = 0, y_max = 0;
|
||||
|
||||
/* make sure that the pointers find themselves inside the windows */
|
||||
if (mouse->x > x_max) {
|
||||
mouse->x = x_max;
|
||||
}
|
||||
if (mouse->x < 0) {
|
||||
mouse->x = 0;
|
||||
}
|
||||
// !!! FIXME: shouldn't this be (window) instead of (mouse->focus)?
|
||||
SDL_GetWindowSize(mouse->focus, &x_max, &y_max);
|
||||
--x_max;
|
||||
--y_max;
|
||||
|
||||
if (mouse->y > y_max) {
|
||||
mouse->y = y_max;
|
||||
}
|
||||
if (mouse->y < 0) {
|
||||
mouse->y = 0;
|
||||
if (mouse->x > x_max) {
|
||||
mouse->x = x_max;
|
||||
}
|
||||
if (mouse->x < 0) {
|
||||
mouse->x = 0;
|
||||
}
|
||||
|
||||
if (mouse->y > y_max) {
|
||||
mouse->y = y_max;
|
||||
}
|
||||
if (mouse->y < 0) {
|
||||
mouse->y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
mouse->xdelta += xrel;
|
||||
|
|
@ -288,9 +293,14 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ
|
|||
event.motion.yrel = yrel;
|
||||
posted = (SDL_PushEvent(&event) > 0);
|
||||
}
|
||||
/* Use unclamped values if we're getting events outside the window */
|
||||
mouse->last_x = x;
|
||||
mouse->last_y = y;
|
||||
if (relative) {
|
||||
mouse->last_x = mouse->x;
|
||||
mouse->last_y = mouse->y;
|
||||
} else {
|
||||
/* Use unclamped values if we're getting events outside the window */
|
||||
mouse->last_x = x;
|
||||
mouse->last_y = y;
|
||||
}
|
||||
return posted;
|
||||
}
|
||||
|
||||
|
|
@ -298,10 +308,11 @@ static SDL_MouseClickState *GetMouseClickState(SDL_Mouse *mouse, Uint8 button)
|
|||
{
|
||||
if (button >= mouse->num_clickstates) {
|
||||
int i, count = button + 1;
|
||||
mouse->clickstate = (SDL_MouseClickState *)SDL_realloc(mouse->clickstate, count * sizeof(*mouse->clickstate));
|
||||
if (!mouse->clickstate) {
|
||||
SDL_MouseClickState *clickstate = (SDL_MouseClickState *)SDL_realloc(mouse->clickstate, count * sizeof(*mouse->clickstate));
|
||||
if (!clickstate) {
|
||||
return NULL;
|
||||
}
|
||||
mouse->clickstate = clickstate;
|
||||
|
||||
for (i = mouse->num_clickstates; i < count; ++i) {
|
||||
SDL_zero(mouse->clickstate[i]);
|
||||
|
|
@ -392,7 +403,7 @@ SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8
|
|||
}
|
||||
|
||||
int
|
||||
SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y)
|
||||
SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y, SDL_MouseWheelDirection direction)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
int posted;
|
||||
|
|
@ -414,6 +425,7 @@ SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y)
|
|||
event.wheel.which = mouseID;
|
||||
event.wheel.x = x;
|
||||
event.wheel.y = y;
|
||||
event.wheel.direction = (Uint32)direction;
|
||||
posted = (SDL_PushEvent(&event) > 0);
|
||||
}
|
||||
return posted;
|
||||
|
|
@ -425,6 +437,9 @@ SDL_MouseQuit(void)
|
|||
SDL_Cursor *cursor, *next;
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
if (mouse->CaptureMouse) {
|
||||
SDL_CaptureMouse(SDL_FALSE);
|
||||
}
|
||||
SDL_SetRelativeMouseMode(SDL_FALSE);
|
||||
SDL_ShowCursor(1);
|
||||
|
||||
|
|
@ -476,16 +491,42 @@ SDL_GetRelativeMouseState(int *x, int *y)
|
|||
return mouse->buttonstate;
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_GetGlobalMouseState(int *x, int *y)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
int tmpx, tmpy;
|
||||
|
||||
/* make sure these are never NULL for the backend implementations... */
|
||||
if (!x) {
|
||||
x = &tmpx;
|
||||
}
|
||||
if (!y) {
|
||||
y = &tmpy;
|
||||
}
|
||||
|
||||
*x = *y = 0;
|
||||
|
||||
if (!mouse->GetGlobalMouseState) {
|
||||
SDL_assert(0 && "This should really be implemented for every target.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return mouse->GetGlobalMouseState(x, y);
|
||||
}
|
||||
|
||||
void
|
||||
SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
if ( window == NULL )
|
||||
if (window == NULL) {
|
||||
window = mouse->focus;
|
||||
}
|
||||
|
||||
if ( window == NULL )
|
||||
if (window == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mouse->WarpMouse) {
|
||||
mouse->WarpMouse(window, x, y);
|
||||
|
|
@ -494,6 +535,18 @@ SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
SDL_WarpMouseGlobal(int x, int y)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
if (mouse->WarpMouseGlobal) {
|
||||
return mouse->WarpMouseGlobal(x, y);
|
||||
}
|
||||
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
ShouldUseRelativeModeWarp(SDL_Mouse *mouse)
|
||||
{
|
||||
|
|
@ -539,7 +592,7 @@ SDL_SetRelativeMouseMode(SDL_bool enabled)
|
|||
mouse->relative_mode_warp = SDL_TRUE;
|
||||
} else if (mouse->SetRelativeMouseMode(enabled) < 0) {
|
||||
if (enabled) {
|
||||
// Fall back to warp mode if native relative mode failed
|
||||
/* Fall back to warp mode if native relative mode failed */
|
||||
mouse->relative_mode_warp = SDL_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -571,6 +624,41 @@ SDL_GetRelativeMouseMode()
|
|||
return mouse->relative_mode;
|
||||
}
|
||||
|
||||
int
|
||||
SDL_CaptureMouse(SDL_bool enabled)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
SDL_Window *focusWindow;
|
||||
SDL_bool isCaptured;
|
||||
|
||||
if (!mouse->CaptureMouse) {
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
focusWindow = SDL_GetKeyboardFocus();
|
||||
|
||||
isCaptured = focusWindow && (focusWindow->flags & SDL_WINDOW_MOUSE_CAPTURE);
|
||||
if (isCaptured == enabled) {
|
||||
return 0; /* already done! */
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
if (!focusWindow) {
|
||||
return SDL_SetError("No window has focus");
|
||||
} else if (mouse->CaptureMouse(focusWindow) == -1) {
|
||||
return -1; /* CaptureMouse() should call SetError */
|
||||
}
|
||||
focusWindow->flags |= SDL_WINDOW_MOUSE_CAPTURE;
|
||||
} else {
|
||||
if (mouse->CaptureMouse(NULL) == -1) {
|
||||
return -1; /* CaptureMouse() should call SetError */
|
||||
}
|
||||
focusWindow->flags &= ~SDL_WINDOW_MOUSE_CAPTURE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_Cursor *
|
||||
SDL_CreateCursor(const Uint8 * data, const Uint8 * mask,
|
||||
int w, int h, int hot_x, int hot_y)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -57,12 +57,21 @@ typedef struct
|
|||
/* Free a window manager cursor */
|
||||
void (*FreeCursor) (SDL_Cursor * cursor);
|
||||
|
||||
/* Warp the mouse to (x,y) */
|
||||
/* Warp the mouse to (x,y) within a window */
|
||||
void (*WarpMouse) (SDL_Window * window, int x, int y);
|
||||
|
||||
/* Warp the mouse to (x,y) in screen space */
|
||||
int (*WarpMouseGlobal) (int x, int y);
|
||||
|
||||
/* Set relative mode */
|
||||
int (*SetRelativeMouseMode) (SDL_bool enabled);
|
||||
|
||||
/* Set mouse capture */
|
||||
int (*CaptureMouse) (SDL_Window * window);
|
||||
|
||||
/* Get absolute mouse coordinates. (x) and (y) are never NULL and set to zero before call. */
|
||||
Uint32 (*GetGlobalMouseState) (int *x, int *y);
|
||||
|
||||
/* Data common to all mice */
|
||||
SDL_MouseID mouseID;
|
||||
SDL_Window *focus;
|
||||
|
|
@ -111,7 +120,7 @@ extern int SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int rel
|
|||
extern int SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button);
|
||||
|
||||
/* Send a mouse wheel event */
|
||||
extern int SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y);
|
||||
extern int SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y, SDL_MouseWheelDirection direction);
|
||||
|
||||
/* Shutdown the mouse subsystem */
|
||||
extern void SDL_MouseQuit(void);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -19,6 +19,8 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "../SDL_internal.h"
|
||||
#include "SDL_hints.h"
|
||||
#include "SDL_assert.h"
|
||||
|
||||
/* General quit handling code for SDL */
|
||||
|
||||
|
|
@ -29,6 +31,8 @@
|
|||
#include "SDL_events.h"
|
||||
#include "SDL_events_c.h"
|
||||
|
||||
static SDL_bool disable_signals = SDL_FALSE;
|
||||
static SDL_bool send_quit_pending = SDL_FALSE;
|
||||
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
static void
|
||||
|
|
@ -37,14 +41,15 @@ SDL_HandleSIG(int sig)
|
|||
/* Reset the signal handler */
|
||||
signal(sig, SDL_HandleSIG);
|
||||
|
||||
/* Signal a quit interrupt */
|
||||
SDL_SendQuit();
|
||||
/* Send a quit event next time the event loop pumps. */
|
||||
/* We can't send it in signal handler; malloc() might be interrupted! */
|
||||
send_quit_pending = SDL_TRUE;
|
||||
}
|
||||
#endif /* HAVE_SIGNAL_H */
|
||||
|
||||
/* Public functions */
|
||||
int
|
||||
SDL_QuitInit(void)
|
||||
static int
|
||||
SDL_QuitInit_Internal(void)
|
||||
{
|
||||
#ifdef HAVE_SIGACTION
|
||||
struct sigaction action;
|
||||
|
|
@ -80,11 +85,22 @@ SDL_QuitInit(void)
|
|||
#endif /* HAVE_SIGNAL_H */
|
||||
|
||||
/* That's it! */
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
SDL_QuitQuit(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) {
|
||||
return SDL_QuitInit_Internal();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
SDL_QuitQuit_Internal(void)
|
||||
{
|
||||
#ifdef HAVE_SIGACTION
|
||||
struct sigaction action;
|
||||
|
|
@ -110,11 +126,29 @@ SDL_QuitQuit(void)
|
|||
#endif /* HAVE_SIGNAL_H */
|
||||
}
|
||||
|
||||
void
|
||||
SDL_QuitQuit(void)
|
||||
{
|
||||
if (!disable_signals) {
|
||||
SDL_QuitQuit_Internal();
|
||||
}
|
||||
}
|
||||
|
||||
/* This function returns 1 if it's okay to close the application window */
|
||||
int
|
||||
SDL_SendQuit(void)
|
||||
{
|
||||
send_quit_pending = SDL_FALSE;
|
||||
return SDL_SendAppEvent(SDL_QUIT);
|
||||
}
|
||||
|
||||
void
|
||||
SDL_SendPendingQuit(void)
|
||||
{
|
||||
if (send_quit_pending) {
|
||||
SDL_SendQuit();
|
||||
SDL_assert(!send_quit_pending);
|
||||
}
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -145,13 +145,16 @@ SDL_AddTouch(SDL_TouchID touchID, const char *name)
|
|||
}
|
||||
|
||||
SDL_touchDevices = touchDevices;
|
||||
index = SDL_num_touch++;
|
||||
index = SDL_num_touch;
|
||||
|
||||
SDL_touchDevices[index] = (SDL_Touch *) SDL_malloc(sizeof(*SDL_touchDevices[index]));
|
||||
if (!SDL_touchDevices[index]) {
|
||||
return SDL_OutOfMemory();
|
||||
}
|
||||
|
||||
/* Added touch to list */
|
||||
++SDL_num_touch;
|
||||
|
||||
/* we're setting the touch properties */
|
||||
SDL_touchDevices[index]->id = touchID;
|
||||
SDL_touchDevices[index]->num_fingers = 0;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -127,6 +127,7 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1,
|
|||
if (window->flags & SDL_WINDOW_MINIMIZED) {
|
||||
return 0;
|
||||
}
|
||||
window->flags &= ~SDL_WINDOW_MAXIMIZED;
|
||||
window->flags |= SDL_WINDOW_MINIMIZED;
|
||||
SDL_OnWindowMinimized(window);
|
||||
break;
|
||||
|
|
@ -134,6 +135,7 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1,
|
|||
if (window->flags & SDL_WINDOW_MAXIMIZED) {
|
||||
return 0;
|
||||
}
|
||||
window->flags &= ~SDL_WINDOW_MINIMIZED;
|
||||
window->flags |= SDL_WINDOW_MAXIMIZED;
|
||||
break;
|
||||
case SDL_WINDOWEVENT_RESTORED:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -110,5 +110,5 @@ static const unsigned char default_cmask[] = {
|
|||
0x03, 0x00
|
||||
};
|
||||
|
||||
#endif /* TRUE_MACINTOSH_CURSOR */
|
||||
#endif /* USE_MACOS_CURSOR */
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -49,7 +49,7 @@ static const SDL_Scancode windows_scancode_table[] =
|
|||
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_F13, SDL_SCANCODE_F14, SDL_SCANCODE_F15, SDL_SCANCODE_F16, /* 6 */
|
||||
SDL_SCANCODE_F17, SDL_SCANCODE_F18, SDL_SCANCODE_F19, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 6 */
|
||||
|
||||
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 7 */
|
||||
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN /* 7 */
|
||||
SDL_SCANCODE_INTERNATIONAL2, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL1, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 7 */
|
||||
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL4, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL5, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL3, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN /* 7 */
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
|
@ -141,15 +141,15 @@ static const SDL_Scancode xfree86_scancode_table[] = {
|
|||
/* 112 */ SDL_SCANCODE_F15,
|
||||
/* 113 */ SDL_SCANCODE_F16,
|
||||
/* 114 */ SDL_SCANCODE_F17,
|
||||
/* 115 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 115 */ SDL_SCANCODE_INTERNATIONAL1, /* \_ */
|
||||
/* 116 */ SDL_SCANCODE_UNKNOWN, /* is translated to XK_ISO_Level3_Shift by my X server, but I have no keyboard that generates this code, so I don't know what the correct SDL_SCANCODE_* for it is */
|
||||
/* 117 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 118 */ SDL_SCANCODE_KP_EQUALS,
|
||||
/* 119 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 120 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 121 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 121 */ SDL_SCANCODE_INTERNATIONAL4, /* Henkan_Mode */
|
||||
/* 122 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 123 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 123 */ SDL_SCANCODE_INTERNATIONAL5, /* Muhenkan */
|
||||
/* 124 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 125 */ SDL_SCANCODE_INTERNATIONAL3, /* Yen */
|
||||
/* 126 */ SDL_SCANCODE_UNKNOWN,
|
||||
|
|
@ -266,12 +266,12 @@ static const SDL_Scancode xfree86_scancode_table2[] = {
|
|||
/* 86 */ SDL_SCANCODE_NONUSBACKSLASH,
|
||||
/* 87 */ SDL_SCANCODE_F11,
|
||||
/* 88 */ SDL_SCANCODE_F12,
|
||||
/* 89 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 89 */ SDL_SCANCODE_INTERNATIONAL1, /* \_ */
|
||||
/* 90 */ SDL_SCANCODE_UNKNOWN, /* Katakana */
|
||||
/* 91 */ SDL_SCANCODE_UNKNOWN, /* Hiragana */
|
||||
/* 92 */ SDL_SCANCODE_UNKNOWN, /* Henkan_Mode */
|
||||
/* 93 */ SDL_SCANCODE_UNKNOWN, /* Hiragana_Katakana */
|
||||
/* 94 */ SDL_SCANCODE_UNKNOWN, /* Muhenkan */
|
||||
/* 92 */ SDL_SCANCODE_INTERNATIONAL4, /* Henkan_Mode */
|
||||
/* 93 */ SDL_SCANCODE_INTERNATIONAL2, /* Hiragana_Katakana */
|
||||
/* 94 */ SDL_SCANCODE_INTERNATIONAL5, /* Muhenkan */
|
||||
/* 95 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 96 */ SDL_SCANCODE_KP_ENTER,
|
||||
/* 97 */ SDL_SCANCODE_RCTRL,
|
||||
|
|
@ -301,7 +301,7 @@ static const SDL_Scancode xfree86_scancode_table2[] = {
|
|||
/* 121 */ SDL_SCANCODE_UNKNOWN, /* KP_Decimal */
|
||||
/* 122 */ SDL_SCANCODE_UNKNOWN, /* Hangul */
|
||||
/* 123 */ SDL_SCANCODE_UNKNOWN, /* Hangul_Hanja */
|
||||
/* 124 */ SDL_SCANCODE_UNKNOWN,
|
||||
/* 124 */ SDL_SCANCODE_INTERNATIONAL3, /* Yen */
|
||||
/* 125 */ SDL_SCANCODE_LGUI,
|
||||
/* 126 */ SDL_SCANCODE_RGUI,
|
||||
/* 127 */ SDL_SCANCODE_APPLICATION,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue