ModifierButtons

from panda3d.core import ModifierButtons
class ModifierButtons

Bases: DTOOL_SUPER_BASE

This class monitors the state of a number of individual buttons and tracks whether each button is known to be down or up.

Inheritance diagram

Inheritance diagram of ModifierButtons

__init__(*args, **kwargs)
addButton()

C++ Interface: add_button(const ModifierButtons self, ButtonHandle button)

/**
  • Adds the indicated button to the set of buttons that will be monitored for

  • upness and downness. Returns true if the button was added, false if it was

  • already being monitored or if too many buttons are currently being

  • monitored.

*/

add_button()

C++ Interface: add_button(const ModifierButtons self, ButtonHandle button)

/**
  • Adds the indicated button to the set of buttons that will be monitored for

  • upness and downness. Returns true if the button was added, false if it was

  • already being monitored or if too many buttons are currently being

  • monitored.

*/

allButtonsUp()

C++ Interface: all_buttons_up(const ModifierButtons self)

/**
  • Marks all monitored buttons as being in the “up” state.

*/

all_buttons_up()

C++ Interface: all_buttons_up(const ModifierButtons self)

/**
  • Marks all monitored buttons as being in the “up” state.

*/

assign()

C++ Interface: assign(const ModifierButtons self, const ModifierButtons copy)

buttonDown()

C++ Interface: button_down(const ModifierButtons self, ButtonHandle button)

/**
  • Records that a particular button has been pressed. If the given button is

  • one of the buttons that is currently being monitored, this will update the

  • internal state appropriately; otherwise, it will do nothing. Returns true

  • if the button is one that was monitored, or false otherwise.

*/

buttonUp()

C++ Interface: button_up(const ModifierButtons self, ButtonHandle button)

/**
  • Records that a particular button has been released. If the given button is

  • one of the buttons that is currently being monitored, this will update the

  • internal state appropriately; otherwise, it will do nothing. Returns true

  • if the button is one that was monitored, or false otherwise.

*/

button_down()

C++ Interface: button_down(const ModifierButtons self, ButtonHandle button)

/**
  • Records that a particular button has been pressed. If the given button is

  • one of the buttons that is currently being monitored, this will update the

  • internal state appropriately; otherwise, it will do nothing. Returns true

  • if the button is one that was monitored, or false otherwise.

*/

button_up()

C++ Interface: button_up(const ModifierButtons self, ButtonHandle button)

/**
  • Records that a particular button has been released. If the given button is

  • one of the buttons that is currently being monitored, this will update the

  • internal state appropriately; otherwise, it will do nothing. Returns true

  • if the button is one that was monitored, or false otherwise.

*/

buttons
getButton()

C++ Interface: get_button(ModifierButtons self, int index)

/**
  • Returns the nth button that the ModifierButtons object is monitoring (the

  • nth button passed to add_button()). This must be in the range 0 <= index <

  • get_num_buttons().

*/

getButtons()
getNumButtons()

C++ Interface: get_num_buttons(ModifierButtons self)

/**
  • Returns the number of buttons that the ModifierButtons object is monitoring

  • (e.g. the number of buttons passed to add_button()).

*/

getPrefix()

C++ Interface: get_prefix(ModifierButtons self)

/**
  • Returns a string which can be used to prefix any button name or event name

  • with the unique set of modifier buttons currently being held.

*/

get_button()

C++ Interface: get_button(ModifierButtons self, int index)

/**
  • Returns the nth button that the ModifierButtons object is monitoring (the

  • nth button passed to add_button()). This must be in the range 0 <= index <

  • get_num_buttons().

*/

get_buttons()
get_num_buttons()

C++ Interface: get_num_buttons(ModifierButtons self)

/**
  • Returns the number of buttons that the ModifierButtons object is monitoring

  • (e.g. the number of buttons passed to add_button()).

*/

get_prefix()

C++ Interface: get_prefix(ModifierButtons self)

/**
  • Returns a string which can be used to prefix any button name or event name

  • with the unique set of modifier buttons currently being held.

*/

hasButton()

C++ Interface: has_button(ModifierButtons self, ButtonHandle button)

/**
  • Returns true if the indicated button is in the set of buttons being

  • monitored, false otherwise.

*/

has_button()

C++ Interface: has_button(ModifierButtons self, ButtonHandle button)

/**
  • Returns true if the indicated button is in the set of buttons being

  • monitored, false otherwise.

*/

isAnyDown()

C++ Interface: is_any_down(ModifierButtons self)

/**
  • Returns true if any of the tracked button are known to be down, or false if

  • all of them are up.

*/

isDown()

C++ Interface: is_down(ModifierButtons self, ButtonHandle button) is_down(ModifierButtons self, int index)

/**
  • Returns true if the indicated button is known to be down, or false if it is

  • known to be up.

*/

/**
  • Returns true if the indicated button is known to be down, or false if it is

  • known to be up or if it is not in the set of buttons being tracked.

*/

is_any_down()

C++ Interface: is_any_down(ModifierButtons self)

/**
  • Returns true if any of the tracked button are known to be down, or false if

  • all of them are up.

*/

is_down()

C++ Interface: is_down(ModifierButtons self, ButtonHandle button) is_down(ModifierButtons self, int index)

/**
  • Returns true if the indicated button is known to be down, or false if it is

  • known to be up.

*/

/**
  • Returns true if the indicated button is known to be down, or false if it is

  • known to be up or if it is not in the set of buttons being tracked.

*/

matches()

C++ Interface: matches(ModifierButtons self, const ModifierButtons other)

/**
  • Returns true if the set of buttons indicated as down by this

  • ModifierButtons object is the same set of buttons indicated as down by the

  • other ModifierButtons object. The buttons indicated as up are not

  • relevant.

*/

output()

C++ Interface: output(ModifierButtons self, ostream out)

/**
  • Writes a one-line summary of the buttons known to be down.

*/

removeButton()

C++ Interface: remove_button(const ModifierButtons self, ButtonHandle button)

/**
  • Removes the indicated button from the set of buttons being monitored.

  • Returns true if the button was removed, false if it was not being monitored

  • in the first place.

  • Unlike the other methods, you cannot remove a button by removing its alias;

  • you have to remove exactly the button itself.

*/

remove_button()

C++ Interface: remove_button(const ModifierButtons self, ButtonHandle button)

/**
  • Removes the indicated button from the set of buttons being monitored.

  • Returns true if the button was removed, false if it was not being monitored

  • in the first place.

  • Unlike the other methods, you cannot remove a button by removing its alias;

  • you have to remove exactly the button itself.

*/

setButtonList()

C++ Interface: set_button_list(const ModifierButtons self, const ModifierButtons other)

/**
  • Sets the list of buttons to watch to be the same as that of the other

  • ModifierButtons object. This makes the lists pointer equivalent (until one

  • or the other is later modified).

  • This will preserve the state of any button that was on the original list

  • and is also on the new lists. Any other buttons will get reset to the

  • default state of “up”.

*/

set_button_list()

C++ Interface: set_button_list(const ModifierButtons self, const ModifierButtons other)

/**
  • Sets the list of buttons to watch to be the same as that of the other

  • ModifierButtons object. This makes the lists pointer equivalent (until one

  • or the other is later modified).

  • This will preserve the state of any button that was on the original list

  • and is also on the new lists. Any other buttons will get reset to the

  • default state of “up”.

*/

write()

C++ Interface: write(ModifierButtons self, ostream out)

/**
  • Writes a multi-line summary including all of the buttons being monitored

  • and which ones are known to be down.

*/