config: add tablet rotate configuration

Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
This commit is contained in:
Jens Peters 2023-12-29 22:36:06 +01:00 committed by Johan Malm
parent 20bba35570
commit 23ecc32562
5 changed files with 35 additions and 4 deletions

View file

@ -83,6 +83,7 @@ struct rcxml {
/* graphics tablet */
struct tablet_config {
enum rotation rotation;
uint16_t button_map_count;
struct button_map_entry button_map[BUTTON_MAP_MAX];
} tablet;

View file

@ -4,12 +4,20 @@
#include <stdint.h>
enum rotation {
LAB_ROTATE_NONE = 0,
LAB_ROTATE_90,
LAB_ROTATE_180,
LAB_ROTATE_270,
};
#define BUTTON_MAP_MAX 16
struct button_map_entry {
uint32_t from;
uint32_t to;
};
enum rotation tablet_parse_rotation(int value);
uint32_t tablet_button_from_str(const char *button);
uint32_t mouse_button_from_str(const char *button);
void tablet_button_mapping_add(uint32_t from, uint32_t to);