summaryrefslogtreecommitdiff
path: root/examples/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ui.c')
-rwxr-xr-xexamples/ui.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/ui.c b/examples/ui.c
index 1301a6c..79bdd70 100755
--- a/examples/ui.c
+++ b/examples/ui.c
@@ -87,7 +87,7 @@ void update_and_render_frame(void) {
for (i64 i = 0; i < platform.input_size; ++i)
if (platform.input[i].ctrl)
switch (platform.input[i].key) {
- case 'v': {
+ case KEY_V: {
if (selection != 0) {
i64 i0 = selection < 0 ? cursor + selection : cursor;
i64 i1 = selection < 0 ? cursor : cursor + selection;
@@ -112,7 +112,7 @@ void update_and_render_frame(void) {
}
} break;
- case 'x': {
+ case KEY_X: {
i64 len = 0;
static c8 buf[1024];
@@ -131,7 +131,7 @@ void update_and_render_frame(void) {
text_len -= i1 - i0;
} break;
- case 'c': {
+ case KEY_C: {
i64 len = 0;
static c8 buf[1024];
@@ -172,7 +172,7 @@ void update_and_render_frame(void) {
++cursor;
break;
- case '\b':
+ case KEY_BACKSPACE:
if (selection != 0) {
i64 i0 = selection < 0 ? cursor + selection : cursor;
i64 i1 = selection < 0 ? cursor : cursor + selection;
@@ -205,9 +205,8 @@ void update_and_render_frame(void) {
}
break;
- case '\n':
- case '\r':
- case '\t':
+ case KEY_ENTER:
+ case KEY_TAB:
platform.input[i].c = platform.input[i].key;
// fallthrough