Input event handler class using uinput files.
More...
#include <uinputeventhandler.h>
Input event handler class using uinput files.
Proper udev rule may be needed for usage General info https://kernel.org/doc/html/v5.15/input/uinput.html Event types https://www.kernel.org/doc/html/v5.15/input/event-codes.html
◆ UInputEventHandler()
| UInputEventHandler::UInputEventHandler |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ ~UInputEventHandler()
| UInputEventHandler::~UInputEventHandler |
( |
| ) |
|
◆ cleanup()
| bool UInputEventHandler::cleanup |
( |
| ) |
|
|
overridevirtual |
◆ cleanupUinputEvHand()
| bool UInputEventHandler::cleanupUinputEvHand |
( |
| ) |
|
|
private |
◆ closeUInputDevice()
| void UInputEventHandler::closeUInputDevice |
( |
int |
filehandle | ) |
|
|
protected |
◆ createUInputKeyboardDevice()
| void UInputEventHandler::createUInputKeyboardDevice |
( |
int |
filehandle | ) |
|
|
protected |
◆ createUInputMouseDevice()
| void UInputEventHandler::createUInputMouseDevice |
( |
int |
filehandle | ) |
|
|
protected |
◆ createUInputSpringMouseDevice()
| void UInputEventHandler::createUInputSpringMouseDevice |
( |
int |
filehandle | ) |
|
|
protected |
◆ getIdentifier()
| QString UInputEventHandler::getIdentifier |
( |
| ) |
|
|
overridevirtual |
◆ getKeyboardFileHandler()
| int UInputEventHandler::getKeyboardFileHandler |
( |
| ) |
|
◆ getMouseFileHandler()
| int UInputEventHandler::getMouseFileHandler |
( |
| ) |
|
◆ getName()
| QString UInputEventHandler::getName |
( |
| ) |
|
|
overridevirtual |
◆ getSpringMouseFileHandler()
| int UInputEventHandler::getSpringMouseFileHandler |
( |
| ) |
|
◆ getUinputDeviceLocation()
| const QString UInputEventHandler::getUinputDeviceLocation |
( |
| ) |
|
◆ init()
| bool UInputEventHandler::init |
( |
| ) |
|
|
overridevirtual |
Initialize keyboard and mouse virtual devices. Each device will use its own file handle with various codes set to distinquish the two devices.
- Returns
Implements BaseEventHandler.
◆ initDevice()
| void UInputEventHandler::initDevice |
( |
int & |
device, |
|
|
QString |
name, |
|
|
bool & |
result |
|
) |
| |
|
private |
◆ openUInputHandle()
| int UInputEventHandler::openUInputHandle |
( |
| ) |
|
|
protected |
◆ populateKeyCodes()
| void UInputEventHandler::populateKeyCodes |
( |
int |
filehandle | ) |
|
|
protected |
◆ printPostMessages()
| void UInputEventHandler::printPostMessages |
( |
| ) |
|
|
overridevirtual |
◆ sendKeyboardEvent()
◆ sendMouseAbsEvent()
| void UInputEventHandler::sendMouseAbsEvent |
( |
int |
xDis, |
|
|
int |
yDis, |
|
|
int |
screen |
|
) |
| |
|
overridevirtual |
Move cursor to selected absolute location (x, y) on selected display.
Do nothing by default. Useful for child classes to define behavior.
- Parameters
-
| Displacement | of X coordinate |
| Displacement | of Y coordinate |
| Screen | number or -1 to use default |
Reimplemented from BaseEventHandler.
◆ sendMouseButtonEvent()
◆ sendMouseEvent()
| void UInputEventHandler::sendMouseEvent |
( |
int |
xDis, |
|
|
int |
yDis |
|
) |
| |
|
overridevirtual |
Move cursor to selected relative location (deltax delaty)
Implements BaseEventHandler.
◆ sendMouseSpringEvent()
| void UInputEventHandler::sendMouseSpringEvent |
( |
int |
xDis, |
|
|
int |
yDis, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
overridevirtual |
Do nothing by default. Useful for child classes to define behavior.
- Parameters
-
| Displacement | of X coordinate |
| Displacement | of Y coordinate |
| Bounding | box width |
| Bounding | box height |
Reimplemented from BaseEventHandler.
◆ sendTextEntryEvent()
| void UInputEventHandler::sendTextEntryEvent |
( |
QString |
maintext | ) |
|
|
overridevirtual |
◆ setKeyboardEvents()
| void UInputEventHandler::setKeyboardEvents |
( |
int |
filehandle | ) |
|
|
protected |
◆ setRelMouseEvents()
| void UInputEventHandler::setRelMouseEvents |
( |
int |
filehandle | ) |
|
|
protected |
◆ setSpringMouseEvents()
| void UInputEventHandler::setSpringMouseEvents |
( |
int |
filehandle | ) |
|
|
protected |
◆ testAndAppend()
| void UInputEventHandler::testAndAppend |
( |
bool |
tested, |
|
|
QList< unsigned int > & |
tempList, |
|
|
unsigned int |
key |
|
) |
| |
|
private |
◆ write_uinput_event()
| void UInputEventHandler::write_uinput_event |
( |
int |
filehandle, |
|
|
int |
type, |
|
|
int |
code, |
|
|
int |
value, |
|
|
bool |
syn = true |
|
) |
| |
|
protected |
Write uinput event to selected file uinput file.
- Parameters
-
| filehandle | - C-style linux file handle obtained by open() |
| type | type of event described in input-event-codes.h (for example EV_ABS ) |
| code | Additional code like ABS_X for type EV_ABS |
| value | |
| syn | synchronize after event (emit additional event used for separation of events EV_SYN) |
◆ keyboardFileHandler
| int UInputEventHandler::keyboardFileHandler |
|
private |
◆ mouseFileHandler
| int UInputEventHandler::mouseFileHandler |
|
private |
◆ springMouseFileHandler
| int UInputEventHandler::springMouseFileHandler |
|
private |
◆ uinputDeviceLocation
| QString UInputEventHandler::uinputDeviceLocation |
|
private |
The documentation for this class was generated from the following files: