SoKeyboardEvent(3)
πΈ SoKeyboardEvent(3) β the Coin manual page, but make it cute π
okay bestie, pull up a chair, we're learning about SoKeyboardEvent from the Coin manual (section 3, iykyk). it's the class that knows everything about keyboard interaction. slay.
β¨ NAME β¨
SoKeyboardEvent β the class that holds all the tea about keyboard interaction. like, when you press a key, this is the girl who knows about it. π
π¦ SYNOPSIS π¦
#include <Inventor/events/SoKeyboardEvent.h>
Inherits SoButtonEvent. and yes, the family tree goes all the way down, we love a legacy. π
π Public Types π
enum Key
enum Key { ANY = 0, UNDEFINED = 1, LEFT_SHIFT = 0xffe1, RIGHT_SHIFT,
LEFT_CONTROL, RIGHT_CONTROL, LEFT_ALT = 0xffe9, RIGHT_ALT, NUMBER_0
= 0x0030, NUMBER_1, NUMBER_2, NUMBER_3, NUMBER_4, NUMBER_5,
NUMBER_6, NUMBER_7, NUMBER_8, NUMBER_9, A = 0x0061, B, C, D, E, F,
G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, HOME =
0xff50, LEFT_ARROW, UP_ARROW, RIGHT_ARROW, DOWN_ARROW, PAGE_UP,
PAGE_DOWN, END, PRIOR = 0xff55, NEXT, PAD_ENTER = 0xff8d, PAD_F1 =
0xff91, PAD_F2, PAD_F3, PAD_F4, PAD_0 = 0xff9e, PAD_1 = 0xff9c,
PAD_2 = 0xff99, PAD_3 = 0xff9b, PAD_4 = 0xff96, PAD_5 = 0xff9d,
PAD_6 = 0xff98, PAD_7 = 0xff95, PAD_8 = 0xff97, PAD_9 = 0xff9a,
PAD_ADD = 0xffab, PAD_SUBTRACT = 0xffad, PAD_MULTIPLY = 0xffaa,
PAD_DIVIDE = 0xffaf, PAD_SPACE = 0xff8d, PAD_TAB = 0xff89,
PAD_INSERT = 0xff9e, PAD_DELETE = 0xff9f, PAD_PERIOD = 0xff9f, F1 =
0xffbe, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, BACKSPACE =
0xff08, TAB = 0xff09, RETURN = 0xff0d, ENTER = 0xff0d, PAUSE =
0xff13, SCROLL_LOCK = 0xff14, ESCAPE = 0xff1b, DELETE = 0xffff,
KEY_DELETE = DELETE, PRINT = 0xff61, INSERT = 0xff63, NUM_LOCK =
0xff7f, CAPS_LOCK = 0xffe5, SHIFT_LOCK = 0xffe6, SPACE = 0x0020,
APOSTROPHE = 0x0027, COMMA = 0x002c, MINUS = 0x002d, PERIOD =
0x002e, SLASH = 0x002f, SEMICOLON = 0x003b, EQUAL = 0x003d,
BRACKETLEFT = 0x005b, BACKSLASH = 0x005c, BRACKETRIGHT = 0x005d,
GRAVE = 0x0060 }
π§ Public Types inherited from SoButtonEvent
enum State { UP, DOWN, UNKNOWN }
π Public Member Functions π
virtual SoType getTypeId (void) constSoKeyboardEvent (void)virtual ~SoKeyboardEvent ()void setKey (Key key)Key getKey (void) constvoid setPrintableCharacter (const char c)char getPrintableCharacter (void) const
πΈ Public Member Functions inherited from SoButtonEvent
SoButtonEvent (void)virtual ~SoButtonEvent ()void setState (State state)State getState (void) const
π Public Member Functions inherited from SoEvent
SoEvent (void)virtual ~SoEvent ()SbBool isOfType (SoType type) constvoid setTime (const SbTime t)SbTime getTime (void) constvoid setPosition (const SbVec2s &p)const SbVec2s & getPosition (void) constconst SbVec2s & getPosition (const SbViewportRegion &vpRgn) constconst SbVec2f & getNormalizedPosition (const SbViewportRegion &vpRgn) constvoid setShiftDown (SbBool isDown)SbBool wasShiftDown (void) constvoid setCtrlDown (SbBool isDown)SbBool wasCtrlDown (void) constvoid setAltDown (SbBool isDown)SbBool wasAltDown (void) const
β Static Public Member Functions β
static SoType getClassTypeId (void)static void initClass (void)static SbBool isKeyPressEvent (const SoEvent *e, Key whichKey)static SbBool isKeyReleaseEvent (const SoEvent *e, Key whichKey)static SbBool enumToString (Key enumval, SbString &stringrep)
π« Static Public Member Functions inherited from SoButtonEvent
static SoType getClassTypeId (void)static void initClass (void)static SbBool enumToString (State enumval, SbString &stringrep)
π« Static Public Member Functions inherited from SoEvent
static SoType getClassTypeId (void)static void initClass (void)
π₯ Detailed Description π₯
okay so, the SoKeyboardEvent class contains information about keyboard interaction. no cap. π«Ά
when the user presses any keys on the keyboard, these will be translated from a system specific event into a Coin event and sent to the scene graph by using instances of this class. it's giving translator. it's giving middleman. it's giving main character energy for your keystrokes. β¨
π See also
SoEvent,SoButtonEvent,SoMouseButtonEvent,SoSpaceballButtonEventSoEventCallback,SoHandleEventAction
π§ Member Enumeration Documentation π§
π enum SoKeyboardEvent::Key
This enum contains all keys detected by Coin. every single one. we stan an exhaustive list. π
π Constructor & Destructor Documentation π
SoKeyboardEvent::SoKeyboardEvent (void )
Constructor. she's born. πΈ
SoKeyboardEvent::~SoKeyboardEvent () [virtual]
Destructor. she's leaving, but make it iconic. π
π Member Function Documentation π
SoType SoKeyboardEvent::getClassTypeId (void ) [static]
This static method returns the SoType object associated with objects of this class. it's the class's little ID card. πͺͺ
SoType SoKeyboardEvent::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. ngl, this is the "wait, who are you actually" of the Coin world. π
Reimplemented from SoButtonEvent.
void SoKeyboardEvent::initClass (void ) [static]
Initialize the type information data. do this before you use the class, bestie, or it's gonna be awkward. π
void SoKeyboardEvent::setKey (SoKeyboardEvent::Key keyarg)
Set the value of the key which the user interacted with.
This method is used from the window specific device classes when translating events to the generic Coin library. so like, this is the girl translating for the group chat. π£οΈ
See also
getKey()
SoKeyboardEvent::Key SoKeyboardEvent::getKey (void ) const
Returns the value of the key which was pressed or released.
Coin adds a new key value called UNDEFINED. This is needed to support GUI toolkits where it is not possible to find exactly which key is pressed, and/or to support non-US keyboards. The Open Inventor design for this class is flawed, since it assumes everybody uses a US keyboard. π (not the design flaw π) We recommend using getPrintableCharacter() to find which key is pressed/released, at least for printable non-alphanumerical characters.
fr fr, this one's a known flaw β don't come for Coin, come for the original Open Inventor design. π«
See also
getPrintableCharacter(), getState()
wasShiftDown(), wasCtrlDown(), wasAltDown(), getPosition(), getTime()
void SoKeyboardEvent::setPrintableCharacter (const char c)
Sets the printable character for this keyboard event. If this method is not called when creating an event, getPrintableCharacter() will convert the SoKeyboardEvent::Key value into a printable character. This conversion does not work on non-US keyboards, so we recommend that you set the printable character using this method instead.
This printable character is cleared each time setKey() is called.
This method is an extension versus the Open Inventor API. β¨ (Coin said "we can do it better" and honestly? ate.)
See also
getPrintableCharacter()
char SoKeyboardEvent::getPrintableCharacter (void ) const
Return ASCII value which would be generated by the key and modifier combination.
NB! IfsetPrintableCharacter()hasn't been called, this function does not always work as expected, particularly not on non-US keyboards. The Coin GUI toolkits (SoGtk/SoQt/SoWin/SoXt/Sc21) will set the printable character correctly. π the toolkits got your back, bestie.
See also
getKey(), wasShiftDown(), wasCtrlDown(), wasAltDown(), setPrintableCharacter()
SbBool SoKeyboardEvent::isKeyPressEvent (const SoEvent * e, SoKeyboardEvent::Key whichKey) [static]
Convenience method for quickly checking if the given event is a key press on the given key, whichKey. it's the vibe check for keystrokes. β
See also
isKeyReleaseEvent(), isOfType(), getKey(), getState()
SbBool SoKeyboardEvent::isKeyReleaseEvent (const SoEvent * e, SoKeyboardEvent::Key whichKey) [static]
Convenience method for quickly checking if the given event is a key release of the given key, whichKey. same energy, opposite direction. π¦
See also
isKeyPressEvent(), isOfType(), getKey(), getState()
SbBool SoKeyboardEvent::enumToString (Key enumval, SbString & stringrep) [static]
Converts from an enum value of type SoKeyboardEvent::State to a string containing the enum symbol.
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
Since
Coin 3.0
π Author π
Generated automatically by Doxygen for Coin from the source code. (yes, a robot wrote it. and it's still serving looks. π β¨)
π the cute sign-off π
so that's the whole page, bestie. this one came from Coin version 4.0.10, dated Thu Jun 25 2026 00:00:00, and it lives at SoKeyboardEvent(3). periodt. πππΈβ¨
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms