worst code ever written, make it less bad later

This commit is contained in:
Blendi-Goose 2025-06-29 17:55:58 +02:00
parent 92cfdcb6b8
commit 4c9851f847

View File

@ -560,6 +560,11 @@ int main() {
Font unscii = LoadFont("unscii-16-full.ttf"); Font unscii = LoadFont("unscii-16-full.ttf");
double lastTime = nn_realTime(); double lastTime = nn_realTime();
static int release_check_list[256];
memset(release_check_list, 0, sizeof(int)*256);
uint8_t release_check_ptr;
while(true) { while(true) {
if(WindowShouldClose()) break; if(WindowShouldClose()) break;
@ -571,6 +576,10 @@ int main() {
break; break;
} }
if (keycode != 0) {
release_check_list[release_check_ptr++] = keycode;
}
nn_value values[5]; nn_value values[5];
values[0] = nn_values_cstring("key_down"); values[0] = nn_values_cstring("key_down");
@ -585,13 +594,27 @@ int main() {
// well fuck // well fuck
printf("error happened when eventing the keyboarding: %s\n", error);;;;;; printf("error happened when eventing the keyboarding: %s\n", error);;;;;;
} }
}
values[0] = nn_values_cstring("key_up");
error = nn_pushSignal(computer, values, 5);
if (error != NULL) { for (int i = 0; i < 256; i++) {
// well fuck int key = release_check_list[i];
printf("error happened when eventing the keyboarding: %s\n", error);;;;;; if (key != 0) {
if (IsKeyReleased(key)) {
// omg
nn_value values[5];
values[0] = nn_values_cstring("key_up");
values[1] = nn_values_cstring("shitty keyboard");
values[2] = nn_values_integer(0); // we can't really know, unless we store it, which i am way too lazy to do.
values[3] = nn_values_integer(keycode_to_oc(key));
values[4] = nn_values_cstring("USER");
const char* error = nn_pushSignal(computer, values, 5);
if (error != NULL) {
// well fuck
printf("error happened when eventing the keyboarding: %s\n", error);;;;;;
}
}
} }
} }