Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-06-26 13:15:41 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-06-26 13:15:41 +0400
commit4c53f38756976704bab11a3dd8c33c71d926e6b8 (patch)
tree5db17347afbc71062a77f01f1197a9bfe7f0c20d /source/gameengine/PyDoc/GameKeys.py
parentf69cc652e283bfa1958ae6945b0a014eb7d50906 (diff)
Minor Fixes:
Better use of booleans for python #include fixes for Windows Python Doc fixes Use the farthest vertex as the face position when z sorting faces. (Camera is on -z axis!)
Diffstat (limited to 'source/gameengine/PyDoc/GameKeys.py')
-rw-r--r--source/gameengine/PyDoc/GameKeys.py76
1 files changed, 57 insertions, 19 deletions
diff --git a/source/gameengine/PyDoc/GameKeys.py b/source/gameengine/PyDoc/GameKeys.py
index 8dbc040368b..268fb9cc172 100644
--- a/source/gameengine/PyDoc/GameKeys.py
+++ b/source/gameengine/PyDoc/GameKeys.py
@@ -101,28 +101,66 @@ Function Keys
Other Keys
----------
- - ESCKEY
- - TABKEY
- - RETKEY
- - SPACEKEY
- - LINEFEEDKEY
- - BACKSPACEKEY
- - DELKEY
- - SEMICOLONKEY
- - PERIODKEY
- - COMMAKEY
- - QUOTEKEY
- ACCENTGRAVEKEY
- - MINUSKEY
- - SLASHKEY
- BACKSLASHKEY
+ - BACKSPACEKEY
+ - COMMAKEY
+ - DELKEY
+ - ENDKEY
- EQUALKEY
- - LEFTBRACKETKEY
- - RIGHTBRACKETKEY
- - PAUSEKEY
- - INSERTKEY
+ - ESCKEY
- HOMEKEY
- - PAGEUPKEY
+ - INSERTKEY
+ - LEFTBRACKETKEY
+ - LINEFEEDKEY
+ - MINUSKEY
- PAGEDOWNKEY
- - ENDKEY
+ - PAGEUPKEY
+ - PAUSEKEY
+ - PERIODKEY
+ - QUOTEKEY
+ - RIGHTBRACKETKEY
+ - RETKEY
+ - SEMICOLONKEY
+ - SLASHKEY
+ - SPACEKEY
+ - TABKEY
+
+Example::
+ # Set a connected keyboard sensor to accept F1
+ import GameLogic
+ import GameKeys
+
+ co = GameLogic.getCurrentController()
+ # 'Keyboard' is a keyboard sensor
+ sensor = co.getSensor('Keyboard')
+ sensor.setKey(GameKeys.F1KEY)
+
+Example::
+ # Do the all keys thing
+ import GameLogic
+ import GameKeys
+
+ # status: these should be added to a module somewhere
+ KX_NO_INPUTSTATUS = 0
+ KX_JUSTACTIVATED = 1
+ KX_ACTIVE = 2
+ KX_JUSTRELEASED = 3
+
+ co = GameLogic.getCurrentController()
+ # 'Keyboard' is a keyboard sensor
+ sensor = co.getSensor('Keyboard')
+ keylist = sensor.getPressedKeys()
+ for key in keylist:
+ # key[0] == GameKeys.keycode, key[1] = status
+ if key[1] == KX_JUSTACTIVATED:
+ if key[0] == GameKeys.WKEY:
+ # Activate Forward!
+ if key[0] == GameKeys.SKEY:
+ # Activate Backward!
+ if key[0] == GameKeys.AKEY:
+ # Activate Left!
+ if key[0] == GameKeys.DKEY:
+ # Activate Right!
+
"""