# HG changeset patch # User Mike Becker # Date 1751491277 -7200 # Node ID 0009b982bc7d0c7cff2ed85127acce716152c509 # Parent bd57fe3f6360de67b192cce9473dc32e3d033c62 resolve TODOs regarding input.h a) mouse position must be integer, because it can be negative (though rarely) b) we should not trade "access complexity" for space in the scancodes array diff -r bd57fe3f6360 -r 0009b982bc7d src/ascension/input.h --- a/src/ascension/input.h Tue Jul 01 20:28:49 2025 +0200 +++ b/src/ascension/input.h Wed Jul 02 23:21:17 2025 +0200 @@ -54,8 +54,6 @@ /** * State of the keys. * - * TODO: reduce this to a reasonable size - * * @see asc_key_pressed() * @see asc_key_released() * @see asc_key_down() @@ -82,7 +80,6 @@ #define asc_mouse_x asc_context.input.mouse_x #define asc_mouse_y asc_context.input.mouse_y #define asc_mouse_window asc_context.input.mouse_window -// TODO: think about whether this should be asc_vec2u #define asc_mouse_pos ((asc_vec2i) {asc_mouse_x, asc_mouse_y}) #define asc_mouse_move_x asc_context.input.mouse_xrel diff -r bd57fe3f6360 -r 0009b982bc7d src/context.c --- a/src/context.c Tue Jul 01 20:28:49 2025 +0200 +++ b/src/context.c Wed Jul 02 23:21:17 2025 +0200 @@ -187,7 +187,7 @@ case SDL_KEYDOWN: // we only set the down and press flags if the key is not already known to be down if (asc_key_up(event.key.keysym.scancode)) { - asc_set_flag(asc_context.input.keys[event.key.keysym.scancode], ASC_KEY_DOWN_FLAG|ASC_KEY_PRESS_FLAG); + asc_context.input.keys[event.key.keysym.scancode] = ASC_KEY_DOWN_FLAG|ASC_KEY_PRESS_FLAG; } break; case SDL_KEYUP: