c - SDL2 Handling non character key presses as the same natural delay rate as SDL_TextInputEvent -


in sdl2 there event sdl_textinputevent captures input keyboard @ natural rate os configured be. when poll events, it's this:

sdl_event event; while (sdl_pollevent(&event)) {     switch (event.type) {     case sdl_textinput:         input_listener.last_key = event.text.text;         break;     default:          break;     } } 

the event.text.text char[32] contains character in utf-8 user inputs in program. great delay fine, if hold down a key wont insert loads of a characters fast possible.

however, event doesn't seem capture non-character input pressing enter key or arrow keys. can, however, capture them so:

ubyte* states = sdl_getkeyboardstate(null); if (states[sdl_scancode_backspace]) {     ... stuff here  } 

however not have os delay, , fire possible. program text editor, it's programmed if game. there game loop, update/rendering methods, etc. meaning check input done every frame.

what can non-character input @ same delay rate os configured? there function i'm missing, or way can simulate this?


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -