sketchingpy.sketch2d_keymap
Standardization of key values for keyboard.
License:
BSD
1"""Standardization of key values for keyboard. 2 3License: 4 BSD 5""" 6 7import pygame.locals 8 9import sketchingpy.const 10 11 12KEY_MAP = { 13 pygame.locals.K_BACKSPACE: sketchingpy.const.KEYBOARD_BACKSPACE_BUTTON, 14 pygame.locals.K_TAB: sketchingpy.const.KEYBOARD_TAB_BUTTON, 15 pygame.locals.K_CLEAR: 'clear', 16 pygame.locals.K_RETURN: sketchingpy.const.KEYBOARD_RETURN_BUTTON, 17 pygame.locals.K_PAUSE: 'pause', 18 pygame.locals.K_ESCAPE: 'escape', 19 pygame.locals.K_SPACE: sketchingpy.const.KEYBOARD_SPACE_BUTTON, 20 pygame.locals.K_EXCLAIM: 'exclaim', 21 pygame.locals.K_QUOTEDBL: 'quotedbl', 22 pygame.locals.K_HASH: 'hash', 23 pygame.locals.K_DOLLAR: 'dollar', 24 pygame.locals.K_AMPERSAND: 'ampersand', 25 pygame.locals.K_QUOTE: 'quote', 26 pygame.locals.K_LEFTPAREN: 'leftparen', 27 pygame.locals.K_RIGHTPAREN: 'rightparen', 28 pygame.locals.K_ASTERISK: 'asterisk', 29 pygame.locals.K_PLUS: 'plus', 30 pygame.locals.K_COMMA: 'comma', 31 pygame.locals.K_MINUS: 'minus', 32 pygame.locals.K_PERIOD: 'period', 33 pygame.locals.K_SLASH: 'slash', 34 pygame.locals.K_0: '0', 35 pygame.locals.K_1: '1', 36 pygame.locals.K_2: '2', 37 pygame.locals.K_3: '3', 38 pygame.locals.K_4: '4', 39 pygame.locals.K_5: '5', 40 pygame.locals.K_6: '6', 41 pygame.locals.K_7: '7', 42 pygame.locals.K_8: '8', 43 pygame.locals.K_9: '9', 44 pygame.locals.K_COLON: 'colon', 45 pygame.locals.K_SEMICOLON: 'semicolon', 46 pygame.locals.K_LESS: 'less', 47 pygame.locals.K_EQUALS: 'equals', 48 pygame.locals.K_GREATER: 'greater', 49 pygame.locals.K_QUESTION: 'question', 50 pygame.locals.K_AT: 'at', 51 pygame.locals.K_LEFTBRACKET: 'leftbracket', 52 pygame.locals.K_BACKSLASH: 'backslash', 53 pygame.locals.K_RIGHTBRACKET: 'rightbracket', 54 pygame.locals.K_CARET: 'caret', 55 pygame.locals.K_UNDERSCORE: 'underscore', 56 pygame.locals.K_BACKQUOTE: 'backquote', 57 pygame.locals.K_a: 'a', 58 pygame.locals.K_b: 'b', 59 pygame.locals.K_c: 'c', 60 pygame.locals.K_d: 'd', 61 pygame.locals.K_e: 'e', 62 pygame.locals.K_f: 'f', 63 pygame.locals.K_g: 'g', 64 pygame.locals.K_h: 'h', 65 pygame.locals.K_i: 'i', 66 pygame.locals.K_j: 'j', 67 pygame.locals.K_k: 'k', 68 pygame.locals.K_l: 'l', 69 pygame.locals.K_m: 'm', 70 pygame.locals.K_n: 'n', 71 pygame.locals.K_o: 'o', 72 pygame.locals.K_p: 'p', 73 pygame.locals.K_q: 'q', 74 pygame.locals.K_r: 'r', 75 pygame.locals.K_s: 's', 76 pygame.locals.K_t: 't', 77 pygame.locals.K_u: 'u', 78 pygame.locals.K_v: 'v', 79 pygame.locals.K_w: 'w', 80 pygame.locals.K_x: 'x', 81 pygame.locals.K_y: 'y', 82 pygame.locals.K_z: 'z', 83 pygame.locals.K_DELETE: 'delete', 84 pygame.locals.K_KP0: 'kp0', 85 pygame.locals.K_KP1: 'kp1', 86 pygame.locals.K_KP2: 'kp2', 87 pygame.locals.K_KP3: 'kp3', 88 pygame.locals.K_KP4: 'kp4', 89 pygame.locals.K_KP5: 'kp5', 90 pygame.locals.K_KP6: 'kp6', 91 pygame.locals.K_KP7: 'kp7', 92 pygame.locals.K_KP8: 'kp8', 93 pygame.locals.K_KP9: 'kp9', 94 pygame.locals.K_KP_PERIOD: 'kp_period', 95 pygame.locals.K_KP_DIVIDE: 'kp_divide', 96 pygame.locals.K_KP_MULTIPLY: 'kp_multiply', 97 pygame.locals.K_KP_MINUS: 'kp_minus', 98 pygame.locals.K_KP_PLUS: 'kp_plus', 99 pygame.locals.K_KP_ENTER: 'kp_enter', 100 pygame.locals.K_KP_EQUALS: 'kp_equals', 101 pygame.locals.K_UP: sketchingpy.const.KEYBOARD_UP_BUTTON, 102 pygame.locals.K_DOWN: sketchingpy.const.KEYBOARD_DOWN_BUTTON, 103 pygame.locals.K_RIGHT: sketchingpy.const.KEYBOARD_RIGHT_BUTTON, 104 pygame.locals.K_LEFT: sketchingpy.const.KEYBOARD_LEFT_BUTTON, 105 pygame.locals.K_INSERT: 'insert', 106 pygame.locals.K_HOME: sketchingpy.const.KEYBOARD_HOME_BUTTON, 107 pygame.locals.K_END: sketchingpy.const.KEYBOARD_END_BUTTON, 108 pygame.locals.K_PAGEUP: 'pageup', 109 pygame.locals.K_PAGEDOWN: 'pagedown', 110 pygame.locals.K_F1: 'f1', 111 pygame.locals.K_F2: 'f2', 112 pygame.locals.K_F3: 'f3', 113 pygame.locals.K_F4: 'f4', 114 pygame.locals.K_F5: 'f5', 115 pygame.locals.K_F6: 'f6', 116 pygame.locals.K_F7: 'f7', 117 pygame.locals.K_F8: 'f8', 118 pygame.locals.K_F9: 'f9', 119 pygame.locals.K_F10: 'f10', 120 pygame.locals.K_F11: 'f11', 121 pygame.locals.K_F12: 'f12', 122 pygame.locals.K_F13: 'f13', 123 pygame.locals.K_F14: 'f14', 124 pygame.locals.K_F15: 'f15', 125 pygame.locals.K_NUMLOCK: 'numlock', 126 pygame.locals.K_CAPSLOCK: 'capslock', 127 pygame.locals.K_SCROLLOCK: 'scrollock', 128 pygame.locals.K_RSHIFT: sketchingpy.const.KEYBOARD_SHIFT_BUTTON, 129 pygame.locals.K_LSHIFT: sketchingpy.const.KEYBOARD_SHIFT_BUTTON, 130 pygame.locals.K_RCTRL: sketchingpy.const.KEYBOARD_CTRL_BUTTON, 131 pygame.locals.K_LCTRL: sketchingpy.const.KEYBOARD_CTRL_BUTTON, 132 pygame.locals.K_RALT: sketchingpy.const.KEYBOARD_ALT_BUTTON, 133 pygame.locals.K_LALT: sketchingpy.const.KEYBOARD_ALT_BUTTON, 134 pygame.locals.K_RMETA: sketchingpy.const.KEYBOARD_SUPER_BUTTON, 135 pygame.locals.K_LMETA: sketchingpy.const.KEYBOARD_SUPER_BUTTON, 136 pygame.locals.K_LSUPER: sketchingpy.const.KEYBOARD_SUPER_BUTTON, 137 pygame.locals.K_RSUPER: sketchingpy.const.KEYBOARD_SUPER_BUTTON, 138 pygame.locals.K_MODE: 'mode', 139 pygame.locals.K_HELP: 'help', 140 pygame.locals.K_PRINT: 'print', 141 pygame.locals.K_SYSREQ: 'sysreq', 142 pygame.locals.K_BREAK: 'break', 143 pygame.locals.K_MENU: 'menu', 144 pygame.locals.K_POWER: 'power', 145 pygame.locals.K_EURO: 'euro', 146 pygame.locals.K_AC_BACK: 'ac_back' 147}
KEY_MAP =
{8: 'backspace', 9: 'tab', 1073741980: 'clear', 13: 'return', 1073741896: 'break', 27: 'escape', 32: 'space', 33: 'exclaim', 34: 'quotedbl', 35: 'hash', 36: 'dollar', 38: 'ampersand', 39: 'quote', 40: 'leftparen', 41: 'rightparen', 42: 'asterisk', 43: 'plus', 44: 'comma', 45: 'minus', 46: 'period', 47: 'slash', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', 54: '6', 55: '7', 56: '8', 57: '9', 58: 'colon', 59: 'semicolon', 60: 'less', 61: 'equals', 62: 'greater', 63: 'question', 64: 'at', 91: 'leftbracket', 92: 'backslash', 93: 'rightbracket', 94: 'caret', 95: 'underscore', 96: 'backquote', 97: 'a', 98: 'b', 99: 'c', 100: 'd', 101: 'e', 102: 'f', 103: 'g', 104: 'h', 105: 'i', 106: 'j', 107: 'k', 108: 'l', 109: 'm', 110: 'n', 111: 'o', 112: 'p', 113: 'q', 114: 'r', 115: 's', 116: 't', 117: 'u', 118: 'v', 119: 'w', 120: 'x', 121: 'y', 122: 'z', 127: 'delete', 1073741922: 'kp0', 1073741913: 'kp1', 1073741914: 'kp2', 1073741915: 'kp3', 1073741916: 'kp4', 1073741917: 'kp5', 1073741918: 'kp6', 1073741919: 'kp7', 1073741920: 'kp8', 1073741921: 'kp9', 1073741923: 'kp_period', 1073741908: 'kp_divide', 1073741909: 'kp_multiply', 1073741910: 'kp_minus', 1073741911: 'kp_plus', 1073741912: 'kp_enter', 1073741927: 'kp_equals', 1073741906: 'up', 1073741905: 'down', 1073741903: 'right', 1073741904: 'left', 1073741897: 'insert', 1073741898: 'home', 1073741901: 'end', 1073741899: 'pageup', 1073741902: 'pagedown', 1073741882: 'f1', 1073741883: 'f2', 1073741884: 'f3', 1073741885: 'f4', 1073741886: 'f5', 1073741887: 'f6', 1073741888: 'f7', 1073741889: 'f8', 1073741890: 'f9', 1073741891: 'f10', 1073741892: 'f11', 1073741893: 'f12', 1073741928: 'f13', 1073741929: 'f14', 1073741930: 'f15', 1073741907: 'numlock', 1073741881: 'capslock', 1073741895: 'scrollock', 1073742053: 'shift', 1073742049: 'shift', 1073742052: 'ctrl', 1073742048: 'ctrl', 1073742054: 'alt', 1073742050: 'alt', 1073742055: 'super', 1073742051: 'super', 1073742081: 'mode', 1073741941: 'help', 1073741894: 'print', 1073741978: 'sysreq', 1073741942: 'menu', 1073741926: 'power', 1073742004: 'euro', 1073742094: 'ac_back'}