buffybox/buffyboard/uinput_device.h

52 lines
1.6 KiB
C
Raw Normal View History

2021-09-13 13:30:15 +02:00
/**
* Copyright 2021 Johannes Marbach
*
2024-01-10 19:54:00 +01:00
* This file is part of buffybox, hereafter referred to as the program.
2021-09-13 13:30:15 +02:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef BB_UINPUT_DEVICE_H
#define BB_UINPUT_DEVICE_H
#include <stdbool.h>
/**
* Initialise the uinput keyboard device
*
* @param scancodes array of scancodes the device can emit
* @param num_scancodes number of scancodes the device can emit
* @return true if creating the device was successful, false otherwise
*/
2021-09-23 14:42:48 +02:00
bool bb_uinput_device_init(const int * const scancodes, int num_scancodes);
2021-09-13 13:30:15 +02:00
/**
* Emit a key down event
*
* @param scancode the key's scancode
* @return true if emitting the event was successful, false otherwise
*/
bool bb_uinput_device_emit_key_down(int scancode);
/**
* Emit a key up event
*
* @param scancode the key's scancode
* @return true if emitting the event was successful, false otherwise
*/
bool bb_uinput_device_emit_key_up(int scancode);
#endif /* BB_UINPUT_DEVICE_H */