Antkeeper  0.0.1
Public Member Functions | List of all members
input::mouse Class Reference

A virtual mouse which generates mouse-related input events. More...

#include <mouse.hpp>

Inheritance diagram for input::mouse:
input::device

Public Member Functions

void press (mouse_button button)
 Simulates a mouse button press. More...
 
void release (mouse_button button)
 Simulates a mouse button release. More...
 
void move (const math::vec2< std::int32_t > &position, const math::vec2< std::int32_t > &difference)
 Simulates mouse movement. More...
 
void scroll (const math::fvec2 &velocity)
 Simulates mouse scrolling. More...
 
const math::vec2< std::int32_t > & get_position () const noexcept
 Returns the current mouse position, in pixels, relative to the window. More...
 
::event::channel< mouse_button_pressed_event > & get_button_pressed_channel () noexcept
 Returns the channel through which mouse button pressed events are published. More...
 
::event::channel< mouse_button_released_event > & get_button_released_channel () noexcept
 Returns the channel through which mouse button released events are published. More...
 
::event::channel< mouse_moved_event > & get_moved_channel () noexcept
 Returns the channel through which mouse moved events are published. More...
 
::event::channel< mouse_scrolled_event > & get_scrolled_channel () noexcept
 Returns the channel through which mouse scrolled events are published. More...
 
constexpr device_type get_device_type () const noexcept override
 Returns device_type::mouse. More...
 
- Public Member Functions inherited from input::device
void connect ()
 Simulates the device being connected. More...
 
void disconnect ()
 Simulates the device being disconnected. More...
 
bool is_connected () const noexcept
 Returns true if the device is currently connected. More...
 
void set_uuid (const ::uuid &id)
 Sets the universally unique identifier (UUID) of this input device. More...
 
const ::uuidget_uuid () const noexcept
 Returns the universally unique identifier (UUID) of this input device. More...
 
::event::channel< device_connected_event > & get_connected_channel () noexcept
 Returns the channel through which device connected events are published. More...
 
::event::channel< device_disconnected_event > & get_disconnected_channel () noexcept
 Returns the channel through which device disconnected events are published. More...
 

Detailed Description

A virtual mouse which generates mouse-related input events.

Definition at line 35 of file mouse.hpp.

Member Function Documentation

◆ get_button_pressed_channel()

::event::channel<mouse_button_pressed_event>& input::mouse::get_button_pressed_channel ( )
inlinenoexcept

Returns the channel through which mouse button pressed events are published.

Definition at line 74 of file mouse.hpp.

◆ get_button_released_channel()

::event::channel<mouse_button_released_event>& input::mouse::get_button_released_channel ( )
inlinenoexcept

Returns the channel through which mouse button released events are published.

Definition at line 80 of file mouse.hpp.

◆ get_device_type()

constexpr device_type input::mouse::get_device_type ( ) const
inlineconstexproverridevirtualnoexcept

Returns device_type::mouse.

Implements input::device.

Definition at line 98 of file mouse.hpp.

◆ get_moved_channel()

::event::channel<mouse_moved_event>& input::mouse::get_moved_channel ( )
inlinenoexcept

Returns the channel through which mouse moved events are published.

Definition at line 86 of file mouse.hpp.

◆ get_position()

const math::vec2<std::int32_t>& input::mouse::get_position ( ) const
inlinenoexcept

Returns the current mouse position, in pixels, relative to the window.

Definition at line 68 of file mouse.hpp.

◆ get_scrolled_channel()

::event::channel<mouse_scrolled_event>& input::mouse::get_scrolled_channel ( )
inlinenoexcept

Returns the channel through which mouse scrolled events are published.

Definition at line 92 of file mouse.hpp.

◆ move()

void input::mouse::move ( const math::vec2< std::int32_t > &  position,
const math::vec2< std::int32_t > &  difference 
)

Simulates mouse movement.

Parameters
positionMouse position, in pixels, relative to the window.
differenceRelative movement of the mouse, in pixels.

Definition at line 34 of file mouse.cpp.

◆ press()

void input::mouse::press ( mouse_button  button)

Simulates a mouse button press.

Parameters
buttonButton to press.

Definition at line 24 of file mouse.cpp.

◆ release()

void input::mouse::release ( mouse_button  button)

Simulates a mouse button release.


Parameters
buttonButton to release.

Definition at line 29 of file mouse.cpp.

◆ scroll()

void input::mouse::scroll ( const math::fvec2 velocity)

Simulates mouse scrolling.

Parameters
velocityScroll velocity.

Definition at line 40 of file mouse.cpp.


The documentation for this class was generated from the following files: