Open Inventor Reference
SoKeyboardEvent Class Reference

Keyboard key press and release events. More...

#include <Inventor/events/SoKeyboardEvent.h>

Inheritance diagram for SoKeyboardEvent:
SoButtonEvent SoEvent

Public Types

enum  Key {
  ANY = 0 , LEFT_SHIFT = 0xffe1 , RIGHT_SHIFT = 0xffe2 , LEFT_CONTROL = 0xffe3 ,
  RIGHT_CONTROL = 0xffe4 , LEFT_ALT = 0xffe9 , RIGHT_ALT = 0xffea , NUMBER_0 = 0x030 ,
  NUMBER_1 = 0x031 , NUMBER_2 = 0x032 , NUMBER_3 = 0x033 , NUMBER_4 = 0x034 ,
  NUMBER_5 = 0x035 , NUMBER_6 = 0x036 , NUMBER_7 = 0x037 , NUMBER_8 = 0x038 ,
  NUMBER_9 = 0x039 , A = 0x061 , B = 0x062 , C = 0x063 ,
  D = 0x064 , E = 0x065 , F = 0x066 , G = 0x067 ,
  H = 0x068 , I = 0x069 , J = 0x06a , K = 0x06b ,
  L = 0x06c , M = 0x06d , N = 0x06e , O = 0x06f ,
  P = 0x070 , Q = 0x071 , R = 0x072 , S = 0x073 ,
  T = 0x074 , U = 0x075 , V = 0x076 , W = 0x077 ,
  X = 0x078 , Y = 0x079 , Z = 0x07a , HOME = 0xff50 ,
  LEFT_ARROW = 0xff51 , UP_ARROW = 0xff52 , RIGHT_ARROW = 0xff53 , DOWN_ARROW = 0xff54 ,
  PAGE_UP = 0xff55 , PAGE_DOWN = 0xff56 , PRIOR = 0xff55 , NEXT = 0xff56 ,
  END = 0xff57 , PAD_ENTER = 0xff8d , PAD_F1 = 0xff91 , PAD_F2 = 0xff92 ,
  PAD_F3 = 0xff93 , PAD_F4 = 0xff94 , 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 = 0xffbf , F3 = 0xffc0 ,
  F4 = 0xffc1 , F5 = 0xffc2 , F6 = 0xffc3 , F7 = 0xffc4 ,
  F8 = 0xffc5 , F9 = 0xffc6 , F10 = 0xffc7 , F11 = 0xffc8 ,
  F12 = 0xffc9 , BACKSPACE = 0xff08 , TAB = 0xff09 , RETURN = 0xff0d ,
  ENTER = 0xff0d , PAUSE = 0xff13 , SCROLL_LOCK = 0xff14 , ESCAPE = 0xff1b ,
  KEY_DELETE = 0xffff , PRINT = 0xff61 , INSERT = 0xff63 , NUM_LOCK = 0xff7f ,
  CAPS_LOCK = 0xffe5 , SHIFT_LOCK = 0xffe6 , SPACE = 0x020 , EXCLAM = 0x021 ,
  QUOTEDBL = 0x022 , NUMBERSIGN = 0x023 , DOLLAR = 0x024 , PERCENT = 0x025 ,
  AMPERSAND = 0x026 , APOSTROPHE = 0x027 , PARENLEFT = 0x028 , PARENRIGHT = 0x029 ,
  ASTERISK = 0x02a , PLUS = 0x02b , COMMA = 0x02c , MINUS = 0x02d ,
  PERIOD = 0x02e , SLASH = 0x02f , COLON = 0x03a , SEMICOLON = 0x03b ,
  LESS = 0x03c , EQUAL = 0x03d , GREATER = 0x03e , QUESTION = 0x03f ,
  AT = 0x040 , BRACKETLEFT = 0x05b , BACKSLASH = 0x05c , BRACKETRIGHT = 0x05d ,
  ASCIICIRCUM = 0x05e , UNDERSCORE = 0x05f , GRAVE = 0x060 , BRACELEFT = 0x07b ,
  BAR = 0x07c , BRACERIGHT = 0x07d , ASCIITILDE = 0x07e
}
 the keyboard keys... More...
 
- Public Types inherited from SoButtonEvent
enum  State { UP , DOWN , UNKNOWN }
 
- Public Types inherited from SoEvent
enum  MouseButtonsMask {
  NO_MOUSEBUTTON_MASK = 0 , LEFT_MOUSEBUTTON_MASK = 1 , MIDDLE_MOUSEBUTTON_MASK = 2 , RIGHT_MOUSEBUTTON_MASK = 4 ,
  ALL_MOUSEBUTTONS_MASK = LEFT_MOUSEBUTTON_MASK + MIDDLE_MOUSEBUTTON_MASK + RIGHT_MOUSEBUTTON_MASK
}
 This describes the bit mask values of setButtonMask and getButtonMask. More...
 

Public Member Functions

 SoKeyboardEvent ()
 Constructor.
 
virtual ~SoKeyboardEvent ()
 
void setKey (SoKeyboardEvent::Key whichKey)
 set/get which key generated the event (e.g. SoKeyboardEvent::A)
 
SoKeyboardEvent::Key getKey () const
 
void setIsAutoRepeat (bool b)
 set auto-repeat flag; isAutoRepeat should be set for every auto-generated release/press pair, only the first press and the last release don't have it; MEVIS Inventor only
 
bool isAutoRepeat () const
 get auto-repeat flag (see notes for setIsAutoRepeat); MEVIS Inventor only
 
char getPrintableCharacter () const
 Convenience routine that returns the character representing the key, if it's printable.
 
- Public Member Functions inherited from SoButtonEvent
 SoButtonEvent ()
 Constructor.
 
virtual ~SoButtonEvent ()
 
void setState (SoButtonEvent::State s)
 get state of the button
 
SoButtonEvent::State getState () const
 
- Public Member Functions inherited from SoEvent
 SoEvent ()
 Constructor and destructor.
 
virtual ~SoEvent ()
 Constructor and destructor.
 
virtual SoType getTypeId () const
 Return the type id for this event instance.
 
bool isOfType (SoType type) const
 This returns TRUE if the event is an instance of or derived from an event of the passed type.
 
void setTime (SbTime t)
 Set the time at which the event occurred.
 
SbTime getTime () const
 Get the time at which the event occurred.
 
void setPosition (const SbVec2s &p)
 Set the window pixel location of the cursor when the event occurred.
 
const SbVec2sgetPosition () const
 Get position in pixel coodinates.
 
const SbVec2sgetPosition (const SbViewportRegion &vpRgn) const
 Get position relative to the specified viewport bounds.
 
const SbVec2fgetNormalizedPosition (const SbViewportRegion &vpRgn) const
 Get the normalized location of the cursor when the event occurred, relative to the specified viewport region.
 
void setShiftDown (bool isDown)
 Set whether the modifier keys were down when the event occurred.
 
void setCtrlDown (bool isDown)
 Set whether the modifier keys were down when the event occurred.
 
void setAltDown (bool isDown)
 Set whether the modifier keys were down when the event occurred.
 
bool wasShiftDown () const
 Get whether the modifier keys were down when the event occurred.
 
bool wasCtrlDown () const
 Get whether the modifier keys were down when the event occurred.
 
bool wasAltDown () const
 Get whether the modifier keys were down when the event occurred.
 
void setMouseButtonMask (int mask)
 Get which mouse buttons are currently pressed (as bit mask)
 
int getMouseButtonMask () const
 Set which mouse buttons are currently pressed.
 

Static Public Member Functions

static bool isKeyPressEvent (const SoEvent *e, SoKeyboardEvent::Key whichKey)
 convenience routines to see if an SoEvent is a press or release of the passed keyboard key
 
static bool isKeyReleaseEvent (const SoEvent *e, SoKeyboardEvent::Key whichKey)
 
static void initClass ()
 
- Static Public Member Functions inherited from SoButtonEvent
static void initClass ()
 
- Static Public Member Functions inherited from SoEvent
static SoType getClassTypeId ()
 Return the type id for the SoEvent class.
 
static void initClass ()
 Initializes base event class.
 
static void initClasses ()
 Initialize ALL Inventor event classes.
 

Detailed Description

SoKeyboardEvent represents keyboard key press and release events in the Inventor event model.

See Also
SoEvent, SoButtonEvent, SoLocation2Event, SoMotion3Event, SoMouseButtonEvent, SoSpaceballButtonEvent, SoHandleEventAction, SoEventCallback, SoSelection, SoInteraction

Definition at line 85 of file SoKeyboardEvent.h.

Member Enumeration Documentation

◆ Key

Enumerator
ANY 

Special constant for any key.

LEFT_SHIFT 

Modifiers.

RIGHT_SHIFT 
LEFT_CONTROL 
RIGHT_CONTROL 
LEFT_ALT 
RIGHT_ALT 
NUMBER_0 

Numbers.

NUMBER_1 
NUMBER_2 
NUMBER_3 
NUMBER_4 
NUMBER_5 
NUMBER_6 
NUMBER_7 
NUMBER_8 
NUMBER_9 

Letters.

HOME 

Cursor control & motion.

LEFT_ARROW 
UP_ARROW 
RIGHT_ARROW 
DOWN_ARROW 
PAGE_UP 
PAGE_DOWN 
PRIOR 
NEXT 
END 
PAD_ENTER 

Keypad Functions.

PAD_F1 
PAD_F2 
PAD_F3 
PAD_F4 
PAD_0 
PAD_1 
PAD_2 
PAD_3 
PAD_4 
PAD_5 
PAD_6 
PAD_7 
PAD_8 
PAD_9 
PAD_ADD 
PAD_SUBTRACT 
PAD_MULTIPLY 
PAD_DIVIDE 
PAD_SPACE 
PAD_TAB 
PAD_INSERT 
PAD_DELETE 
PAD_PERIOD 
F1 

Function keys.

F2 
F3 
F4 
F5 
F6 
F7 
F8 
F9 
F10 
F11 
F12 
BACKSPACE 

Misc Functions.

TAB 
RETURN 
ENTER 
PAUSE 
SCROLL_LOCK 
ESCAPE 
KEY_DELETE 
PRINT 
INSERT 
NUM_LOCK 
CAPS_LOCK 
SHIFT_LOCK 
SPACE 
EXCLAM 
QUOTEDBL 
NUMBERSIGN 
DOLLAR 
PERCENT 
AMPERSAND 
APOSTROPHE 
PARENLEFT 
PARENRIGHT 
ASTERISK 
PLUS 
COMMA 
MINUS 
PERIOD 
SLASH 
COLON 
SEMICOLON 
LESS 
EQUAL 
GREATER 
QUESTION 
AT 
BRACKETLEFT 
BACKSLASH 
BRACKETRIGHT 
ASCIICIRCUM 
UNDERSCORE 
GRAVE 
BRACELEFT 
BAR 
BRACERIGHT 
ASCIITILDE 

Definition at line 92 of file SoKeyboardEvent.h.

Constructor & Destructor Documentation

◆ SoKeyboardEvent()

SoKeyboardEvent::SoKeyboardEvent ( )

◆ ~SoKeyboardEvent()

virtual SoKeyboardEvent::~SoKeyboardEvent ( )
virtual

Member Function Documentation

◆ getKey()

SoKeyboardEvent::Key SoKeyboardEvent::getKey ( ) const
inline

Definition at line 274 of file SoKeyboardEvent.h.

◆ getPrintableCharacter()

char SoKeyboardEvent::getPrintableCharacter ( ) const

If not, this returns NULL ('\0').

◆ initClass()

static void SoKeyboardEvent::initClass ( )
static

◆ isAutoRepeat()

bool SoKeyboardEvent::isAutoRepeat ( ) const
inline

Definition at line 281 of file SoKeyboardEvent.h.

◆ isKeyPressEvent()

static bool SoKeyboardEvent::isKeyPressEvent ( const SoEvent e,
SoKeyboardEvent::Key  whichKey 
)
static

◆ isKeyReleaseEvent()

static bool SoKeyboardEvent::isKeyReleaseEvent ( const SoEvent e,
SoKeyboardEvent::Key  whichKey 
)
static

◆ setIsAutoRepeat()

void SoKeyboardEvent::setIsAutoRepeat ( bool  b)
inline

Definition at line 278 of file SoKeyboardEvent.h.

◆ setKey()

void SoKeyboardEvent::setKey ( SoKeyboardEvent::Key  whichKey)
inline

Definition at line 273 of file SoKeyboardEvent.h.


The documentation for this class was generated from the following file: