kj
h
This commit is contained in:
parent
8ad3bf1f22
commit
5e23db78ce
|
@ -144,6 +144,10 @@ void dispatch_update(struct InputAxis *axis, struct InputRecord *rec)
|
||||||
axis->data = rec->data;
|
axis->data = rec->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_alphanumeric(char c) {
|
||||||
|
return c >=32 and c <= 126;
|
||||||
|
}
|
||||||
|
|
||||||
bool read_input_buf(struct Controller *ctrl)
|
bool read_input_buf(struct Controller *ctrl)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < ctrl->pending_buf.len; i++) {
|
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;
|
axis->is_down = false;
|
||||||
}
|
}
|
||||||
ctrl->pending_buf.len = 0;
|
ctrl->pending_buf.len = 0;
|
||||||
|
|
||||||
for (size_t i = 0; i < ctrl->buf.len; i++) {
|
for (size_t i = 0; i < ctrl->buf.len; i++) {
|
||||||
struct InputRecord *rec = &ctrl->buf.recs[i];
|
struct InputRecord *rec = &ctrl->buf.recs[i];
|
||||||
|
|
||||||
|
@ -187,6 +191,11 @@ bool CtrlPoll(struct Controller *ctrl, struct InputThreadHandle *hand)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CtrlInputString(struct Controller *ctrl, size_t n, char *buf)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*int main()
|
/*int main()
|
||||||
{
|
{
|
||||||
struct Controller ctrl;
|
struct Controller ctrl;
|
||||||
|
|
|
@ -46,17 +46,15 @@ struct ctrl_axis_vec {
|
||||||
struct Controller {
|
struct Controller {
|
||||||
struct InputBuffer buf;
|
struct InputBuffer buf;
|
||||||
|
|
||||||
struct InputAxis *pending_axes[IO_BUF_SIZE];
|
struct {
|
||||||
char string_input[IO_BUF_SIZE];
|
struct InputAxis *axes[IO_BUF_SIZE];
|
||||||
|
u8f len;
|
||||||
u8f pending_axes_len;
|
} pending_buf;
|
||||||
u8f string_input_len;
|
|
||||||
|
|
||||||
struct ctrl_axis_vec axis_vec;
|
struct ctrl_axis_vec axis_vec;
|
||||||
struct ctrl_dict codes;
|
struct ctrl_dict codes;
|
||||||
struct ctrl_dict binds;
|
struct ctrl_dict binds;
|
||||||
};
|
};
|
||||||
size_t a = sizeof(struct Controller);
|
|
||||||
|
|
||||||
bool CreateCtrl(struct Controller *ctrl);
|
bool CreateCtrl(struct Controller *ctrl);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue