title: Keyboard input in games (for GLUT)
body: <p>Almost every game use keyboard as input. I have been searching for 2 days on this topic and found quite much about it. Keyboards have many disadvantages, but main problems I found are different layouts and second that if you are pressing 3 keys at time, it can lead to corruption (row-column error). If you don't know what I'm talking about, keyboard is made as grid and it checks which row and column has connected. But if you press E,D (row 1,2 column 3)
  and R (row 1, column 4), keyboard can show even F because it find it pressed(row 2, column 4 both pressed). </p>
  
  <p>So I think we can't do anything about that second, but if anyone got idea how to solve it better then use keys that don't form L, I'd be glad :)</p>
  
  <p>But my main problem are different keyboard layouts which is real pain. I'm slovak so Slovak layout of numbers look like this:
  +ľščťžýáíé and with shift 1234567890, we also got QWERTZ but you can use QWERTY.
  You all know how the English look like but just for sure:
  1234567890 and shift !@#$%^&amp;*()</p>
  
  <p>Most of time I'm using english one because I got used to it when programming. Anyway there are different people using different layouts. When you are making game that depend on which key is pressed, for example good old WASD pattern, you can't use that on french one which is AZERTY layout. It would be strange. Same as using numbers for choosing gun in action game. As you can see slovak would have to press shift to get it work.</p>
  
  <p>I'm also using OpeGL. There is problem when you are mapping which keys are pressed. For example widely used solution to make map of 256 bools for each charakter, is suffering from SHIFT. You press a, SHIFT and release a you got: a down, A up. So I thought about binding some keys together, as A and a, 1 and !, but then I realized I'll just change layout and everything is wrong.</p>
  
  <p>So what is solution for that? I think there is someone out there that is in game industry or made some game and had to solve this. Only solution that comes on my mind is to force english layout for UI (and choosen layout for chat).</p>
  
  <p><strong>After next searching I found what I need but I need cross-platform one:
  <a href="http://delphi.about.com/od/objectpascalide/l/blvkc.htm" rel="nofollow noreferrer">virtual key codes</a></strong></p>
  
  <p><strong>And next search revealed <a href="http://falconpl.org/project_docs/sdl/class_SDLK.html" rel="nofollow noreferrer">SDL key</a></strong></p>
  
  <p><strong>Result: Don't ever start with GLUT if you go making games, use SFML or SDL</strong></p>
  
  <p><strong><em>Thanks to everyone for helping me, there were more problems in this so idea of key binding/mapping, SDL and so on, each helped me alot.</em></strong></p>