CVSROOT: /sources/gnash Module name: gnash Changes by: Zou Lunkai <zoulunkai> 07/09/17 11:04:18
Modified files: . : ChangeLog server : gnash.h Log message: * server/gnash.h: another code map for proper key handling. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4330&r2=1.4331 http://cvs.savannah.gnu.org/viewcvs/gnash/server/gnash.h?cvsroot=gnash&r1=1.104&r2=1.105 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4330 retrieving revision 1.4331 diff -u -b -r1.4330 -r1.4331 --- ChangeLog 17 Sep 2007 05:55:37 -0000 1.4330 +++ ChangeLog 17 Sep 2007 11:04:17 -0000 1.4331 @@ -1,3 +1,7 @@ +2007-09-17 Zou Lunkai <[EMAIL PROTECTED]> + + * server/gnash.h: another code map for proper key handling. + 2007-09-16 Sandro Santilli <[EMAIL PROTECTED]> * testsuite/actionscript.all/Number.as: more tests for Number() Index: server/gnash.h =================================================================== RCS file: /sources/gnash/gnash/server/gnash.h,v retrieving revision 1.104 retrieving revision 1.105 diff -u -b -r1.104 -r1.105 --- server/gnash.h 16 Sep 2007 05:55:30 -0000 1.104 +++ server/gnash.h 17 Sep 2007 11:04:17 -0000 1.105 @@ -405,6 +405,10 @@ // /// Keyboard handling +// TODO: deprecate this table. +// It's wrongly used for +// (1)onClipKeypress, which should use swf-key-code instead, another table. +// (2)characters received from GUI. Different characters might have same codes. namespace key { enum code { @@ -553,7 +557,7 @@ // Gnash character codes. Each code represents a single character on the keyboard. // The first 128 code are ordered by their correspond ASCII value. -enum gnashChar +enum gnashKey { CH_INVALID = 0, CH_UNKOWN1, @@ -574,7 +578,7 @@ CH_SHIFT = 16, CH_CONTROL = 17, CH_ALT = 18, - CH_UNKOWN19, + CH_PAUSE = 19, CH_CAPSLOCK = 20, CH_UNKOWN21, CH_UNKOWN22, @@ -650,12 +654,12 @@ CH_Y, CH_Z = 90, - CH_LEFT_BRACKET = 91, + CH_LEFTBRACKET = 91, CH_BACKSLASH =92, - CH_RIGHT_BRACKET = 93, - CH_ASCIICIRCUM = 94, + CH_RIGHTBRACKET = 93, + CH_CARET = 94, CH_UNDERSCORE = 95, - CH_BACKTICK = 96, + CH_BACKQUOTE = 96, CH_a = 97, CH_b, @@ -683,23 +687,13 @@ CH_x, CH_y, CH_z = 122, - - CH_LEFT_CURLY = 123, + CH_LEFTBRACE = 123, CH_PIPE = 124, - CH_RIGHT_CURLY = 125, + CH_RIGHTBRACE = 125, CH_ASCIITILDE = 126, CH_DELETE = 127, - CH_LEFT_ARROW = 128, - CH_RIGHT_ARROW = 129, - CH_UP_ARROW = 130, - CH_DOWN_ARROW = 131, - CH_HOME = 132, - CH_END = 133, - - CH_NUMLOCK = 134, - - CH_KP_0 =135, + CH_KP_0 = 128, CH_KP_1, CH_KP_2, CH_KP_3, @@ -708,12 +702,217 @@ CH_KP_6, CH_KP_7, CH_KP_8, - CH_KP_9, - CH_KP_ADD, - CH_KP_SUBTRACT, - CH_KP_MULITPLY, - CH_KP_DEVIDE, - CH_KP_DECIMAL + CH_KP_9 = 137, + + CH_F1 = 138, + CH_F2, + CH_F3, + CH_F4, + CH_F5, + CH_F6, + CH_F7, + CH_F8, + CH_F9, + CH_F10, + CH_F11, + CH_F12, + CH_F13, + CH_F14, + CH_F15 = 152, + + CH_UP = 153, + CH_DOWN = 154, + CH_RIGHT = 155, + CH_LEFT = 156, + CH_INSERT = 157, + CH_HOME = 158, + CH_END = 159, + CH_PAGEUP = 160, + CH_PAGEDOWN = 161, + + CH_KP_ADD = 162, + CH_KP_SUBTRACT = 163, + CH_KP_MULITPLY = 164, + CH_KP_DEVIDE = 165, + CH_KP_DECIMAL = 166, + CH_KP_ENTER = 167, + + CH_NUMLOCK = 168, + // TODO: add other function keys and extend the codeMap + CH_COUNT +}; + +const unsigned char codeMap[CH_COUNT][3] = { +//{swfKeyCode, keycode, asciiKeyCode} + {0, 0, 0}, // CH_INVALID = 0 + {0, 0, 0}, // CH_UNKOWN1 + {0, 0, 0}, // CH_UNKOWN2 + {0, 0, 0}, // CH_UNKOWN3 + {0, 0, 0}, // CH_UNKOWN4 + {0, 0, 0}, // CH_UNKOWN5 + {0, 0, 0}, // CH_UNKOWN6 + {0, 0, 0}, // CH_UNKOWN7 + {8, 8, 8}, // CH_BACkSPACE = 8 + {18, 9, 9}, // CH_TAB = 9 + {0, 0, 0}, // CH_UNKOWN10 + {0, 0, 0}, // CH_UNKOWN11 + {0, 12, 0}, // CH_CLEAR = 12 + {13, 13, 13}, // CH_ENTER = 13 + {0, 0, 0}, // CH_UNKOWN14 + {0, 0, 0}, // CH_UNKOWN15 + {0, 16, 0}, // CH_SHIFT = 16 + {0, 17, 0}, // CH_CONTROL = 17 + {0, 18, 0}, // CH_ALT = 18 + {0, 19, 0}, // CH_PAUSE = 19 + {0, 20, 0}, // CH_CAPSLOCK = 20 + {0, 0, 0}, // CH_UNKOWN21 + {0, 0, 0}, // CH_UNKOWN22 + {0, 0, 0}, // CH_UNKOWN23 + {0, 0, 0}, // CH_UNKOWN24 + {0, 0, 0}, // CH_UNKOWN25 + {0, 0, 0}, // CH_UNKOWN26 + {19, 27, 27}, // CH_ESC = 27 + {0, 0, 0}, // CH_UNKOWN28 + {0, 0, 0}, // CH_UNKOWN29 + {0, 0, 0}, // CH_UNKOWN30 + {0, 0, 0}, // CH_UNKOWN31 + {32, 32, 32}, // CH_SPACE = 32 + {33, 33, 33}, // CH_EXCLAM = 33 + {34, 34, 34}, // CH_DOUBLE_QUOTE = 34 + {35, 35, 35}, // CH_HASH = 35 + {36, 36, 36}, // CH_DOLLAR = 36 + {37, 37, 37}, // CH_PERCENT = 37 + {38, 38, 38}, // CH_AMPERSAND = 38 + {39, 39, 39}, // CH_SINGLE_QUOTE = 39 + {40, 40, 40}, // CH_PAREN_LEFT = 40 + {41, 41, 41}, // CH_PAREN_RIGHT = 41 + {42, 42, 42}, // CH_ASTERISK = 42 + {43, 43, 43}, // CH_PLUS = 43 + {44, 44, 44}, // CH_COMMA = 44 + {45, 45, 45}, // CH_MINUS = 45 + {46, 46, 46}, // CH_PERIOD = 46 + {47, 47, 47}, // CH_SLASH = 47 + {48, 48, 48}, // CH_0 = 48 + {49, 49, 49}, // CH_1 + {50, 50, 50}, // CH_2 + {51, 51, 51}, // CH_3 + {52, 52, 52}, // CH_4 + {53, 53, 53}, // CH_5 + {54, 54, 54}, // CH_6 + {55, 55, 55}, // CH_7 + {56, 56, 56}, // CH_8 + {57, 57, 57}, // CH_9 = 57 + {58, 58, 58}, // CH_COLON = 58 + {59, 59, 59}, // CH_SEMICOLON = 59 + {60, 60, 60}, // CH_LESS = 60 + {61, 61, 61}, // CH_EQUAL = 61 + {62, 62, 62}, // CH_MORE = 62 + {63, 63, 63}, // CH_QUESTION = 63 + {64, 64, 64}, // CH_AT = 64 + {65, 65, 65}, // CH_A = 65 + {66, 66, 66}, // CH_B + {67, 67, 67}, // CH_C + {68, 68, 68}, // CH_D + {69, 69, 69}, // CH_E + {70, 70, 70}, // CH_F + {71, 71, 71}, // CH_G + {72, 72, 72}, // CH_H + {73, 73, 73}, // CH_I + {74, 74, 74}, // CH_J + {75, 75, 75}, // CH_K + {76, 76, 76}, // CH_L + {77, 77, 77}, // CH_M + {78, 78, 78}, // CH_N + {79, 79, 79}, // CH_O + {80, 80, 80}, // CH_P + {81, 81, 81}, // CH_Q + {82, 82, 82}, // CH_R + {83, 83, 83}, // CH_S + {84, 84, 84}, // CH_T + {85, 85, 85}, // CH_U + {86, 86, 86}, // CH_V + {87, 87, 87}, // CH_W + {88, 88, 88}, // CH_X + {89, 89, 89}, // CH_Y + {90, 90, 90}, // CH_Z = 90 + {91, 91, 91}, // CH_LEFTBRACKET = 91 + {92, 92, 92}, // CH_BACKSLASH = 92 + {93, 93, 93}, // CH_RIGHTBRACKET = 93 + {94, 94, 94}, // CH_CARET = 94 + {95, 95, 95}, // CH_UNDERSCORE = 95 + {96, 96, 96}, // CH_BACKQUOTE = 96 + {97, 65, 97}, // CH_a = 97 + {98, 66, 98}, // CH_b + {99, 67, 99}, // CH_c + {100,68, 100}, // CH_d + {101,69, 101}, // CH_e + {102,70, 102}, // CH_f + {103,71, 103}, // CH_g + {104,72, 104}, // CH_h + {105,73, 105}, // CH_i + {106,74, 106}, // CH_j + {107,75, 107}, // CH_k + {108,76, 108}, // CH_l + {109,77, 109}, // CH_m + {110,78, 110}, // CH_n + {111,79, 111}, // CH_o + {112,80, 112}, // CH_p + {113,81, 113}, // CH_q + {114,82, 114}, // CH_r + {115,83, 115}, // CH_s + {116,84, 116}, // CH_t + {117,85, 117}, // CH_u + {118,86, 118}, // CH_v + {119,87, 119}, // CH_w + {120,88, 120}, // CH_x + {121,89, 121}, // CH_y + {122,90, 122}, // CH_z = 122 + {123,219,123}, // CH_LEFTBRACE = 123 + {124,220,124}, // CH_PIPE = 124 + {125,221,125}, // CH_RIGHTBRACE = 125 + {126,192,126}, // CH_ASCIITILDE = 126 + {6, 46, 127}, // CH_DELETE = 127 + {48, 96, 48}, // CH_KP_0 = 128 + {49, 97, 49}, // CH_KP_1 + {50, 98, 50}, // CH_KP_2 + {51, 99, 51}, // CH_KP_3 + {52, 100, 52}, // CH_KP_4 + {53, 101, 53}, // CH_KP_5 + {54, 102, 54}, // CH_KP_6 + {55, 103, 55}, // CH_KP_7 + {56, 104, 56}, // CH_KP_8 + {57, 105, 57}, // CH_KP_9 + {0, 112, 0}, // CH_F1 = 138 + {0, 113, 0}, // CH_F2 + {0, 114, 0}, // CH_F3 + {0, 115, 0}, // CH_F4 + {0, 116, 0}, // CH_F5 + {0, 117, 0}, // CH_F6 + {0, 118, 0}, // CH_F7 + {0, 119, 0}, // CH_F8 + {0, 120, 0}, // CH_F9 + {0, 121, 0}, // CH_F10 + {0, 122, 0}, // CH_F11 + {0, 123, 0}, // CH_F12 + {0, 124, 0}, // CH_F13 + {0, 125, 0}, // CH_F14 + {0, 126, 0}, // CH_F15 = 152 + {14, 38, 0}, // CH_UP = 153 + {15, 40, 0}, // CH_DOWN = 154 + {2, 39, 0}, // CH_RIGHT = 155 + {1, 37, 0}, // CH_LEFT = 156 + {5, 45, 0}, // CH_INSERT = 157 + {3, 36, 0}, // CH_HOME = 158 + {4, 35, 0}, // CH_END = 159 + {16, 33, 0}, // CH_PAGEUP = 160 + {17, 34, 0}, // CH_PAGEDOWN = 161 + {0, 107, 43}, // CH_KP_ADD = 162 + {0, 109, 45}, // CH_KP_SUBTRACT = 163 + {0, 106, 42}, // CH_KP_MULITPLY = 164 + {0, 111, 47}, // CH_KP_DEVIDE = 165 + {0, 110, 46}, // CH_KP_DECIMAL = 166 + {13, 13, 13}, // CH_KP_ENTER = 167 + {0, 144, 0}, // CH_NUMLOCK = 168 }; } // end namespace key _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit