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 get_class_type() TypeHandle
get_mapped_button(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.

get_mapped_button(i: int) ButtonHandle

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

get_mapped_button(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.

get_mapped_button_label(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.

get_mapped_button_label(i: int) str

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

get_mapped_button_label(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.

get_num_buttons() int

Returns the number of buttons that this button mapping specifies.

get_raw_button(i: int) ButtonHandle

Returns the underlying raw button associated with the nth button.

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