SoKeyboardEvent(3IV)

NAME
SoKeyboardEvent — keyboard key press and release events

INHERITS FROM
SoEvent > SoButtonEvent > SoKeyboardEvent

SYNOPSIS
#include <Inventor/events/SoKeyboardEvent.h>

#define SO_KEY_PRESS_EVENT(EVENT,KEY)
      (SoKeyboardEvent::isKeyPressEvent(EVENT,SoKeyboardEvent::KEY))
#define SO_KEY_RELEASE_EVENT(EVENT,KEY)
      (SoKeyboardEvent::isKeyReleaseEvent(EVENT,SoKeyboardEvent::KEY))

enum Key {
SoKeyboardEvent::ANY
Special constant for any key
SoKeyboardEvent::LEFT_SHIFT
Modifiers
SoKeyboardEvent::RIGHT_SHIFT

SoKeyboardEvent::LEFT_CONTROL

SoKeyboardEvent::RIGHT_CONTROL

SoKeyboardEvent::LEFT_ALT

SoKeyboardEvent::RIGHT_ALT

SoKeyboardEvent::NUMBER_0
Numbers
SoKeyboardEvent::NUMBER_1

SoKeyboardEvent::NUMBER_2

SoKeyboardEvent::NUMBER_3

SoKeyboardEvent::NUMBER_4

SoKeyboardEvent::NUMBER_5

SoKeyboardEvent::NUMBER_6

SoKeyboardEvent::NUMBER_7

SoKeyboardEvent::NUMBER_8

SoKeyboardEvent::NUMBER_9

SoKeyboardEvent::A
Letters
SoKeyboardEvent::B

SoKeyboardEvent::C

SoKeyboardEvent::D

SoKeyboardEvent::E

SoKeyboardEvent::F

SoKeyboardEvent::G

SoKeyboardEvent::H

SoKeyboardEvent::I

SoKeyboardEvent::J

SoKeyboardEvent::K

SoKeyboardEvent::L

SoKeyboardEvent::M

SoKeyboardEvent::N

SoKeyboardEvent::O

SoKeyboardEvent::P

SoKeyboardEvent::Q

SoKeyboardEvent::R

SoKeyboardEvent::S

SoKeyboardEvent::T

SoKeyboardEvent::U

SoKeyboardEvent::V

SoKeyboardEvent::W

SoKeyboardEvent::X

SoKeyboardEvent::Y

SoKeyboardEvent::Z

SoKeyboardEvent::HOME
Cursor control and motion
SoKeyboardEvent::LEFT_ARROW

SoKeyboardEvent::UP_ARROW

SoKeyboardEvent::RIGHT_ARROW

SoKeyboardEvent::DOWN_ARROW

SoKeyboardEvent::PAGE_UP

SoKeyboardEvent::PAGE_DOWN

SoKeyboardEvent::PRIOR

SoKeyboardEvent::NEXT

SoKeyboardEvent::END

SoKeyboardEvent::PAD_ENTER
Keypad functions
SoKeyboardEvent::PAD_F1

SoKeyboardEvent::PAD_F2

SoKeyboardEvent::PAD_F3

SoKeyboardEvent::PAD_F4

SoKeyboardEvent::PAD_0

SoKeyboardEvent::PAD_1

SoKeyboardEvent::PAD_2

SoKeyboardEvent::PAD_3

SoKeyboardEvent::PAD_4

SoKeyboardEvent::PAD_5

SoKeyboardEvent::PAD_6

SoKeyboardEvent::PAD_7

SoKeyboardEvent::PAD_8

SoKeyboardEvent::PAD_9

SoKeyboardEvent::PAD_ADD

SoKeyboardEvent::PAD_SUBTRACT

SoKeyboardEvent::PAD_MULTIPLY

SoKeyboardEvent::PAD_DIVIDE

SoKeyboardEvent::PAD_SPACE

SoKeyboardEvent::PAD_TAB

SoKeyboardEvent::PAD_INSERT

SoKeyboardEvent::PAD_DELETE

SoKeyboardEvent::PAD_PERIOD

SoKeyboardEvent::F1
Function keys
SoKeyboardEvent::F2

SoKeyboardEvent::F3

SoKeyboardEvent::F4

SoKeyboardEvent::F5

SoKeyboardEvent::F6

SoKeyboardEvent::F7

SoKeyboardEvent::F8

SoKeyboardEvent::F9

SoKeyboardEvent::F10

SoKeyboardEvent::F11

SoKeyboardEvent::F12

SoKeyboardEvent::BACKSPACE
Miscellaneous
SoKeyboardEvent::TAB

SoKeyboardEvent::RETURN

SoKeyboardEvent::ENTER

SoKeyboardEvent::PAUSE

SoKeyboardEvent::SCROLL_LOCK

SoKeyboardEvent::ESCAPE

SoKeyboardEvent::DELETE

SoKeyboardEvent::PRINT

SoKeyboardEvent::INSERT

SoKeyboardEvent::NUM_LOCK

SoKeyboardEvent::CAPS_LOCK

SoKeyboardEvent::SHIFT_LOCK

SoKeyboardEvent::SPACE

SoKeyboardEvent::APOSTROPHE

SoKeyboardEvent::COMMA

SoKeyboardEvent::MINUS

SoKeyboardEvent::PERIOD

SoKeyboardEvent::SLASH

SoKeyboardEvent::SEMICOLON

SoKeyboardEvent::EQUAL

SoKeyboardEvent::BRACKETLEFT

SoKeyboardEvent::BACKSLASH

SoKeyboardEvent::BRACKETRIGHT

SoKeyboardEvent::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:

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

Methods from class SoEvent:

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
SoKeyboardEvent represents keyboard key press and release events in the Inventor event model.

METHODS

SoKeyboardEvent()
Constructor.

static SoType
getClassTypeId()
Return the type id for the SoKeyboardEvent class.

void
setKey(SoKeyboardEvent::Key whichKey)
SoKeyboardEvent::Key
getKey() const
Set and get which key generated the event.

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. When SoKeyboardEvent::ANY is passed, this returns TRUE if the event represents a keyboard press or release of any key.

char
getPrintableCharacter() const
Convenience routine that returns the character representing the key, if it's printable. If not, this returns NULL ('\0').

SEE ALSO
SoEvent, SoButtonEvent, SoLocation2Event, SoMotion3Event, SoMouseButtonEvent, SoSpaceballButtonEvent, SoHandleEventAction, SoEventCallback, SoSelection, SoInteraction, SoXtDevice