ButtonMap¶
-
class
ButtonMap
¶ 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
-
ButtonMap
(void) = default¶
-
static TypeHandle
get_class_type
(void)¶
Returns the nth mapped button, meaning the button that the nth raw button is mapped to.
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.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.
Returns the label associated with the nth mapped button, meaning the button that the nth raw button is mapped to.
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.
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.
Returns the number of buttons that this button mapping specifies.
Returns the underlying raw button associated with the nth button.
-
void
output
(std::ostream &out) const¶
-
void
write
(std::ostream &out, int indent_level = 0) const¶
-