AntiMicroX
xtesteventhandler.h
Go to the documentation of this file.
1 /* antimicrox Gamepad to KB+M event mapper
2  * Copyright (C) 2015 Travis Nickles <nickles.travis@gmail.com>
3  * Copyright (C) 2020 Jagoda Górska <juliagoda.pl@protonmail>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14 
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef XTESTEVENTHANDLER_H
20 #define XTESTEVENTHANDLER_H
21 
22 #include "baseeventhandler.h"
23 
24 class JoyButtonSlot;
25 
27 {
28  Q_OBJECT
29 
30  public:
31  explicit XTestEventHandler(QObject *parent = nullptr);
32  virtual ~XTestEventHandler();
33 
34  bool init() override;
35  bool cleanup() override;
36 
37  void sendKeyboardEvent(JoyButtonSlot *slot, bool pressed) override;
38  void sendMouseButtonEvent(JoyButtonSlot *slot, bool pressed) override;
39  void sendMouseEvent(int xDis, int yDis) override;
40  void sendMouseAbsEvent(int xDis, int yDis, int screen) override;
41 
42  void sendMouseSpringEvent(int xDis, int yDis, int width, int height) override;
43 
44  void sendTextEntryEvent(QString maintext) override;
45 
46  QString getName() override;
47  QString getIdentifier() override;
48  void printPostMessages() override;
49 };
50 
51 #endif // XTESTEVENTHANDLER_H
XTestEventHandler::sendMouseSpringEvent
void sendMouseSpringEvent(int xDis, int yDis, int width, int height) override
Do nothing by default. Useful for child classes to define behavior.
Definition: xtesteventhandler.cpp:174
x11extras.h
XTestEventHandler::printPostMessages
void printPostMessages() override
Do nothing by default. Allow child classes to specify text to output to a text stream.
Definition: xtesteventhandler.cpp:182
XTestEventHandler
Definition: xtesteventhandler.h:26
code
the intent is to exercise the right to control the distribution of derivative or collective works based on the Library In mere aggregation of another work not based on the Library with the you must alter all the notices that refer to this so that they refer to the ordinary GNU General Public instead of to this it is irreversible for that so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy This option is useful when you wish to copy part of the code of the Library into a program that is not a library You may copy and distribute the which must be distributed under the terms of Sections and above on a medium customarily used for software interchange If distribution of object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code
Definition: lgpl-2.1.txt:237
QtKeyMapperBase::getCharKeyInformation
charKeyInformation getCharKeyInformation(QChar value)
Definition: qtkeymapperbase.cpp:69
XTestEventHandler::cleanup
bool cleanup() override
Definition: xtesteventhandler.cpp:50
xtesteventhandler.h
JoyButtonSlot::getSlotMode
JoySlotInputAction getSlotMode() const
Definition: joybuttonslot.cpp:114
antkeymapper.h
JoyButtonSlot::JoyMouseButton
@ JoyMouseButton
Definition: joybuttonslot.h:45
XTestEventHandler::sendTextEntryEvent
void sendTextEntryEvent(QString maintext) override
Definition: xtesteventhandler.cpp:104
globalvariables.h
XTestEventHandler::getIdentifier
QString getIdentifier() override
Definition: xtesteventhandler.cpp:102
XTestEventHandler::sendMouseButtonEvent
void sendMouseButtonEvent(JoyButtonSlot *slot, bool pressed) override
Definition: xtesteventhandler.cpp:72
X11Extras::display
Display * display()
Get display instance.
Definition: x11extras.cpp:117
joybuttonslot.h
JoyButtonSlot
Represents action which can be performed after pressing button.
Definition: joybuttonslot.h:37
AntKeyMapper
Definition: antkeymapper.h:36
XTestEventHandler::sendKeyboardEvent
void sendKeyboardEvent(JoyButtonSlot *slot, bool pressed) override
Definition: xtesteventhandler.cpp:52
BaseEventHandler
Base class for input event handlers.
Definition: baseeventhandler.h:32
XTestEventHandler::sendMouseEvent
void sendMouseEvent(int xDis, int yDis) override
Move cursor to selected relative location (deltax delaty)
Definition: xtesteventhandler.cpp:86
JoyButtonSlot::JoyKeyboard
@ JoyKeyboard
Definition: joybuttonslot.h:44
AntKeyMapper::getInstance
static AntKeyMapper * getInstance(QString handler="")
Definition: antkeymapper.cpp:80
XTestEventHandler::XTestEventHandler
XTestEventHandler(QObject *parent=nullptr)
Definition: xtesteventhandler.cpp:31
JoyButtonSlot::getSlotCode
int getSlotCode() const
Definition: joybuttonslot.cpp:110
XTestEventHandler::init
bool init() override
Definition: xtesteventhandler.cpp:38
baseeventhandler.h
X11Extras::x11ResetMouseAccelerationChange
void x11ResetMouseAccelerationChange()
Definition: x11extras.cpp:691
X11Extras::getInstance
static X11Extras * getInstance()
Definition: x11extras.cpp:73
XTestEventHandler::~XTestEventHandler
virtual ~XTestEventHandler()
Definition: xtesteventhandler.cpp:36
JoyButtonSlot::JoySlotInputAction
JoySlotInputAction
Definition: joybuttonslot.h:42
QtKeyMapperBase::_charKeyInformation::virtualkey
int virtualkey
Definition: qtkeymapperbase.h:35
X11Extras
Definition: x11extras.h:29
AntKeyMapper::getKeyMapper
QtKeyMapperBase * getKeyMapper() const
Definition: antkeymapper.cpp:110
XTestEventHandler::sendMouseAbsEvent
void sendMouseAbsEvent(int xDis, int yDis, int screen) override
Move cursor to selected absolute location (x, y) on selected display.
Definition: xtesteventhandler.cpp:93
QtKeyMapperBase::_charKeyInformation::modifiers
Qt::KeyboardModifiers modifiers
Definition: qtkeymapperbase.h:34
QtKeyMapperBase::_charKeyInformation
Definition: qtkeymapperbase.h:32
QtX11KeyMapper
Definition: qtx11keymapper.h:24
XTestEventHandler::getName
QString getName() override
Definition: xtesteventhandler.cpp:100