A major difference between a normal program accepting keyboard input and a game program accepting keyboard input is that a game is programmed to detect the raw state of the keyboard instead of accepting input from the keyboard.
A game detects directly whether Shift is pressed rather than whether the a
character or the A
character has been sent. A game is also typically not subject to the "repeat" feature a normal program would be. A game detects whether b
is held down, not how often the keystroke is repeated.
Many keys on a keyboard are not suitable for gaming. A keyboard cannot detect whether every key is held down. Most keyboards are designed to detect whether a character key was struck, and will start missing keys when you hold down three or more. This limitation carries over to a game program.