Keyboard Sensor: useAllKeys

useAllKeys
  • gets/sets if the All Keys button is used.

Type: 
  • boolean

Values:

  • 1 = True = Use All Keys 
     
  • 0 = False = Don't use all keys
Keyboard Sensor:
  • When the selected key is pressed, it sends one positive pulse to the connected controller(s).
     
  • When the selected key is released, it sends one negative pulse to the connected controller(s).
Sample Code


################  Get the status of the All Keys button
 
# import bge module

import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the sensor attached to the controller
# my sensor is named Gas

sen = cont.sensors["Gas"]

# get the status of the All Keys button
allKeys_status = sen.useAllKeys
 
Sample Code


################  Set the All Keys button to True
 
# import bge module

import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the sensor attached to the controller
# my sensor is named Gas

sen = cont.sensors["Gas"]

# Use the All Keys button
sen.useAllKeys = True