Commit 5c0aee11 authored by talljosh's avatar talljosh

Removed symbols that already have the name we want in pygame.keyboard.name(),...

Removed symbols that already have the name we want in pygame.keyboard.name(), and ensure we're still compatible with Pygame 1.
parent ea9e0eb1eb8b
pygame>=2
pygame
twisted>=15.0
simplejson
PySide2
......
......@@ -40,7 +40,7 @@ if __name__ == '__main__':
long_description = 'Trosnoth is a fast-paced open source territory control team platform game.' ,
install_requires = [
'pygame>=2',
'pygame',
'twisted>=15.0',
'simplejson',
'PySide2',
......
......@@ -30,10 +30,8 @@ def shortcutName(key, modifiers=0):
NAMED = {
-1: 'L.Click', -2: 'M.Click', -3: 'R.Click',
pygame.K_AC_BACK: '←',
pygame.K_BACKSPACE: 'Backspace', pygame.K_BREAK: 'Break',
pygame.K_CAPSLOCK: 'Capslock', pygame.K_CLEAR: 'Clear',
pygame.K_CURRENCYSUBUNIT: 'Cents',
pygame.K_DELETE:
'Del', pygame.K_DOWN: 'Down', pygame.K_END: 'End', pygame.K_ESCAPE:
'Escape', pygame.K_EURO: 'Euro', pygame.K_F1: 'F1', pygame.K_F2: 'F2',
......@@ -54,15 +52,6 @@ NAMED = {
pygame.K_SCROLLOCK: 'Scrolllock', pygame.K_SYSREQ: 'SysRq', pygame.K_TAB:
'Tab', pygame.K_UP: 'Up', pygame.K_SPACE: 'Space',
pygame.K_a: 'a', pygame.K_b: 'b', pygame.K_c: 'c', pygame.K_d: 'd',
pygame.K_e: 'e', pygame.K_f: 'f', pygame.K_g: 'g', pygame.K_h: 'h',
pygame.K_i: 'i', pygame.K_j: 'j', pygame.K_k: 'k', pygame.K_l: 'l',
pygame.K_m: 'm', pygame.K_n: 'n', pygame.K_o: 'o', pygame.K_p: 'p',
pygame.K_q: 'q', pygame.K_r: 'r', pygame.K_s: 's', pygame.K_t: 't',
pygame.K_u: 'u', pygame.K_v: 'v', pygame.K_w: 'w', pygame.K_x: 'x',
pygame.K_y: 'y', pygame.K_z: 'z', pygame.K_0: '0', pygame.K_1: '1',
pygame.K_2: '2', pygame.K_3: '3', pygame.K_4: '4', pygame.K_5: '5',
pygame.K_6: '6', pygame.K_7: '7', pygame.K_8: '8', pygame.K_9: '9',
pygame.K_KP0: 'keypad-0', pygame.K_KP1: 'keypad-1', pygame.K_KP2:
'keypad-2', pygame.K_KP3: 'keypad-3', pygame.K_KP4: 'keypad-4',
pygame.K_KP5: 'keypad-5', pygame.K_KP6: 'keypad-6', pygame.K_KP7:
......@@ -71,24 +60,15 @@ NAMED = {
pygame.K_KP_EQUALS: 'keypad equals', pygame.K_KP_MINUS: 'keypad minus',
pygame.K_KP_MULTIPLY: 'keypad asterisk', pygame.K_KP_PERIOD:
'keypad full stop', pygame.K_KP_PLUS: 'keypad plus',
pygame.K_AMPERSAND: '&', pygame.K_ASTERISK: '*', pygame.K_AT: '@',
pygame.K_BACKQUOTE: '`', pygame.K_BACKSLASH: '\\', pygame.K_CARET: '^',
pygame.K_COLON: ':', pygame.K_COMMA: ',', pygame.K_DOLLAR: '$',
pygame.K_EQUALS: '=', pygame.K_EXCLAIM: '!', pygame.K_GREATER: '>',
pygame.K_LESS: '<', pygame.K_HASH: '#', pygame.K_LEFTBRACKET: '[',
pygame.K_LEFTPAREN: '(', pygame.K_MINUS: '-',
pygame.K_PERCENT: '%',
pygame.K_PERIOD: '.',
pygame.K_PLUS: '+',
pygame.K_QUOTE: "'",
pygame.K_QUOTEDBL: '"',
pygame.K_QUESTION: '?',
pygame.K_RIGHTBRACKET: ']',
pygame.K_RIGHTPAREN: ')', pygame.K_SEMICOLON: ';', pygame.K_SLASH: '/',
pygame.K_UNDERSCORE: '_'
}
try:
NAMED[pygame.K_AC_BACK] = '←'
NAMED[pygame.K_CURRENCYSUBUNIT] = 'Cents'
except AttributeError:
# These symbols don't exist in pygame 1
pass
KMOD_NAMES = ((pygame.KMOD_CTRL, 'Ctrl'), (pygame.KMOD_ALT, 'Alt'),
(pygame.KMOD_META, 'Meta'), (pygame.KMOD_SHIFT, 'Shift'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment