blob: 2f741f7d6a2725d61f30525914b09fb8f6c1f06b (
plain)
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
|
# $Id$
# Documentation for SCA_KeyboardSensor
from SCA_ISensor import *
class SCA_KeyboardSensor(SCA_ISensor):
"""
A keyboard sensor detects player key presses.
See module L{GameKeys} for keycode values.
"""
def getKey():
"""
Returns the key code this sensor is looking for.
"""
def setKey(keycode):
"""
Set the key this sensor should listen for.
@type keycode: keycode from L{GameKeys} module
"""
def getHold1():
"""
Returns the key code for the first modifier this sensor is looking for.
"""
def setHold1():
"""
Sets the key code for the first modifier this sensor should look for.
"""
def getHold2():
"""
Returns the key code for the second modifier this sensor is looking for.
"""
def setHold2():
"""
Sets the key code for the second modifier this sensor should look for.
"""
def getPressedKeys():
"""
Get a list of keys that have either been pressed, or just released this frame.
@rtype: list of key status. [[keycode, status]]
"""
def getCurrentlyPressedKeys():
"""
Get a list of currently pressed keys that have either been pressed, or just released
@rtype: list of key status. [[keycode, status]]
"""
|