mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-25 18:10:46 +00:00
Prepend key modifier enum values with 'SDL_'
This commit is contained in:
committed by
Sam Lantinga
parent
b7ac14f2bd
commit
abdfa809db
@@ -67,40 +67,40 @@ print_modifiers(char **text, size_t *maxlen)
|
||||
print_string(text, maxlen, " (none)");
|
||||
return;
|
||||
}
|
||||
if (mod & KMOD_LSHIFT) {
|
||||
if (mod & SDL_KMOD_LSHIFT) {
|
||||
print_string(text, maxlen, " LSHIFT");
|
||||
}
|
||||
if (mod & KMOD_RSHIFT) {
|
||||
if (mod & SDL_KMOD_RSHIFT) {
|
||||
print_string(text, maxlen, " RSHIFT");
|
||||
}
|
||||
if (mod & KMOD_LCTRL) {
|
||||
if (mod & SDL_KMOD_LCTRL) {
|
||||
print_string(text, maxlen, " LCTRL");
|
||||
}
|
||||
if (mod & KMOD_RCTRL) {
|
||||
if (mod & SDL_KMOD_RCTRL) {
|
||||
print_string(text, maxlen, " RCTRL");
|
||||
}
|
||||
if (mod & KMOD_LALT) {
|
||||
if (mod & SDL_KMOD_LALT) {
|
||||
print_string(text, maxlen, " LALT");
|
||||
}
|
||||
if (mod & KMOD_RALT) {
|
||||
if (mod & SDL_KMOD_RALT) {
|
||||
print_string(text, maxlen, " RALT");
|
||||
}
|
||||
if (mod & KMOD_LGUI) {
|
||||
if (mod & SDL_KMOD_LGUI) {
|
||||
print_string(text, maxlen, " LGUI");
|
||||
}
|
||||
if (mod & KMOD_RGUI) {
|
||||
if (mod & SDL_KMOD_RGUI) {
|
||||
print_string(text, maxlen, " RGUI");
|
||||
}
|
||||
if (mod & KMOD_NUM) {
|
||||
if (mod & SDL_KMOD_NUM) {
|
||||
print_string(text, maxlen, " NUM");
|
||||
}
|
||||
if (mod & KMOD_CAPS) {
|
||||
if (mod & SDL_KMOD_CAPS) {
|
||||
print_string(text, maxlen, " CAPS");
|
||||
}
|
||||
if (mod & KMOD_MODE) {
|
||||
if (mod & SDL_KMOD_MODE) {
|
||||
print_string(text, maxlen, " MODE");
|
||||
}
|
||||
if (mod & KMOD_SCROLL) {
|
||||
if (mod & SDL_KMOD_SCROLL) {
|
||||
print_string(text, maxlen, " SCROLL");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,40 +64,40 @@ print_modifiers(char **text, size_t *maxlen)
|
||||
print_string(text, maxlen, " (none)");
|
||||
return;
|
||||
}
|
||||
if (mod & KMOD_LSHIFT) {
|
||||
if (mod & SDL_KMOD_LSHIFT) {
|
||||
print_string(text, maxlen, " LSHIFT");
|
||||
}
|
||||
if (mod & KMOD_RSHIFT) {
|
||||
if (mod & SDL_KMOD_RSHIFT) {
|
||||
print_string(text, maxlen, " RSHIFT");
|
||||
}
|
||||
if (mod & KMOD_LCTRL) {
|
||||
if (mod & SDL_KMOD_LCTRL) {
|
||||
print_string(text, maxlen, " LCTRL");
|
||||
}
|
||||
if (mod & KMOD_RCTRL) {
|
||||
if (mod & SDL_KMOD_RCTRL) {
|
||||
print_string(text, maxlen, " RCTRL");
|
||||
}
|
||||
if (mod & KMOD_LALT) {
|
||||
if (mod & SDL_KMOD_LALT) {
|
||||
print_string(text, maxlen, " LALT");
|
||||
}
|
||||
if (mod & KMOD_RALT) {
|
||||
if (mod & SDL_KMOD_RALT) {
|
||||
print_string(text, maxlen, " RALT");
|
||||
}
|
||||
if (mod & KMOD_LGUI) {
|
||||
if (mod & SDL_KMOD_LGUI) {
|
||||
print_string(text, maxlen, " LGUI");
|
||||
}
|
||||
if (mod & KMOD_RGUI) {
|
||||
if (mod & SDL_KMOD_RGUI) {
|
||||
print_string(text, maxlen, " RGUI");
|
||||
}
|
||||
if (mod & KMOD_NUM) {
|
||||
if (mod & SDL_KMOD_NUM) {
|
||||
print_string(text, maxlen, " NUM");
|
||||
}
|
||||
if (mod & KMOD_CAPS) {
|
||||
if (mod & SDL_KMOD_CAPS) {
|
||||
print_string(text, maxlen, " CAPS");
|
||||
}
|
||||
if (mod & KMOD_MODE) {
|
||||
if (mod & SDL_KMOD_MODE) {
|
||||
print_string(text, maxlen, " MODE");
|
||||
}
|
||||
if (mod & KMOD_SCROLL) {
|
||||
if (mod & SDL_KMOD_SCROLL) {
|
||||
print_string(text, maxlen, " SCROLL");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,19 +280,19 @@ int keyboard_getSetModState(void *arg)
|
||||
SDL_Keymod currentState;
|
||||
SDL_Keymod newState;
|
||||
SDL_Keymod allStates =
|
||||
KMOD_NONE |
|
||||
KMOD_LSHIFT |
|
||||
KMOD_RSHIFT |
|
||||
KMOD_LCTRL |
|
||||
KMOD_RCTRL |
|
||||
KMOD_LALT |
|
||||
KMOD_RALT |
|
||||
KMOD_LGUI |
|
||||
KMOD_RGUI |
|
||||
KMOD_NUM |
|
||||
KMOD_CAPS |
|
||||
KMOD_MODE |
|
||||
KMOD_SCROLL;
|
||||
SDL_KMOD_NONE |
|
||||
SDL_KMOD_LSHIFT |
|
||||
SDL_KMOD_RSHIFT |
|
||||
SDL_KMOD_LCTRL |
|
||||
SDL_KMOD_RCTRL |
|
||||
SDL_KMOD_LALT |
|
||||
SDL_KMOD_RALT |
|
||||
SDL_KMOD_LGUI |
|
||||
SDL_KMOD_RGUI |
|
||||
SDL_KMOD_NUM |
|
||||
SDL_KMOD_CAPS |
|
||||
SDL_KMOD_MODE |
|
||||
SDL_KMOD_SCROLL;
|
||||
|
||||
/* Get state, cache for later reset */
|
||||
result = SDL_GetModState();
|
||||
|
||||
@@ -356,7 +356,7 @@ static SDL_bool ShowingFront()
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((SDL_GetModState() & KMOD_SHIFT) != 0) {
|
||||
if ((SDL_GetModState() & SDL_KMOD_SHIFT) != 0) {
|
||||
showing_front = SDL_FALSE;
|
||||
}
|
||||
return showing_front;
|
||||
|
||||
@@ -232,7 +232,7 @@ void loop()
|
||||
case SDL_KEYDOWN:
|
||||
switch (event.key.keysym.sym) {
|
||||
case 'l':
|
||||
if (event.key.keysym.mod & KMOD_SHIFT) {
|
||||
if (event.key.keysym.mod & SDL_KMOD_SHIFT) {
|
||||
num_lines = 0;
|
||||
} else {
|
||||
add_line(rand() % 640, rand() % 480, rand() % 640,
|
||||
@@ -240,7 +240,7 @@ void loop()
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
if (event.key.keysym.mod & KMOD_SHIFT) {
|
||||
if (event.key.keysym.mod & SDL_KMOD_SHIFT) {
|
||||
num_rects = 0;
|
||||
} else {
|
||||
add_rect(rand() % 640, rand() % 480, rand() % 640,
|
||||
|
||||
Reference in New Issue
Block a user