fix: repair Wayland key lifecycle

This commit is contained in:
2026-08-12 15:58:24 +09:00
parent 1d8d711882
commit 9c43bcb75c
7 changed files with 509 additions and 77 deletions

31
wayland_state.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef WAYLAND_STATE_H
#define WAYLAND_STATE_H
#include <stdint.h>
enum {
/* Wayland key codes are Linux input-event codes. */
Wlkeymax = 0x300,
};
typedef struct Wlstate Wlstate;
struct Wlstate
{
unsigned char down[Wlkeymax];
uint32_t repeatkey;
uint64_t repeatat;
int rate;
int delay;
int repeating;
};
void wlstateinit(Wlstate*);
int wlstatepress(Wlstate*, uint32_t, int, int, uint64_t);
int wlstaterelease(Wlstate*, uint32_t);
void wlstaterepeatinfo(Wlstate*, int, int);
void wlstatecancelrepeat(Wlstate*);
void wlstateclear(Wlstate*);
int wlstatetimeout(Wlstate*, uint64_t);
int wlstaterepeat(Wlstate*, uint64_t, uint32_t*);
#endif