Antkeeper
0.0.1
src
engine
input
mouse-events.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2023 Christopher J. Howard
3
*
4
* This file is part of Antkeeper source code.
5
*
6
* Antkeeper source code is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* Antkeeper source code is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef ANTKEEPER_INPUT_MOUSE_EVENTS_HPP
21
#define ANTKEEPER_INPUT_MOUSE_EVENTS_HPP
22
23
#include <
engine/input/mouse-button.hpp
>
24
#include <
engine/input/mouse-motion-axis.hpp
>
25
#include <
engine/input/mouse-scroll-axis.hpp
>
26
#include <
engine/math/vector.hpp
>
27
#include <cstdint>
28
29
namespace
input
{
30
31
class
mouse
;
32
36
struct
mouse_moved_event
37
{
39
mouse
*
mouse
{
nullptr
};
40
42
math::vec2<std::int32_t>
position
{0, 0};
43
45
math::vec2<std::int32_t>
difference
{0, 0};
46
};
47
51
struct
mouse_button_pressed_event
52
{
54
mouse
*
mouse
{
nullptr
};
55
57
math::vec2<std::int32_t>
position
{0, 0};
58
60
mouse_button
button
{0};
61
};
62
66
struct
mouse_button_released_event
67
{
69
mouse
*
mouse
{
nullptr
};
70
72
math::vec2<std::int32_t>
position
{0, 0};
73
75
mouse_button
button
{0};
76
};
77
81
struct
mouse_scrolled_event
82
{
84
mouse
*
mouse
{
nullptr
};
85
87
math::vec2<std::int32_t>
position
{0, 0};
88
90
math::fvec2
velocity
{0.0f, 0.0f};
91
};
92
93
}
// namespace input
94
95
#endif
// ANTKEEPER_INPUT_MOUSE_EVENTS_HPP
input::mouse
A virtual mouse which generates mouse-related input events.
Definition:
mouse.hpp:36
mouse-button.hpp
mouse-motion-axis.hpp
mouse-scroll-axis.hpp
input
Input devices, events, and mapping.
Definition:
action-events.hpp:23
input::device_type::mouse
@ mouse
Mouse input device.
input::mouse_button
mouse_button
Mouse buttons.
Definition:
mouse-button.hpp:29
input::mouse_button_pressed_event
Event generated when a mouse button has been pressed.
Definition:
mouse-events.hpp:52
input::mouse_button_pressed_event::position
math::vec2< std::int32_t > position
Mouse position, in pixels, relative to the window, when the button was pressed.
Definition:
mouse-events.hpp:57
input::mouse_button_pressed_event::button
mouse_button button
Mouse button being pressed.
Definition:
mouse-events.hpp:60
input::mouse_button_released_event
Event generated when a mouse button has been released.
Definition:
mouse-events.hpp:67
input::mouse_button_released_event::position
math::vec2< std::int32_t > position
Mouse position, in pixels, relative to the window, when the button was released.
Definition:
mouse-events.hpp:72
input::mouse_button_released_event::button
mouse_button button
Mouse button being released.
Definition:
mouse-events.hpp:75
input::mouse_moved_event
Event generated when a mouse has been moved.
Definition:
mouse-events.hpp:37
input::mouse_moved_event::position
math::vec2< std::int32_t > position
Mouse position, in pixels, relative to the window.
Definition:
mouse-events.hpp:42
input::mouse_moved_event::difference
math::vec2< std::int32_t > difference
Relative movement of the mouse, in pixels.
Definition:
mouse-events.hpp:45
input::mouse_scrolled_event
Event generated when a mouse has been scrolled.
Definition:
mouse-events.hpp:82
input::mouse_scrolled_event::position
math::vec2< std::int32_t > position
Mouse position, in pixels, relative to the window, when the mouse was scrolled.
Definition:
mouse-events.hpp:87
input::mouse_scrolled_event::velocity
math::fvec2 velocity
Scroll velocity.
Definition:
mouse-events.hpp:90
math::vector
n-dimensional vector.
Definition:
vector.hpp:44
vector.hpp