---
name: "SoQtKeyboard"
section: "3"
platform: "linux"
package: "libsoqt-dev-common"
version: "1.6.0~e8310f-3"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/SoQtKeyboard"
---

# SoQtKeyboard(3)

The SoQtKeyboard class is the keyboard input device abstraction. The SoQtKeyboard class is the glue between native keyboard handling and keyboard interaction with the Inventor scenegraph.

## NAME

SoQtKeyboard - The **SoQtKeyboard** class is the keyboard input device abstraction.

The **SoQtKeyboard** class is the glue between native keyboard handling and keyboard interaction with the Inventor scenegraph.

## SYNOPSIS

`#include <Inventor/Qt/devices/SoQtKeyboard.h>`

Inherits **SoQtDevice**.

### Public Types

enum **Events** { **KEY\_PRESS** = 0x01, **KEY\_RELEASE** = 0x02, **ALL\_EVENTS** = KEY\_PRESS \| KEY\_RELEASE }\

### Public Member Functions

**SoQtKeyboard** (int eventmask=**ALL\_EVENTS**)\
 virtual **~SoQtKeyboard** (void)\
 virtual void **enable** (QWidget \*widget, SoQtEventHandler \*handler, void \*closure)\
 virtual void **disable** (QWidget \*widget, SoQtEventHandler \*handler, void \*closure)\
 virtual const SoEvent \* **translateEvent** (QEvent \*event)\

### Friends

class **SoQtKeyboardP**\
 class **SoGuiKeyboardP**\

### Additional Inherited Members

## Detailed Description

The **SoQtKeyboard** class is the keyboard input device abstraction.

The **SoQtKeyboard** class is the glue between native keyboard handling and keyboard interaction with the Inventor scenegraph.

All components derived from the **SoQtRenderArea** have got an **SoQtKeyboard** device attached by default.

## Member Enumeration Documentation

### enum SoQtKeyboard::Events

Enumeration over supported event types.

**Enumerator**

- *KEY\_PRESS*

  *Maskbit for a keyboard button press event.*

- *KEY\_RELEASE*

  *Maskbit for a keyboard button release event.*

- *ALL\_EVENTS*

  *Combined bitmask for all possible events.*

## Constructor & Destructor Documentation

### SoQtKeyboard::SoQtKeyboard (int mask = ALL\_EVENTS)

*Constructor. The mask specifies which keyboard-related events to handle. Others will just be ignored.*

### SoQtKeyboard::~SoQtKeyboard (void)` [virtual]`

*Destructor.*

## Member Function Documentation

### void SoQtKeyboard::enable (QWidget \* widget, SoQtEventHandler \* handler, void \* closure)` [virtual]`

*This method will enable the device for the widget.*

*handler is invoked with the closure argument when an event occur in widget.*

*Implements* **SoQtDevice***.*

### void SoQtKeyboard::disable (QWidget \* widget, SoQtEventHandler \* handler, void \* closure)` [virtual]`

*This method will disable the handler for the device.*

*Implements* **SoQtDevice***.*

### const SoEvent \* SoQtKeyboard::translateEvent (QEvent \* event)` [virtual]`

*This method translates from native events to Open Inventor SoEvent events.*

*Implements* **SoQtDevice***.*

*References SoQtDevice::getLastEventPosition().*

## Author

*Generated automatically by Doxygen for SoQt from the source code.*
