OpenMW
|
A wrapper around SDL's event queue, mostly used for handling input-related events. More...
#include <sdlinputwrapper.hpp>
Public Member Functions | |
InputWrapper (SDL_Window *window, osg::ref_ptr< osgViewer::Viewer > viewer, bool grab) | |
~InputWrapper () | |
void | setMouseEventCallback (MouseListener *listen) |
void | setKeyboardEventCallback (KeyListener *listen) |
void | setWindowEventCallback (WindowListener *listen) |
void | setControllerEventCallback (ControllerListener *listen) |
void | capture (bool windowEventsOnly) |
bool | isModifierHeld (SDL_Keymod mod) |
bool | isKeyDown (SDL_Scancode key) |
void | setMouseVisible (bool visible) |
void | setMouseRelative (bool relative) |
Set the mouse to relative positioning. Doesn't move the cursor and disables mouse acceleration. More... | |
bool | getMouseRelative () |
void | setGrabPointer (bool grab) |
Locks the pointer to the window. More... | |
OIS::KeyCode | sdl2OISKeyCode (SDL_Keycode code) |
void | warpMouse (int x, int y) |
Moves the mouse to the specified point within the viewport. More... | |
void | updateMouseSettings () |
Private Types | |
typedef std::map< SDL_Keycode, OIS::KeyCode > | KeyMap |
Private Member Functions | |
void | handleWindowEvent (const SDL_Event &evt) |
bool | _handleWarpMotion (const SDL_MouseMotionEvent &evt) |
Internal method for ignoring relative motions as a side effect of warpMouse() More... | |
void | _wrapMousePointer (const SDL_MouseMotionEvent &evt) |
Wrap the mouse to the viewport. More... | |
MouseMotionEvent | _packageMouseMotion (const SDL_Event &evt) |
Package mouse and mousewheel motions into a single event. More... | |
void | _setupOISKeys () |
Private Attributes | |
SDL_Window * | mSDLWindow |
osg::ref_ptr< osgViewer::Viewer > | mViewer |
MouseListener * | mMouseListener |
KeyListener * | mKeyboardListener |
WindowListener * | mWindowListener |
ControllerListener * | mConListener |
KeyMap | mKeyMap |
Uint16 | mWarpX |
Uint16 | mWarpY |
bool | mWarpCompensate |
bool | mWrapPointer |
bool | mAllowGrab |
bool | mWantMouseVisible |
bool | mWantGrab |
bool | mWantRelative |
bool | mGrabPointer |
bool | mMouseRelative |
bool | mFirstMouseMove |
Sint32 | mMouseZ |
Sint32 | mMouseX |
Sint32 | mMouseY |
bool | mWindowHasFocus |
bool | mMouseInWindow |
A wrapper around SDL's event queue, mostly used for handling input-related events.
|
private |
SDLUtil::InputWrapper::InputWrapper | ( | SDL_Window * | window, |
osg::ref_ptr< osgViewer::Viewer > | viewer, | ||
bool | grab | ||
) |
SDLUtil::InputWrapper::~InputWrapper | ( | ) |
|
private |
Internal method for ignoring relative motions as a side effect of warpMouse()
|
private |
Package mouse and mousewheel motions into a single event.
|
private |
|
private |
Wrap the mouse to the viewport.
void SDLUtil::InputWrapper::capture | ( | bool | windowEventsOnly | ) |
|
inline |
|
private |
bool SDLUtil::InputWrapper::isKeyDown | ( | SDL_Scancode | key | ) |
bool SDLUtil::InputWrapper::isModifierHeld | ( | SDL_Keymod | mod | ) |
OIS::KeyCode SDLUtil::InputWrapper::sdl2OISKeyCode | ( | SDL_Keycode | code | ) |
|
inline |
void SDLUtil::InputWrapper::setGrabPointer | ( | bool | grab | ) |
Locks the pointer to the window.
|
inline |
|
inline |
void SDLUtil::InputWrapper::setMouseRelative | ( | bool | relative | ) |
Set the mouse to relative positioning. Doesn't move the cursor and disables mouse acceleration.
void SDLUtil::InputWrapper::setMouseVisible | ( | bool | visible | ) |
|
inline |
void SDLUtil::InputWrapper::updateMouseSettings | ( | ) |
Moves the mouse to the specified point within the viewport.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |