File: SCA_KeyboardSensor.py

package info (click to toggle)
blender 2.42a-7
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 60,700 kB
  • ctags: 83,393
  • sloc: ansic: 576,763; cpp: 187,760; python: 48,472; sh: 15,785; makefile: 4,298; perl: 2,082; asm: 1,471; java: 8
file content (58 lines) | stat: -rw-r--r-- 1,267 bytes parent folder | download | duplicates (3)
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: SCA_KeyboardSensor.py,v 1.3 2004/06/26 09:15:40 kester Exp $
# 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]]
		"""