Module Rubygame::Key
In: lib/rubygame/constants.rb

Constants

KEY2ASCII = { K_BACKSPACE => "\b", K_TAB => "\t", K_RETURN => "\n", #SDL docs: "\r". Win vs *nix? What about Mac? K_ESCAPE => "^[", K_SPACE => " ", K_EXCLAIM => "!", K_QUOTEDBL => "\"", K_HASH => "#", K_DOLLAR => "$", K_AMPERSAND => "&", K_QUOTE => "\'", K_LEFTPAREN => "(", K_RIGHTPAREN => ")", K_ASTERISK => "*", K_PLUS => "+", K_COMMA => ",", K_MINUS => "-", K_PERIOD => ".", K_SLASH => "/", K_0 => "0", K_1 => "1", K_2 => "2", K_3 => "3", K_4 => "4", K_5 => "5", K_6 => "6", K_7 => "7", K_8 => "8", K_9 => "9", K_COLON => ":", K_SEMICOLON => ";", K_LESS => "<", K_EQUALS => "=", K_GREATER => ">", K_QUESTION => "?", K_AT => "@", K_LEFTBRACKET => "[", K_BACKSLASH => "\\", K_RIGHTBRACKET => "]", K_CARET => "^", K_UNDERSCORE => "_", K_BACKQUOTE => "`", K_A => "a", K_B => "b", K_C => "c", K_D => "d", K_E => "e", K_F => "f", K_G => "g", K_H => "h", K_I => "i", K_J => "j", K_K => "k", K_L => "l", K_M => "m", K_N => "n", K_O => "o", K_P => "p", K_Q => "q", K_R => "r", K_S => "s", K_T => "t", K_U => "u", K_V => "v", K_W => "w", K_X => "x", K_Y => "y", K_Z => "z", K_KP0 => "0", K_KP1 => "1", K_KP2 => "2", K_KP3 => "3", K_KP4 => "4", K_KP5 => "5", K_KP6 => "6", K_KP7 => "7", K_KP8 => "8", K_KP9 => "9", K_KP_PERIOD => ".", K_KP_DIVIDE => "/", K_KP_MULTIPLY => "*", K_KP_MINUS => "-", K_KP_PLUS => "+", K_KP_ENTER => "\n", #again, SDL docs say "\r" K_KP_EQUALS => "=", }   All the keys which have ASCII print values It is 87 lines from here to the closing }, if you want to skip it...
ASCII2KEY = KEY2ASCII.invert()   And to translate the other way...
KEY2LOWER = { K_QUOTE => "\'", K_COMMA => ",", K_MINUS => "-", K_PERIOD => ".", K_SLASH => "/", K_0 => "0", K_1 => "1", K_2 => "2", K_3 => "3", K_4 => "4", K_5 => "5", K_6 => "6", K_7 => "7", K_8 => "8", K_9 => "9", K_SEMICOLON => ";", K_EQUALS => "=", K_LEFTBRACKET => "[", K_BACKSLASH => "\\", K_RIGHTBRACKET => "]", K_BACKQUOTE => "`", K_A => "a", K_B => "b", K_C => "c", K_D => "d", K_E => "e", K_F => "f", K_G => "g", K_H => "h", K_I => "i", K_J => "j", K_K => "k", K_L => "l", K_M => "m", K_N => "n", K_O => "o", K_P => "p", K_Q => "q", K_R => "r", K_S => "s", K_T => "t", K_U => "u", K_V => "v", K_W => "w", K_X => "x", K_Y => "y", K_Z => "z", }   All the keys that are affected by the Shift key, in lower case 49 lines from here to the end of the hash
KEY2UPPER = { K_QUOTE => "\"", K_COMMA => "<", K_MINUS => "_", K_PERIOD => ">", K_SLASH => "?", K_0 => ")", K_1 => "!", K_2 => "@", K_3 => "#", K_4 => "$", K_5 => "%", K_6 => "^", K_7 => "&", K_8 => "*", K_9 => "(", K_SEMICOLON => ":", K_EQUALS => "+", K_LEFTBRACKET => "{", K_BACKSLASH => "|", K_RIGHTBRACKET => "}", K_BACKQUOTE => "~", K_A => "A", K_B => "B", K_C => "C", K_D => "D", K_E => "E", K_F => "F", K_G => "G", K_H => "H", K_I => "I", K_J => "J", K_K => "K", K_L => "L", K_M => "M", K_N => "N", K_O => "O", K_P => "P", K_Q => "Q", K_R => "R", K_S => "S", K_T => "T", K_U => "U", K_V => "V", K_W => "W", K_X => "X", K_Y => "Y", K_Z => "Z", }   All the keys that are affected by the Shift key, in UPPER case 49 lines from here to the end of the hash

[Validate]