lxgui
|
SFML implementation of input::source. More...
#include <input_sfml_source.hpp>
Public Member Functions | |
source (sf::Window &win) | |
Initializes this input source. | |
source (const source &)=delete | |
source & | operator= (const source &)=delete |
utils::ustring | get_clipboard_content () override |
Retrieve a copy of the clipboard content. | |
void | set_clipboard_content (const utils::ustring &content) override |
Replace the content of the clipboard. | |
void | on_sfml_event (const sf::Event &event) |
void | set_mouse_cursor (const std::string &file_name, const gui::vector2i &hot_spot) override |
Sets the mouse cursor to a given image on disk. | |
void | reset_mouse_cursor () override |
Sets the mouse cursor back to the default (arrow). | |
const key_state & | get_key_state () const |
Returns the keyboard state of this input source. | |
const mouse_state & | get_mouse_state () const |
Returns the mouse state of this input source. | |
const gui::vector2ui & | get_window_dimensions () const |
Get the window size (in pixels) | |
virtual float | get_interface_scaling_factor_hint () const |
Return the interface scaling factor suggested by the operating system. | |
Public Attributes | |
utils::signal< void(const gui::vector2f &, const gui::vector2f &)> | on_mouse_moved |
Signal triggered when the mouse moves. | |
utils::signal< void(float, const gui::vector2f &)> | on_mouse_wheel |
Signal triggered when the mouse wheel is moved. | |
utils::signal< void(input::mouse_button, const gui::vector2f &)> | on_mouse_pressed |
Signal triggered when a mouse button is pressed. | |
utils::signal< void(input::mouse_button, const gui::vector2f &)> | on_mouse_released |
Signal triggered when a mouse button is released. | |
utils::signal< void(input::key)> | on_key_pressed |
Signal triggered when a keyboard key is pressed. | |
utils::signal< void(input::key)> | on_key_pressed_repeat |
Signal triggered when a keyboard key is long-pressed and repeats. | |
utils::signal< void(input::key)> | on_key_released |
Signal triggered when a keyboard key is released. | |
utils::signal< void(std::uint32_t)> | on_text_entered |
Signal triggered when text is entered. | |
utils::signal< void(const gui::vector2ui &)> | on_window_resized |
Signal triggered whenever the window is resized or changes resolution. | |
Protected Attributes | |
key_state | keyboard_ |
mouse_state | mouse_ |
gui::vector2ui | window_dimensions_ |
SFML implementation of input::source.
Definition at line 26 of file input_sfml_source.hpp.
|
explicit |
Initializes this input source.
win | The window from which to receive input |
|
delete |
|
overridevirtual |
Retrieve a copy of the clipboard content.
Implements lxgui::input::source.
|
virtualinherited |
Return the interface scaling factor suggested by the operating system.
Reimplemented in lxgui::input::sdl::source.
Definition at line 17 of file input_source.cpp.
|
inherited |
Returns the keyboard state of this input source.
Definition at line 5 of file input_source.cpp.
|
inherited |
Returns the mouse state of this input source.
Definition at line 9 of file input_source.cpp.
|
inherited |
Get the window size (in pixels)
Definition at line 13 of file input_source.cpp.
void lxgui::input::sfml::source::on_sfml_event | ( | const sf::Event & | event | ) |
|
overridevirtual |
Sets the mouse cursor back to the default (arrow).
Implements lxgui::input::source.
|
overridevirtual |
Replace the content of the clipboard.
content | The new clipboard content |
Implements lxgui::input::source.
|
overridevirtual |
Sets the mouse cursor to a given image on disk.
file_name | The cursor image |
hot_spot | The pixel position of the tip of the pointer in the image |
Implements lxgui::input::source.
|
protectedinherited |
Definition at line 178 of file input_source.hpp.
|
protectedinherited |
Definition at line 179 of file input_source.hpp.
|
inherited |
Signal triggered when a keyboard key is pressed.
Arguments:
Definition at line 146 of file input_source.hpp.
|
inherited |
Signal triggered when a keyboard key is long-pressed and repeats.
Arguments:
Definition at line 153 of file input_source.hpp.
|
inherited |
Signal triggered when a keyboard key is released.
Arguments:
Definition at line 160 of file input_source.hpp.
|
inherited |
Signal triggered when the mouse moves.
Arguments:
Definition at line 115 of file input_source.hpp.
|
inherited |
Signal triggered when a mouse button is pressed.
Arguments:
Definition at line 131 of file input_source.hpp.
|
inherited |
Signal triggered when a mouse button is released.
Arguments:
Definition at line 139 of file input_source.hpp.
|
inherited |
Signal triggered when the mouse wheel is moved.
Arguments:
Definition at line 123 of file input_source.hpp.
|
inherited |
Signal triggered when text is entered.
Arguments:
Definition at line 168 of file input_source.hpp.
|
inherited |
Signal triggered whenever the window is resized or changes resolution.
Arguments:
Definition at line 175 of file input_source.hpp.
|
protectedinherited |
Definition at line 181 of file input_source.hpp.