2021-09-13 13:30:15 +02:00
|
|
|
/**
|
|
|
|
|
* Copyright 2021 Johannes Marbach
|
2024-01-12 09:51:43 +01:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2021-09-13 13:30:15 +02:00
|
|
|
*/
|
|
|
|
|
|
2024-01-12 10:00:05 +01:00
|
|
|
|
2021-09-13 13:30:15 +02:00
|
|
|
#ifndef BB_UINPUT_DEVICE_H
|
|
|
|
|
#define BB_UINPUT_DEVICE_H
|
|
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Initialise the uinput keyboard device
|
|
|
|
|
*
|
2025-11-10 07:51:49 +00:00
|
|
|
* @param keycodes array of keycodes the device can emit
|
|
|
|
|
* @param num_keycodes number of keycodes the device can emit
|
2021-09-13 13:30:15 +02:00
|
|
|
* @return true if creating the device was successful, false otherwise
|
|
|
|
|
*/
|
2025-11-10 07:51:49 +00:00
|
|
|
bool bb_uinput_device_init(const int * const keycodes, int num_keycodes);
|
2021-09-13 13:30:15 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Emit a key down event
|
|
|
|
|
*
|
2025-11-10 07:51:49 +00:00
|
|
|
* @param keycode the key's keycode
|
2021-09-13 13:30:15 +02:00
|
|
|
* @return true if emitting the event was successful, false otherwise
|
|
|
|
|
*/
|
2025-11-10 07:51:49 +00:00
|
|
|
bool bb_uinput_device_emit_key_down(int keycode);
|
2021-09-13 13:30:15 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Emit a key up event
|
|
|
|
|
*
|
2025-11-10 07:51:49 +00:00
|
|
|
* @param keycode the key's keycode
|
2021-09-13 13:30:15 +02:00
|
|
|
* @return true if emitting the event was successful, false otherwise
|
|
|
|
|
*/
|
2025-11-10 07:51:49 +00:00
|
|
|
bool bb_uinput_device_emit_key_up(int keycode);
|
2021-09-13 13:30:15 +02:00
|
|
|
|
|
|
|
|
#endif /* BB_UINPUT_DEVICE_H */
|