mirror of
https://github.com/love2d/love.git
synced 2026-08-17 02:58:31 +02:00
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:
@@ -29,6 +29,9 @@
|
||||
// SDL
|
||||
#include <SDL.h>
|
||||
|
||||
// STL
|
||||
#include <map>
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace event
|
||||
@@ -44,6 +47,7 @@ public:
|
||||
const char *getName() const;
|
||||
|
||||
Event();
|
||||
virtual ~Event();
|
||||
|
||||
/**
|
||||
* Pumps the event queue. This function gathers all the pending input information
|
||||
@@ -66,15 +70,15 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
Message *convert(SDL_Event &e);
|
||||
const char *convertUnicode(Uint16 codepoint) const;
|
||||
Message *convert(const SDL_Event &e) const;
|
||||
Message *convertJoystickEvent(const SDL_Event &e) const;
|
||||
Message *convertWindowEvent(const SDL_Event &e) const;
|
||||
|
||||
static std::map<SDL_Keycode, love::keyboard::Keyboard::Key> createKeyMap();
|
||||
static std::map<SDL_Keycode, love::keyboard::Keyboard::Key> keys;
|
||||
|
||||
static EnumMap<love::keyboard::Keyboard::Key, SDLKey, love::keyboard::Keyboard::KEY_MAX_ENUM>::Entry keyEntries[];
|
||||
static EnumMap<love::keyboard::Keyboard::Key, SDLKey, love::keyboard::Keyboard::KEY_MAX_ENUM> keys;
|
||||
static EnumMap<love::mouse::Mouse::Button, Uint8, love::mouse::Mouse::BUTTON_MAX_ENUM>::Entry buttonEntries[];
|
||||
static EnumMap<love::mouse::Mouse::Button, Uint8, love::mouse::Mouse::BUTTON_MAX_ENUM> buttons;
|
||||
static EnumMap<love::joystick::Joystick::Hat, Uint8, love::joystick::Joystick::HAT_MAX_ENUM>::Entry hatEntries[];
|
||||
static EnumMap<love::joystick::Joystick::Hat, Uint8, love::joystick::Joystick::HAT_MAX_ENUM> hats;
|
||||
|
||||
}; // System
|
||||
|
||||
|
||||
Reference in New Issue
Block a user