# InputState

from direct.controls.InputState import InputState

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.

## Inheritance:

InputState:

## Methods of InputState:

__init__
debugPrint
delete
force
ignore
isSet
set
unforce
watch
watchWithModifiers

__init__ def __init__(self) Undocumented function.

debugPrint def debugPrint(self, message) for debugging

delete def delete(self) Undocumented function.

force def force(self, name, value) Force isSet(name) to return value. See Also: unforce()

ignore def ignore(self, name) The opposite of watch(name, ...) See Also: watch()

isSet def isSet(self, name) returns 0, 1

set def set(self, name, isSet) Undocumented function.

unforce def unforce(self, name) Stop forcing a value. See Also: force()

watch def watch(self, name, eventOn, eventOff, default=0) name is any string (or actually any valid dictionary key). eventOn is the string name of the Messenger event that will set the state (set to 1). eventOff is the string name of the Messenger event that will clear the state (set to 0). default is the initial value (this will be returned from isSet() if a call is made before any eventOn or eventOff events occur. See Also: ignore()

watchWithModifiers def watchWithModifiers(self, name, event, default=0) Undocumented function.