12 #if defined(__has_include) && __has_include(<optional>)
16 #include <experimental/optional>
108 void setRelativeMouseMode(
bool relative);
110 bool getRelativeMouseMode();
112 void setMouseVisible(
bool visible);
114 bool isMouseVisible();
134 [[deprecated(
"Use jngl::getMousePos() instead")]]
int getMouseX();
138 [[deprecated(
"Use jngl::getMousePos() instead")]]
int getMouseY();
163 namespace controller {
Contains jngl::Vec2 class.
KeyboardType getKeyboardType()
Currently active type of onscreen keyboard.
bool mousePressed(mouse::Button button=mouse::Left)
Whether button has been pressed since the next to last call to updateInput()
double getMouseWheel()
Returns mouse wheel movement between -100 and 100 (0 if the mousewheel doesn't move)
std::vector< std::shared_ptr< Controller > > getConnectedControllers()
Returns all controllers (gamepads) that are connected.
bool mouseDown(mouse::Button button=mouse::Left)
Returns whether button is currently held down.
void setMouseDown(mouse::Button button, bool)
Overwrite what mouseDown() should return.
void setKeyboardVisible(bool)
Display onscreen keyboard for touch devices.
std::string getTextInput()
Returns a string of characters that have been pressed since the last call to updateInput()
bool isMultitouch()
Returns true when there's more than one finger touching the screen.
bool keyPressed(key::KeyType key)
Whether key has been pressed since the next to last call to updateInput()
bool keyDown(key::KeyType key)
Whether key is down.
void setKeyboardType(KeyboardType)
Type of the onscreen keyboard.
void setKeyPressed(const std::string &key, bool)
Overwrite what keyPressed() should return.
Vec2 getMousePos()
Mouse position in screen coordinates.
optional< Vec2 > getCursorPos()
Returns the position of the mouse pointer if a mouse is connected/available.
void onControllerChanged(std::function< void()> callback)
Specify a function which gets called, whenever a controller gets added or removed.
int getMouseX()
Retrieve mouse position in pixels.
std::vector< jngl::Vec2 > getTouchPositions()
Returns all positions where a finger touches the screen.
int getMouseY()
Retrieve mouse position in pixels.
void setMouse(Vec2 position)
Moves the mouse (does nothing on iOS and Android)
void setMousePressed(jngl::mouse::Button, bool)
Overwrite what mouseDown() should return.
KeyboardType
Whether a normal or a numbers-only keyboard should appear.