CS-Journeys / AsciiEngine

Game engine for building command-line, ascii art games
GNU General Public License v3.0
3 stars 0 forks source link

Keyboard Input #1

Open lukalelovic opened 3 years ago

lukalelovic commented 3 years ago

The keyboard class only supports unbuffered input for alphabetic keys, on windows systems.

What is needed:

  1. Unbuffered input for every keyboard key
  2. Support for key input on non-windows systems (i.e. Mac & Linux)

For the first point, it might be best to rewrite the keyboard class to have an enumerated data type of all keyboard keys. For the second point, I recommend looking into functions such as getch()

daniel-luper commented 3 years ago

See progress on linux-keyboard branch. Getting non-alphabetic characters to work is definitely the hard part. I should be able to get arrow input easily, but handling escape and CTRL buttons and whatnot is more complicated :/

lukalelovic commented 3 years ago

Yeah, I'm not sure if the ASCII codes support those keys. But for those keys especially shifting to enumerated data type for the keys might be best. Let me know when the branch is ready to be merged!