buffybox/buffyboard/uinput_device.h

38 lines
901 B
C
Raw Normal View History

2021-09-13 13:30:15 +02:00
/**
* Copyright 2021 Johannes Marbach
* 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
*
* @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
*/
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
*
* @param keycode the key's keycode
2021-09-13 13:30:15 +02:00
* @return true if emitting the event was successful, false otherwise
*/
bool bb_uinput_device_emit_key_down(int keycode);
2021-09-13 13:30:15 +02:00
/**
* Emit a key up event
*
* @param keycode the key's keycode
2021-09-13 13:30:15 +02:00
* @return true if emitting the event was successful, false otherwise
*/
bool bb_uinput_device_emit_key_up(int keycode);
2021-09-13 13:30:15 +02:00
#endif /* BB_UINPUT_DEVICE_H */