Module SCA_KeyboardSensor

Source Code for Module SCA_KeyboardSensor

 1  # $Id: SCA_KeyboardSensor.py 2717 2004-06-26 09:15:41Z kester $ 
 2  # Documentation for SCA_KeyboardSensor 
 3  from SCA_ISensor import * 
 4   
5 -class SCA_KeyboardSensor(SCA_ISensor):
6 """ 7 A keyboard sensor detects player key presses. 8 9 See module L{GameKeys} for keycode values. 10 """ 11
12 - def getKey():
13 """ 14 Returns the key code this sensor is looking for. 15 """
16
17 - def setKey(keycode):
18 """ 19 Set the key this sensor should listen for. 20 21 @type keycode: keycode from L{GameKeys} module 22 """
23
24 - def getHold1():
25 """ 26 Returns the key code for the first modifier this sensor is looking for. 27 """
28
29 - def setHold1():
30 """ 31 Sets the key code for the first modifier this sensor should look for. 32 """
33
34 - def getHold2():
35 """ 36 Returns the key code for the second modifier this sensor is looking for. 37 """
38
39 - def setHold2():
40 """ 41 Sets the key code for the second modifier this sensor should look for. 42 """
43
44 - def getPressedKeys():
45 """ 46 Get a list of keys that have either been pressed, or just released this frame. 47 48 @rtype: list of key status. [[keycode, status]] 49 """
50
52 """ 53 Get a list of currently pressed keys that have either been pressed, or just released 54 55 @rtype: list of key status. [[keycode, status]] 56 """
57