SOKEYBOARDEVENT(3iv)
π SoKeyboardEvent β like, the whole manual, but make it make sense π
okay bestie, welcome to SoKeyboardEvent(3IV) β yes that's the manual name, it's giving very "openInventor era" and honestly? iconic. This is the page all about keyboard key press and release events. Keys go down, keys come up, we vibe. Let's get into it πΉβ¨
πΈ INHERITS FROM πΈ
the family tree, and yes it's a whole lineage:
SoEvent > SoButtonEvent > SoKeyboardEvent
so like, everything your ancestors can do? you can do too. nepotism but make it C++ π
β¨ SYNOPSIS β¨
First things first, the include. yes you need it, no you can't skip it:
#include <Inventor/events/SoKeyboardEvent.h>
then these two macros, which are basically the "is this even happening" checks:
#define SO_KEY_PRESS_EVENT(EVENT,KEY)
(SoKeyboardEvent::isKeyPressEvent(EVENT,SoKeyboardEvent::KEY))
#define SO_KEY_RELEASE_EVENT(EVENT,KEY)
(SoKeyboardEvent::isKeyReleaseEvent(EVENT,SoKeyboardEvent::KEY))
look at them. they expand into the static checker calls. adorable. no cap π«Ά
π enum Key β the big list, and yes we're doing all of them π
β Special
SoKeyboardEvent::ANYβ the wildcard bestie. special constant for any key π
π Modifiers β the "hold me while I click" girlies
SoKeyboardEvent::LEFT_SHIFTSoKeyboardEvent::RIGHT_SHIFTSoKeyboardEvent::LEFT_CONTROLSoKeyboardEvent::RIGHT_CONTROLSoKeyboardEvent::LEFT_ALTSoKeyboardEvent::RIGHT_ALT
π’ Numbers β 0 through 9, all present and accounted for
SoKeyboardEvent::NUMBER_0SoKeyboardEvent::NUMBER_1SoKeyboardEvent::NUMBER_2SoKeyboardEvent::NUMBER_3SoKeyboardEvent::NUMBER_4SoKeyboardEvent::NUMBER_5SoKeyboardEvent::NUMBER_6SoKeyboardEvent::NUMBER_7SoKeyboardEvent::NUMBER_8SoKeyboardEvent::NUMBER_9
π¦ Letters β the whole alphabet, no skips
SoKeyboardEvent::ASoKeyboardEvent::BSoKeyboardEvent::CSoKeyboardEvent::DSoKeyboardEvent::ESoKeyboardEvent::FSoKeyboardEvent::GSoKeyboardEvent::HSoKeyboardEvent::ISoKeyboardEvent::JSoKeyboardEvent::KSoKeyboardEvent::LSoKeyboardEvent::MSoKeyboardEvent::NSoKeyboardEvent::OSoKeyboardEvent::PSoKeyboardEvent::QSoKeyboardEvent::RSoKeyboardEvent::SSoKeyboardEvent::TSoKeyboardEvent::USoKeyboardEvent::VSoKeyboardEvent::WSoKeyboardEvent::XSoKeyboardEvent::YSoKeyboardEvent::Z
π§ Cursor control and motion β moving around, main character energy
SoKeyboardEvent::HOMESoKeyboardEvent::LEFT_ARROWSoKeyboardEvent::UP_ARROWSoKeyboardEvent::RIGHT_ARROWSoKeyboardEvent::DOWN_ARROWSoKeyboardEvent::PAGE_UPSoKeyboardEvent::PAGE_DOWNSoKeyboardEvent::PRIORSoKeyboardEvent::NEXTSoKeyboardEvent::END
πΉ Keypad functions β the numpad girlies, underrated fr fr
SoKeyboardEvent::PAD_ENTERSoKeyboardEvent::PAD_F1SoKeyboardEvent::PAD_F2SoKeyboardEvent::PAD_F3SoKeyboardEvent::PAD_F4SoKeyboardEvent::PAD_0SoKeyboardEvent::PAD_1SoKeyboardEvent::PAD_2SoKeyboardEvent::PAD_3SoKeyboardEvent::PAD_4SoKeyboardEvent::PAD_5SoKeyboardEvent::PAD_6SoKeyboardEvent::PAD_7SoKeyboardEvent::PAD_8SoKeyboardEvent::PAD_9SoKeyboardEvent::PAD_ADDSoKeyboardEvent::PAD_SUBTRACTSoKeyboardEvent::PAD_MULTIPLYSoKeyboardEvent::PAD_DIVIDESoKeyboardEvent::PAD_SPACESoKeyboardEvent::PAD_TABSoKeyboardEvent::PAD_INSERTSoKeyboardEvent::PAD_DELETESoKeyboardEvent::PAD_PERIOD
π₯ Function keys β F1 through F12, the full dozen
SoKeyboardEvent::F1SoKeyboardEvent::F2SoKeyboardEvent::F3SoKeyboardEvent::F4SoKeyboardEvent::F5SoKeyboardEvent::F6SoKeyboardEvent::F7SoKeyboardEvent::F8SoKeyboardEvent::F9SoKeyboardEvent::F10SoKeyboardEvent::F11SoKeyboardEvent::F12
π Miscellaneous β the grab bag, the everything drawer
SoKeyboardEvent::BACKSPACESoKeyboardEvent::TABSoKeyboardEvent::RETURNSoKeyboardEvent::ENTERSoKeyboardEvent::PAUSESoKeyboardEvent::SCROLL_LOCKSoKeyboardEvent::ESCAPESoKeyboardEvent::DELETESoKeyboardEvent::PRINTSoKeyboardEvent::INSERTSoKeyboardEvent::NUM_LOCKSoKeyboardEvent::CAPS_LOCKSoKeyboardEvent::SHIFT_LOCKSoKeyboardEvent::SPACESoKeyboardEvent::APOSTROPHESoKeyboardEvent::COMMASoKeyboardEvent::MINUSSoKeyboardEvent::PERIODSoKeyboardEvent::SLASHSoKeyboardEvent::SEMICOLONSoKeyboardEvent::EQUALSoKeyboardEvent::BRACKETLEFTSoKeyboardEvent::BACKSLASHSoKeyboardEvent::BRACKETRIGHTSoKeyboardEvent::GRAVE
π«Ά Methods from class SoKeyboardEvent
SoKeyboardEvent()
static SoType getClassTypeId()
void setKey(SoKeyboardEvent::Key whichKey)
SoKeyboardEvent::Key getKey() const
static SbBool isKeyPressEvent(const SoEvent *e,
SoKeyboardEvent::Key whichKey)
static SbBool isKeyReleaseEvent(const SoEvent *e,
SoKeyboardEvent::Key whichKey)
char getPrintableCharacter() const
π Methods from class SoButtonEvent β inherited, we love an heirloom
void setState(SoButtonEvent::State s)
SoButtonEvent::State getState() const
π Methods from class SoEvent β the OG ancestor, grandparent energy
virtual SoType getTypeId() const
SbBool isOfType(SoType type) const
void setTime(SbTime t)
SbTime getTime() const
void setPosition(const SbVec2s &p)
const SbVec2s & getPosition() const
const SbVec2s & getPosition(const SbViewportRegion &vpRgn) const
const SbVec2f & getNormalizedPosition(const SbViewportRegion &vpRgn)
const
void setShiftDown(SbBool isDown)
void setCtrlDown(SbBool isDown)
void setAltDown(SbBool isDown)
SbBool wasShiftDown() const
SbBool wasCtrlDown() const
SbBool wasAltDown() const
π DESCRIPTION π
So like, here's the whole point: SoKeyboardEvent represents keyboard key press and release events in the Inventor event model.
that's it. that's the description. short and slay π
π METHODS π β okay now the actual details, pay attention bestie
SoKeyboardEvent()β the constructor. it makes the thing. congrats you have an event πstatic SoType getClassTypeId()β returns the type id for theSoKeyboardEventclass. it's the class's little ID card β¨void setKey(SoKeyboardEvent::Key whichKey)SoKeyboardEvent::Key getKey() const
β set and get which key generated the event. one direction writes it, the other reads it. matching set, we love a duo π«Ά
static SbBool isKeyPressEvent(const SoEvent *e, SoKeyboardEvent::Key whichKey)static SbBool isKeyReleaseEvent(const SoEvent *e, SoKeyboardEvent::Key whichKey)
β returns whether the passed event is a keyboard press or release event of the passed key. and here's the plot twist: when you pass SoKeyboardEvent::ANY, this returns TRUE if the event represents a keyboard press or release of any key. so ANY = "idc which key, just tell me if something happened" π
char getPrintableCharacter() const
β a lil convenience routine that returns the character representing the key, if it's printable. and if it's not printable? it returns NULL ('\0'). so check before you trust it bestie π
π§ SEE ALSO π§
the whole friend group, go read them too:
SoEventSoButtonEventSoLocation2EventSoMotion3EventSoMouseButtonEventSoSpaceballButtonEventSoHandleEventActionSoEventCallbackSoSelectionSoInteractionSoXtDevice
and that's the page, babe. this was the SoKeyboardEvent(3IV) manual β and ngl the footer field was literally just the name again with some empty parens, so no version, no date, nothing. iconic of it. anyway ily, go handle some events responsibly β¨ππ
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms