title: SDL_Keycodes are too big for storage
body: <p>While searching up methods of detecting multiple keys at once in SDL 2, I came across this piece of code for SDL 1.x:</p>
  
  <pre><code>//author: Rob Loach
  // Global key buffer
  bool keys[256];
  
  while(SDL_PollEvent(&amp;mainEvent))
  {
     if(mainEvent.type == SDL_KEYDOWN)
     {
         keys[mainEvent.key.keysym.sym] = true;
     }
     else if(mainEvent.type == SDL_KEYUP)
     {
         keys[mainEvent.key.keysym.sym] = false;
     }
  }
  </code></pre>
  
  <p>I tried implementing it in SDL2 and a <code>std::array&lt;bool, 256&gt;</code>, but I had <code>Segmentation fault: 11</code> with the up button.</p>
  
  <p>That's when I looked at this: <a href="https://wiki.libsdl.org/SDLKeycodeLookup" rel="nofollow">https://wiki.libsdl.org/SDLKeycodeLookup</a>.</p>
  
  <p>Most of the 'special' keys including arrow, function, symbols, and so on have decimal representations in the billions.</p>
  
  <p>Even with the simple code <code>printf("%d\n", e.key.keysym.sym);</code> on, say the up button gives:</p>
  
  <pre><code>1073741906
  Segmentation fault: 11
  </code></pre>
  
  <p>I am on a Mac, if it makes any difference with the error codes.</p>
  
  <p>So, what solutions are there to this in SDL 2?</p>