ButtonMap

from panda3d.core import ButtonMap
class ButtonMap

Bases:

Bases: TypedReferenceCount

This class represents a map containing all of the buttons of a (keyboard) device, though it can also be used as a generic mapping between ButtonHandles. It maps an underlying ‘raw’ button to a ‘virtual’ button, which may optionally be associated with an appropriate platform-specific name for the button.

Inheritance diagram

Inheritance diagram of ButtonMap

__init__()
__init__(param0: ButtonMap)
static getClassType() TypeHandle
getMappedButton(raw: ButtonHandle) ButtonHandle

Returns the button that the given button is mapped to, or ButtonHandle.none() if this map does not specify a mapped button for the given raw button.

getMappedButton(i: int) ButtonHandle

Returns the nth mapped button, meaning the button that the nth raw button is mapped to.

getMappedButton(raw_name: str) ButtonHandle

Returns the button that the given button is mapped to, or ButtonHandle.none() if this map does not specify a mapped button for the given raw button.

getMappedButtonLabel(raw: ButtonHandle) str

If the button map specifies a special name for the button (eg. if the operating system or keyboard device has a localized name describing the key), returns it, or the empty string otherwise.

Note that this is not the same as get_mapped_button().get_name(), which returns the name of the Panda event associated with the button.

getMappedButtonLabel(i: int) str

Returns the label associated with the nth mapped button, meaning the button that the nth raw button is mapped to.

getMappedButtonLabel(raw_name: str) str

If the button map specifies a special name for the button (eg. if the operating system or keyboard device has a localized name describing the key), returns it, or the empty string otherwise.

Note that this is not the same as get_mapped_button().get_name(), which returns the name of the Panda event associated with the button.

getNumButtons() int

Returns the number of buttons that this button mapping specifies.

getRawButton(i: int) ButtonHandle

Returns the underlying raw button associated with the nth button.

output(out: ostream)
write(out: ostream, indent_level: int)