1
0
mirror of https://gitea.tendokyu.moe/Dniel97/segatools.git synced 2025-01-09 23:41:35 +01:00

45 lines
827 B
C
Raw Normal View History

2022-12-10 22:01:52 -05:00
#pragma once
#include <windows.h>
#include <stdbool.h>
#include <stdint.h>
2023-05-31 04:54:38 -04:00
#pragma pack(push, 1)
2022-12-10 22:01:52 -05:00
struct touch_config {
bool enable;
2023-11-27 23:23:00 -05:00
unsigned int port_no;
char board_id[7];
char unit_type[9];
2022-12-10 22:01:52 -05:00
};
// Always starts with 0x01, always ends with 0x0D
2022-12-10 22:01:52 -05:00
struct touch_req {
uint8_t sync; // Always 0x01
uint8_t cmd[256]; // rest of the data goes here
uint8_t tail; // Always 0x0D
size_t data_len; // length of data
2022-12-10 22:01:52 -05:00
};
2023-05-31 04:54:38 -04:00
struct touch_report {
uint8_t status;
2023-11-27 23:23:00 -05:00
uint8_t x1;
uint8_t x2;
uint8_t y1;
uint8_t y2;
2023-05-31 04:54:38 -04:00
uint8_t touch_id;
};
struct touch_auto_resp {
struct touch_report touches[10];
2023-11-27 23:23:00 -05:00
};
enum {
TOUCH_MODE_STREAM = 0x01,
TOUCH_MODE_DOWN_UP = 0x02,
TOUCH_MODE_INACTIVE = 0x03,
2023-05-31 04:54:38 -04:00
};
#pragma pack(pop)
2022-12-10 22:01:52 -05:00
HRESULT touch_hook_init(const struct touch_config *cfg);