title: C++ mutiple key input or key press/release events
body: <p>I am writing a game in C++. For it, I need to detect multiple keys being pressed or held at the same time, or detect key press and key release events.  </p>
  
  <p>For example, if I hold both the <kbd>up</kbd> and <kbd>right</kbd> keys, I want to be able to detect this and move the game diagonally. Additionally, currently if I am holding the <kbd>right</kbd> key, and I press <kbd>up</kbd>, it no longer recognizes that <kbd>right</kbd> is being held. I need a way to find when the <kbd>right</kbd> key is actually released so it isn't interrupted like this.</p>
  
  <p>I know that <code>sdl2</code> can recognize multiple keys being pressed or held, but that requires creating a window, and I want this to be entirely within the terminal.</p>
  
  <p><code>getch()</code> from <code>curses/ncurses</code> additionally doesn't work for this.</p>
  
  <p>What can I use for this? I'd like to avoid Allegro if possible.</p>