FifeGUI 0.2.0
A C++ GUI library designed for games.
mouseevent.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#include "fifechan/mouseevent.hpp"
6
7#include "fifechan/inputevent.hpp"
8
9namespace fcn
10{
12 Widget* source,
13 Widget* distributor,
14 bool isShiftPressed,
16 bool isAltPressed,
17 bool isMetaPressed,
19 MouseEvent::Button button,
20 int x,
21 int y,
22 int clickCount) :
24 mType(type),
25 mButton(button),
26 mX(x),
27 mY(y),
28 mClickCount(clickCount)
29 {
30 }
31
33 {
34 return mButton;
35 }
36
37 int MouseEvent::getX() const
38 {
39 return mX;
40 }
41
42 int MouseEvent::getY() const
43 {
44 return mY;
45 }
46
48 {
49 return mClickCount;
50 }
51
53 {
54 return mType;
55 }
56} // namespace fcn
InputEvent(Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed)
Constructor.
bool isAltPressed() const
Checks if alt is pressed.
bool isControlPressed() const
Checks if control is pressed.
bool isMetaPressed() const
Checks whether meta is pressed.
bool isShiftPressed() const
Checks if shift is pressed.
int getClickCount() const
Gets the number of clicks generated with the same button.
int getX() const
Gets the x coordinate of the mouse event.
int mClickCount
The number of clicks generated with the same button.
MouseEvent::Button mButton
Holds the button of the mouse event.
MouseEvent::Type getType() const
Gets the type of the event.
Button
Mouse button types.
int mY
Holds the y-coordinate of the mouse event.
MouseEvent::Type mType
Holds the type of the mouse event.
int getY() const
Gets the y coordinate of the mouse event.
MouseEvent::Button getButton() const
Gets the button of the mouse event.
MouseEvent(Widget *source, Widget *distributor, bool isShiftPressed, bool isControlPressed, bool isAltPressed, bool isMetaPressed, MouseEvent::Type type, MouseEvent::Button button, int x, int y, int clickCount)
Constructor.
Type
Mouse event types.
int mX
Holds the x-coordinate of the mouse event.
Abstract base class defining the common behavior, properties, and lifecycle of all GUI elements.
Definition widget.hpp:45