Merged SDL2 changes from bartbes/love-experiments/SDL2 into default.

- Added love.system module, including clipboard functions.

- Added custom hardware cursors (love.mouse.newCursor, love.mouse.setCursor.)

- Revamped love.joystick:
-- added Joystick objects and moved love.joystick functions which operated on individual joysticks to methods on the Joystick objects.
-- Added love.joystick.getJoystick and love.joystick.getJoystickCount.
-- Added events for when joysticks are connected and disconnected.
-- Added 'Gamepad' methods to Joystick objects: Joystick:isGamepad, Joystick:getGamepadAxis, and Joystick:isGamepadDown. They're a common abstraction for xbox controller-like joystick across operating systems.

- Added monitor choosing support and "fullscreen desktop" mode to love.window.

- Moved unicode text input events to their own callback function (love.textinput), removed the key repeat functions from love.keyboard and made the second argument of love.keypressed a boolean saying whether the keypress was a repeat.

- liblove now works with love.window and love.graphics in OS X
This commit is contained in:
Alex Szpakowski
2013-08-25 16:51:42 -03:00
parent 035130533b
commit 113ed1cfe7
67 changed files with 4691 additions and 1665 deletions
+103 -54
View File
@@ -39,12 +39,10 @@ bool Keyboard::getConstant(Keyboard::Key in, const char *&out)
StringMap<Keyboard::Key, Keyboard::KEY_MAX_ENUM>::Entry Keyboard::keyEntries[] =
{
{"return", Keyboard::KEY_RETURN},
{"escape", Keyboard::KEY_ESCAPE},
{"backspace", Keyboard::KEY_BACKSPACE},
{"tab", Keyboard::KEY_TAB},
{"clear", Keyboard::KEY_CLEAR},
{"return", Keyboard::KEY_RETURN},
{"pause", Keyboard::KEY_PAUSE},
{"escape", Keyboard::KEY_ESCAPE},
{" ", Keyboard::KEY_SPACE},
{"!", Keyboard::KEY_EXCLAIM},
{"\"", Keyboard::KEY_QUOTEDBL},
@@ -110,35 +108,8 @@ StringMap<Keyboard::Key, Keyboard::KEY_MAX_ENUM>::Entry Keyboard::keyEntries[] =
{"x", Keyboard::KEY_X},
{"y", Keyboard::KEY_Y},
{"z", Keyboard::KEY_Z},
{"delete", Keyboard::KEY_DELETE},
{"kp0", Keyboard::KEY_KP0},
{"kp1", Keyboard::KEY_KP1},
{"kp2", Keyboard::KEY_KP2},
{"kp3", Keyboard::KEY_KP3},
{"kp4", Keyboard::KEY_KP4},
{"kp5", Keyboard::KEY_KP5},
{"kp6", Keyboard::KEY_KP6},
{"kp7", Keyboard::KEY_KP7},
{"kp8", Keyboard::KEY_KP8},
{"kp9", Keyboard::KEY_KP9},
{"kp.", Keyboard::KEY_KP_PERIOD},
{"kp/", Keyboard::KEY_KP_DIVIDE},
{"kp*", Keyboard::KEY_KP_MULTIPLY},
{"kp-", Keyboard::KEY_KP_MINUS},
{"kp+", Keyboard::KEY_KP_PLUS},
{"kpenter", Keyboard::KEY_KP_ENTER},
{"kp=", Keyboard::KEY_KP_EQUALS},
{"up", Keyboard::KEY_UP},
{"down", Keyboard::KEY_DOWN},
{"right", Keyboard::KEY_RIGHT},
{"left", Keyboard::KEY_LEFT},
{"insert", Keyboard::KEY_INSERT},
{"home", Keyboard::KEY_HOME},
{"end", Keyboard::KEY_END},
{"pageup", Keyboard::KEY_PAGEUP},
{"pagedown", Keyboard::KEY_PAGEDOWN},
{"capslock", Keyboard::KEY_CAPSLOCK},
{"f1", Keyboard::KEY_F1},
{"f2", Keyboard::KEY_F2},
@@ -152,34 +123,112 @@ StringMap<Keyboard::Key, Keyboard::KEY_MAX_ENUM>::Entry Keyboard::keyEntries[] =
{"f10", Keyboard::KEY_F10},
{"f11", Keyboard::KEY_F11},
{"f12", Keyboard::KEY_F12},
{"printscreen", Keyboard::KEY_PRINTSCREEN},
{"scrolllock", Keyboard::KEY_SCROLLLOCK},
{"pause", Keyboard::KEY_PAUSE},
{"insert", Keyboard::KEY_INSERT},
{"home", Keyboard::KEY_HOME},
{"pageup", Keyboard::KEY_PAGEUP},
{"delete", Keyboard::KEY_DELETE},
{"end", Keyboard::KEY_END},
{"pagedown", Keyboard::KEY_PAGEDOWN},
{"right", Keyboard::KEY_RIGHT},
{"left", Keyboard::KEY_LEFT},
{"down", Keyboard::KEY_DOWN},
{"up", Keyboard::KEY_UP},
{"numlock", Keyboard::KEY_NUMLOCKCLEAR},
{"kp/", Keyboard::KEY_KP_DIVIDE},
{"kp*", Keyboard::KEY_KP_MULTIPLY},
{"kp-", Keyboard::KEY_KP_MINUS},
{"kp+", Keyboard::KEY_KP_PLUS},
{"kpenter", Keyboard::KEY_KP_ENTER},
{"kp0", Keyboard::KEY_KP_0},
{"kp1", Keyboard::KEY_KP_1},
{"kp2", Keyboard::KEY_KP_2},
{"kp3", Keyboard::KEY_KP_3},
{"kp4", Keyboard::KEY_KP_4},
{"kp5", Keyboard::KEY_KP_5},
{"kp6", Keyboard::KEY_KP_6},
{"kp7", Keyboard::KEY_KP_7},
{"kp8", Keyboard::KEY_KP_8},
{"kp9", Keyboard::KEY_KP_9},
{"kp.", Keyboard::KEY_KP_PERIOD},
{"kp,", Keyboard::KEY_KP_COMMA},
{"kp=", Keyboard::KEY_KP_EQUALS},
{"application", Keyboard::KEY_APPLICATION},
{"power", Keyboard::KEY_POWER},
{"f13", Keyboard::KEY_F13},
{"f14", Keyboard::KEY_F14},
{"f15", Keyboard::KEY_F15},
{"numlock", Keyboard::KEY_NUMLOCK},
{"capslock", Keyboard::KEY_CAPSLOCK},
{"scrollock", Keyboard::KEY_SCROLLOCK},
{"rshift", Keyboard::KEY_RSHIFT},
{"lshift", Keyboard::KEY_LSHIFT},
{"rctrl", Keyboard::KEY_RCTRL},
{"lctrl", Keyboard::KEY_LCTRL},
{"ralt", Keyboard::KEY_RALT},
{"lalt", Keyboard::KEY_LALT},
{"rmeta", Keyboard::KEY_RMETA},
{"lmeta", Keyboard::KEY_LMETA},
{"lsuper", Keyboard::KEY_LSUPER},
{"rsuper", Keyboard::KEY_RSUPER},
{"mode", Keyboard::KEY_MODE},
{"compose", Keyboard::KEY_COMPOSE},
{"f16", Keyboard::KEY_F16},
{"f17", Keyboard::KEY_F17},
{"f18", Keyboard::KEY_F18},
{"f19", Keyboard::KEY_F19},
{"f20", Keyboard::KEY_F20},
{"f21", Keyboard::KEY_F21},
{"f22", Keyboard::KEY_F22},
{"f23", Keyboard::KEY_F23},
{"f24", Keyboard::KEY_F24},
{"execute", Keyboard::KEY_EXECUTE},
{"help", Keyboard::KEY_HELP},
{"print", Keyboard::KEY_PRINT},
{"sysreq", Keyboard::KEY_SYSREQ},
{"break", Keyboard::KEY_BREAK},
{"menu", Keyboard::KEY_MENU},
{"power", Keyboard::KEY_POWER},
{"euro", Keyboard::KEY_EURO},
{"select", Keyboard::KEY_SELECT},
{"stop", Keyboard::KEY_STOP},
{"again", Keyboard::KEY_AGAIN},
{"undo", Keyboard::KEY_UNDO},
{"cut", Keyboard::KEY_CUT},
{"copy", Keyboard::KEY_COPY},
{"paste", Keyboard::KEY_PASTE},
{"find", Keyboard::KEY_FIND},
{"mute", Keyboard::KEY_MUTE},
{"volumeup", Keyboard::KEY_VOLUMEUP},
{"volumedown", Keyboard::KEY_VOLUMEDOWN},
{"alterase", Keyboard::KEY_ALTERASE},
{"sysreq", Keyboard::KEY_SYSREQ},
{"cancel", Keyboard::KEY_CANCEL},
{"clear", Keyboard::KEY_CLEAR},
{"prior", Keyboard::KEY_PRIOR},
{"return2", Keyboard::KEY_RETURN2},
{"separator", Keyboard::KEY_SEPARATOR},
{"out", Keyboard::KEY_OUT},
{"oper", Keyboard::KEY_OPER},
{"clearagain", Keyboard::KEY_CLEARAGAIN},
{"thsousandsseparator", Keyboard::KEY_THOUSANDSSEPARATOR},
{"decimalseparator", Keyboard::KEY_DECIMALSEPARATOR},
{"currencyunit", Keyboard::KEY_CURRENCYUNIT},
{"currencysubunit", Keyboard::KEY_CURRENCYSUBUNIT},
{"lctrl", Keyboard::KEY_LCTRL},
{"lshift", Keyboard::KEY_LSHIFT},
{"lalt", Keyboard::KEY_LALT},
{"lgui", Keyboard::KEY_LGUI},
{"rctrl", Keyboard::KEY_RCTRL},
{"rshift", Keyboard::KEY_RSHIFT},
{"ralt", Keyboard::KEY_RALT},
{"rgui", Keyboard::KEY_RGUI},
{"mode", Keyboard::KEY_MODE},
{"audionext", Keyboard::KEY_AUDIONEXT},
{"audioprev", Keyboard::KEY_AUDIOPREV},
{"audiostop", Keyboard::KEY_AUDIOSTOP},
{"audioplay", Keyboard::KEY_AUDIOPLAY},
{"audiomute", Keyboard::KEY_AUDIOMUTE},
{"mediaselect", Keyboard::KEY_MEDIASELECT},
{"brightnessdown", Keyboard::KEY_BRIGHTNESSDOWN},
{"brightnessup", Keyboard::KEY_BRIGHTNESSUP},
{"displayswitch", Keyboard::KEY_DISPLAYSWITCH},
{"kbdillumtoggle", Keyboard::KEY_KBDILLUMTOGGLE},
{"kbdillumdown", Keyboard::KEY_KBDILLUMDOWN},
{"kbdillumup", Keyboard::KEY_KBDILLUMUP},
{"eject", Keyboard::KEY_EJECT},
{"sleep", Keyboard::KEY_SLEEP},
};
StringMap<Keyboard::Key, Keyboard::KEY_MAX_ENUM> Keyboard::keys(Keyboard::keyEntries, sizeof(Keyboard::keyEntries));