-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkey_defs.py
65 lines (57 loc) · 2.88 KB
/
key_defs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of You only get one! (match).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from pygame.locals import *
import pygame.event as e
from tryengine.constants import *
from tryengine.playerinput import INSTANT, DELAYED
key_definitios = {
K_UP: (INSTANT, e.Event(PLAYER, code = JUMP)),
K_SPACE: (INSTANT, e.Event(PLAYER, code = JUMP)),
K_z: (INSTANT, e.Event(PLAYER, code = JUMP)),
K_DOWN: (INSTANT, e.Event(PLAYER, code = USE)),
K_LEFT: (INSTANT, e.Event(PLAYER, code = LEFT)),
K_RIGHT: (INSTANT, e.Event(PLAYER, code = RIGHT)),
#~ K_SPACE: (INSTANT, e.Event(PLAYER, code = SHOOT)),
#~ K_r: (DELAYED, e.Event(PLAYER, code = RESPAWN)),
# Renderer command keys
(K_RETURN, KMOD_LALT): (DELAYED, e.Event(ENGINE, code = TOGGLE_FULLSCREEN), (0.1,)),
K_F11: (DELAYED, e.Event(ENGINE, code = TOGGLE_FULLSCREEN), (0.1,)),
#~ K_f: (DELAYED, e.Event(RENDERER, code = FADE)),
#~ K_n: (DELAYED, e.Event(RENDERER, code = NEXT_CAMERA)),
#~ K_LEFT: (INSTANT, e.Event(RENDERER, code = CAMERA_LEFT)),
#~ K_RIGHT: (INSTANT, e.Event(RENDERER, code = CAMERA_RIGHT)),
#~ K_UP: (INSTANT, e.Event(RENDERER, code = CAMERA_UP)),
#~ K_DOWN: (INSTANT, e.Event(RENDERER, code = CAMERA_DOWN)),
#~ K_k: (INSTANT, e.Event(RENDERER, code = CAMERA_SHAKE)),
# Engine command keys
#~ (K_r, KMOD_LCTRL): (DELAYED, e.Event(ENGINE, code = RELOAD_MAP)),
#~ (K_d, KMOD_LCTRL): (DELAYED, e.Event(ENGINE, code = CYCLE_DEBUG_MODES)),
(K_s, KMOD_LCTRL): (DELAYED, e.Event(ENGINE, code = CYCLE_DISPLAY_MODES)),
K_F10: (DELAYED, e.Event(ENGINE, code = CYCLE_DISPLAY_MODES)),
K_F12: (DELAYED, e.Event(ENGINE, code = SCREENSHOT)),
#~ (K_v, KMOD_LCTRL): (DELAYED, e.Event(ENGINE, code = SUPER_LOW_FPS), (0.1,)),
#~ K_q: (DELAYED, e.Event(ENGINE, code = QUIT), (0.1,)),
# K_ESCAPE: (DELAYED, e.Event(ENGINE, code = PAUSE)),
# K_p: (DELAYED, e.Event(ENGINE, code = PAUSE)),
#~ (K_g, KMOD_LCTRL): (DELAYED, e.Event(ENGINE, code = ONE_LAYER_UP)),
#~ (K_t, KMOD_LCTRL): (DELAYED, e.Event(ENGINE, code = ONE_LAYER_DOWN)),
#~ K_j: (DELAYED, e.Event(ENGINE, code = CONTROL_NEXT_MOB)),
#~ K_l: (DELAYED, e.Event(ENGINE, code = CHEATS)),
# Engine mouse bindings
}