Panda3D
|
Public Member Functions | |
__init__ (self) | |
debugPrint (self, message) | |
delete (self) | |
force (self, name, value, inputSource) | |
getEventName (self, name) | |
isSet (self, name, inputSource=None) | |
releaseInputs (self, name) | |
set (self, name, isActive, inputSource=None) | |
watch (self, name, eventOn, eventOff, startState=False, inputSource=None) | |
watchWithModifiers (self, name, event, startState=False, inputSource=None) | |
Public Attributes | |
set | |
Static Public Attributes | |
str | ArrowKeys = 'ArrowKeys' |
debug_print = debugPrint | |
get_event_name = getEventName | |
is_set = isSet | |
str | Keyboard = 'Keyboard' |
str | Mouse = 'Mouse' |
notify = DirectNotifyGlobal.directNotify.newCategory("InputState") | |
str | QE = 'QE' |
release_inputs = releaseInputs | |
str | WASD = 'WASD' |
watch_with_modifiers = watchWithModifiers | |
Protected Member Functions | |
_ignore (self, token) | |
_unforce (self, token) | |
Protected Attributes | |
_forcingOff | |
_forcingOn | |
_state | |
_token2forceInfo | |
_token2inputSource | |
_watching | |
InputState is for tracking the on/off state of some events. The initial usage is to watch some keyboard keys so that another task can poll the key states. By the way, in general polling is not a good idea, but it is useful in some situations. Know when to use it:) If in doubt, don't use this class and listen for events instead.
__init__ | ( | self | ) |
|
protected |
Undo a watch(). Don't call this directly, call release() on the token that watch() returned.
|
protected |
Stop forcing a value. Don't call this directly, call release() on your token.
debugPrint | ( | self, | |
message ) |
for debugging
delete | ( | self | ) |
force | ( | self, | |
name, | |||
value, | |||
inputSource ) |
Force isSet(name) to return 'value'. This returns a token; hold onto the token and call token.release() when you no longer want to force the state. Example:: # set up token = inputState.force('forward', True, inputSource='myForwardForcer') ... # tear down token.release()
getEventName | ( | self, | |
name ) |
isSet | ( | self, | |
name, | |||
inputSource = None ) |
returns True/False
releaseInputs | ( | self, | |
name ) |
set | ( | self, | |
name, | |||
isActive, | |||
inputSource = None ) |
watch | ( | self, | |
name, | |||
eventOn, | |||
eventOff, | |||
startState = False, | |||
inputSource = None ) |
This returns a token; hold onto the token and call token.release() when you no longer want to watch for these events. Example:: # set up token = inputState.watch('forward', 'w', 'w-up', inputSource=inputState.WASD) ... # tear down token.release()
watchWithModifiers | ( | self, | |
name, | |||
event, | |||
startState = False, | |||
inputSource = None ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
set |
|
static |
|
static |