Home > Net >  Keyboard inputs in c without using a library that does everything for you
Keyboard inputs in c without using a library that does everything for you

Time:07-04

I'm working on a 3D Engine for C, and I have (what I believe) to be everything. Except keyboard input, I could use the scanf() function but I imagine that has its problems (like multi-key inputs). I dont want to use a library like SDL2, I just want a header file for inputs or more preferably just getting code to scan for keys and add it to an array or something. Please do not suggest something better or a library that would do everything for me, I want to build this from scratch. Thank you.

CodePudding user response:

You will probably want to process the following two window messages in your message loop:

See the Microsoft documentation on Keyboard Input for further information.

  • Related