SoButtonEvent(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– NAME πŸ’–

SoButtonEvent β€” it's giving "the base class for all button events," and honestly? Mother. This is from the Coin manual, and she's iconic. πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/events/SoButtonEvent.h>

Bestie, real quick, the family tree: this class Inherits SoEvent. And Inherited by SoKeyboardEvent, SoMouseButtonEvent, and SoSpaceballButtonEvent β€” yeah, she's got kids. πŸ‘‘

πŸŽ€ Public Types πŸŽ€

  • enum State { UP, DOWN, UNKNOWN } β€” the three moods of a button, no cap.

🫢 Public Member Functions 🫢

  • virtual SoType getTypeId (void) const β€” tells you what type this actually is at runtime.
  • SoButtonEvent (void) β€” constructor, hello.
  • virtual ~SoButtonEvent () β€” destructor, bye.
  • void setState (State state) β€” set the state, slay.
  • State getState (void) const β€” read the state back out.

Public Member Functions inherited from SoEvent

  • SoEvent (void)
  • virtual ~SoEvent ()
  • SbBool isOfType (SoType type) const
  • void setTime (const SbTime t)
  • SbTime getTime (void) const
  • void setPosition (const SbVec2s &p)
  • const SbVec2s & getPosition (void) const
  • const SbVec2s & getPosition (const SbViewportRegion &vpRgn) const
  • const SbVec2f & getNormalizedPosition (const SbViewportRegion &vpRgn) const
  • void setShiftDown (SbBool isDown)
  • SbBool wasShiftDown (void) const
  • void setCtrlDown (SbBool isDown)
  • SbBool wasCtrlDown (void) const
  • void setAltDown (SbBool isDown)
  • SbBool wasAltDown (void) const

πŸ’œ Static Public Member Functions πŸ’œ

  • static SoType getClassTypeId (void) β€” the class-level type id, periodt.
  • static void initClass (void) β€” sets everything up.
  • static SbBool enumToString (State enumval, SbString &stringrep) β€” enum to string, so handy.

Static Public Member Functions inherited from SoEvent

  • static SoType getClassTypeId (void)
  • static void initClass (void)

🌸 Detailed Description 🌸

So like, the SoButtonEvent class is the base class for all button events. That's the whole vibe.

Every event class that pops off when a user pushes buttons on some device β€” keyboard, mouse, or spaceball β€” inherits from this one. So if you're picturing the family reunion, they're all there. 🧚 The SoButtonEvent class is the one holding the methods for setting and getting the state of the button(s).

See also

  • SoEvent, SoKeyboardEvent, SoMouseButtonEvent, SoSpaceballButtonEvent
  • SoEventCallback, SoHandleEventAction

πŸ¦‹ Member Enumeration Documentation πŸ¦‹

enum SoButtonEvent::State

This is literally the actual state of the button. Like, what is she doing right now. πŸ™ˆ

  • UP β€” Button has been released. She's free, she's at peace. πŸ•ŠοΈ
  • DOWN β€” Button has been pressed down. Committed. Pressed. Down. πŸ’…
  • UNKNOWN β€” The state of the button is unknown. We do not know her. πŸ€·β€β™€οΈ

🌈 Constructor & Destructor Documentation 🌈

SoButtonEvent::SoButtonEvent (void )

Constructor. Baby's first button event. πŸŽ€

SoButtonEvent::~SoButtonEvent () [virtual]

Destructor. She's leaving the group chat. 😭


⭐ Member Function Documentation ⭐

SoType SoButtonEvent::getClassTypeId (void ) [static]

This static method returns the SoType object associated with objects of this class. No cap.

SoType SoButtonEvent::getTypeId (void ) const [virtual]

Returns the type identification of an object derived from a class inheriting SoEvent. This is used for runtime type checking and "downward" casting. Bestie, it's the vibe check for types. πŸ‘‘

Reimplemented from SoEvent.

Reimplemented in SoKeyboardEvent, SoMouseButtonEvent, and SoSpaceballButtonEvent.

void SoButtonEvent::initClass (void ) [static]

Initialize the type information data. Just do it, fr fr. ✨

void SoButtonEvent::setState (SoButtonEvent::State state)

Set the state of the button which the user interacted with.

This method is used from the window specific device classes when translating events to the generic Coin library. So it's the translator of the whole operation, lowkey essential.

See also

  • getState()

SoButtonEvent::State SoButtonEvent::getState (void ) const

Returns the state of the button which is the cause of the event, i.e. whether it was pushed down or released. She's the one who did this. πŸ”₯

See also

  • wasShiftDown(), wasCtrlDown(), wasAltDown(), getPosition(), getTime()

SbBool SoButtonEvent::enumToString (State enumval, SbString & stringrep) [static]

Converts from an enum value of type SoButtonEvent::State to a string containing the enum symbol. Translating enum energy into text energy, we love to see it. 🫢

This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.

Heads up bestie β€” this one is Coin-only. The original SGI Open Inventor v2.1 API does not have it. Don't go looking for it there. πŸ’€

Since

  • Coin 3.0

πŸ’Œ Author πŸ’Œ

Generated automatically by Doxygen for Coin from the source code. Not a human author, just a very productive robot. πŸ€–πŸ’–


Okay so that's the whole page, and here's the cute lil sign-off: this is Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and it lives in the manual as SoButtonEvent(3). Byeee, go press some buttons. πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from