![]() |
SLProject
4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
Convenience interface for posting input events to an SLInputManager. More...
#include <SLInputEventInterface.h>
Public Member Functions | |
| SLInputEventInterface (SLInputManager &inputManager) | |
| void | resize (int sceneViewIndex, int width, int height) |
| Posts a resize of the scene view to the given width and height in pixels. More... | |
| void | updateScr2fb (int sceneViewIndex) |
| Posts a request to recompute the screen to framebuffer scale factor. More... | |
| void | mouseDown (int sceneViewIndex, SLMouseButton button, int x, int y, SLKey modifier) |
| Posts a mouse button press at position x, y. More... | |
| void | mouseMove (int sceneViewIndex, int x, int y) |
| Posts a mouse movement to position x, y. More... | |
| void | mouseUp (int sceneViewIndex, SLMouseButton button, int x, int y, SLKey modifier) |
| Posts a mouse button release at position x, y. More... | |
| void | doubleClick (int sceneViewIndex, SLMouseButton button, int x, int y, SLKey modifier) |
| Posts a mouse button double click at position x, y. More... | |
| void | touch2Down (int sceneViewIndex, int x1, int y1, int x2, int y2) |
| Posts a two finger touch down at the two positions x1, y1 and x2, y2. More... | |
| void | touch2Move (int sceneViewIndex, int x1, int y1, int x2, int y2) |
| Posts a two finger move to the two positions x1, y1 and x2, y2. More... | |
| void | touch2Up (int sceneViewIndex, int x1, int y1, int x2, int y2) |
| Posts a two finger lift off from the two positions x1, y1 and x2, y2. More... | |
| void | mouseWheel (int sceneViewIndex, int pos, SLKey modifier) |
| Posts a mouse wheel movement by pos detents. More... | |
| void | keyPress (int sceneViewIndex, SLKey key, SLKey modifier) |
| Posts a key press, for keys that act as commands. More... | |
| void | keyRelease (int sceneViewIndex, SLKey key, SLKey modifier) |
| Posts a key release. More... | |
| void | charInput (int sceneViewIndex, unsigned int character) |
| Posts a translated character, for text entry rather than commands. More... | |
| void | longTouch (int sceneViewIndex, int x, int y) |
| Long touch gesture; accepted but currently ignored. More... | |
| void | scrCaptureRequest (int sceneViewIndex, std::string outputPath) |
| Posts a request to write a screenshot of the scene view to outputPath. More... | |
Private Attributes | |
| SLInputManager & | _inputManager |
| Manager the events are queued on. More... | |
Convenience interface for posting input events to an SLInputManager.
The platform layer receives native events (GLFW, JNI, Objective-C or JavaScript) and forwards them through this interface, which packages each one as an SLInputEvent and queues it on the SLInputManager. The queue is drained during the scene update, so events are never handled on the caller's stack.
Every method takes the index of the SLSceneView the event belongs to, which is carried through to the handler so that multiple views can be fed independently.
Definition at line 28 of file SLInputEventInterface.h.
| SLInputEventInterface::SLInputEventInterface | ( | SLInputManager & | inputManager | ) |
| inputManager | Manager the events are queued on; must outlive this object |
Definition at line 14 of file SLInputEventInterface.cpp.
| void SLInputEventInterface::charInput | ( | int | sceneViewIndex, |
| unsigned int | character | ||
| ) |
Posts a translated character, for text entry rather than commands.
Global event handler for unicode character input.
Definition at line 191 of file SLInputEventInterface.cpp.
| void SLInputEventInterface::doubleClick | ( | int | sceneViewIndex, |
| SLMouseButton | button, | ||
| int | xpos, | ||
| int | ypos, | ||
| SLKey | modifier | ||
| ) |
Posts a mouse button double click at position x, y.
Global event handler for double click events.
Definition at line 80 of file SLInputEventInterface.cpp.
Posts a key press, for keys that act as commands.
Global event handler for keyboard key press events.
Definition at line 164 of file SLInputEventInterface.cpp.
Posts a key release.
Global event handler for keyboard key release events.
Definition at line 177 of file SLInputEventInterface.cpp.
|
inline |
Long touch gesture; accepted but currently ignored.
Definition at line 76 of file SLInputEventInterface.h.
| void SLInputEventInterface::mouseDown | ( | int | sceneViewIndex, |
| SLMouseButton | button, | ||
| int | xpos, | ||
| int | ypos, | ||
| SLKey | modifier | ||
| ) |
Posts a mouse button press at position x, y.
Global event handler for mouse button down events.
Definition at line 33 of file SLInputEventInterface.cpp.
| void SLInputEventInterface::mouseMove | ( | int | sceneViewIndex, |
| int | x, | ||
| int | y | ||
| ) |
Posts a mouse movement to position x, y.
Global event handler for mouse move events.
Definition at line 50 of file SLInputEventInterface.cpp.
| void SLInputEventInterface::mouseUp | ( | int | sceneViewIndex, |
| SLMouseButton | button, | ||
| int | xpos, | ||
| int | ypos, | ||
| SLKey | modifier | ||
| ) |
Posts a mouse button release at position x, y.
Global event handler for mouse button up events.
Definition at line 63 of file SLInputEventInterface.cpp.
Posts a mouse wheel movement by pos detents.
Global event handler for mouse wheel events.
Definition at line 151 of file SLInputEventInterface.cpp.
| void SLInputEventInterface::resize | ( | int | sceneViewIndex, |
| int | width, | ||
| int | height | ||
| ) |
Posts a resize of the scene view to the given width and height in pixels.
Global resize function that must be called whenever the OpenGL frame changes it's size.
Definition at line 22 of file SLInputEventInterface.cpp.
| void SLInputEventInterface::scrCaptureRequest | ( | int | sceneViewIndex, |
| std::string | outputPath | ||
| ) |
Posts a request to write a screenshot of the scene view to outputPath.
Global event handler to trigger a screenshot
Definition at line 202 of file SLInputEventInterface.cpp.
| void SLInputEventInterface::touch2Down | ( | int | sceneViewIndex, |
| int | xpos1, | ||
| int | ypos1, | ||
| int | xpos2, | ||
| int | ypos2 | ||
| ) |
Posts a two finger touch down at the two positions x1, y1 and x2, y2.
Global event handler for the two finger touch down events of touchscreen devices.
Definition at line 98 of file SLInputEventInterface.cpp.
| void SLInputEventInterface::touch2Move | ( | int | sceneViewIndex, |
| int | xpos1, | ||
| int | ypos1, | ||
| int | xpos2, | ||
| int | ypos2 | ||
| ) |
Posts a two finger move to the two positions x1, y1 and x2, y2.
Global event handler for the two finger move events of touchscreen devices.
Definition at line 116 of file SLInputEventInterface.cpp.
| void SLInputEventInterface::touch2Up | ( | int | sceneViewIndex, |
| int | xpos1, | ||
| int | ypos1, | ||
| int | xpos2, | ||
| int | ypos2 | ||
| ) |
Posts a two finger lift off from the two positions x1, y1 and x2, y2.
Global event handler for the two finger touch up events of touchscreen devices.
Definition at line 134 of file SLInputEventInterface.cpp.
| void SLInputEventInterface::updateScr2fb | ( | int | sceneViewIndex | ) |
Posts a request to recompute the screen to framebuffer scale factor.
Needed on high DPI displays, where the framebuffer is larger than the window in screen coordinates.
|
private |
Manager the events are queued on.
Definition at line 82 of file SLInputEventInterface.h.