h
This commit is contained in:
Julia 2024-04-23 01:35:19 -05:00
parent 8ad3bf1f22
commit 5e23db78ce
2 changed files with 14 additions and 7 deletions

View file

@ -144,6 +144,10 @@ void dispatch_update(struct InputAxis *axis, struct InputRecord *rec)
axis->data = rec->data;
}
bool is_alphanumeric(char c) {
return c >=32 and c <= 126;
}
bool read_input_buf(struct Controller *ctrl)
{
for (size_t i = 0; i < ctrl->pending_buf.len; i++) {
@ -153,7 +157,7 @@ bool read_input_buf(struct Controller *ctrl)
axis->is_down = false;
}
ctrl->pending_buf.len = 0;
for (size_t i = 0; i < ctrl->buf.len; i++) {
struct InputRecord *rec = &ctrl->buf.recs[i];
@ -187,6 +191,11 @@ bool CtrlPoll(struct Controller *ctrl, struct InputThreadHandle *hand)
return true;
}
bool CtrlInputString(struct Controller *ctrl, size_t n, char *buf)
{
}
/*int main()
{
struct Controller ctrl;

View file

@ -46,17 +46,15 @@ struct ctrl_axis_vec {
struct Controller {
struct InputBuffer buf;
struct InputAxis *pending_axes[IO_BUF_SIZE];
char string_input[IO_BUF_SIZE];
u8f pending_axes_len;
u8f string_input_len;
struct {
struct InputAxis *axes[IO_BUF_SIZE];
u8f len;
} pending_buf;
struct ctrl_axis_vec axis_vec;
struct ctrl_dict codes;
struct ctrl_dict binds;
};
size_t a = sizeof(struct Controller);
bool CreateCtrl(struct Controller *ctrl);