- Qt 6.9
- Qt 3D
- C++ Classes
- Qt3DInput (Deprecated)
- QKeyboardHandler
- Qt 6.9.1 Reference Documentation

# Qt3DInput::QKeyboardHandler Class

class Qt3DInput::QKeyboardHandler

Provides keyboard event notification. More...

Header: | `#include <QKeyboardHandler>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS 3dinput)` `target_link_libraries(mytarget PRIVATE Qt6::3dinput)`
qmake: | `QT += 3dinput`
In QML: | KeyboardHandler
Inherits: | Qt3DCore::QComponent
Status: | Deprecated

- List of all members, including inherited members

## Properties

- focus : bool
- sourceDevice : Qt3DInput::QKeyboardDevice*

## Public Functions

| QKeyboardHandler(Qt3DCore::QNode *parent = nullptr)
bool | focus() const
Qt3DInput::QKeyboardDevice * | sourceDevice() const

## Public Slots

void | setFocus(bool focus)
void | setSourceDevice(Qt3DInput::QKeyboardDevice *keyboardDevice)

## Signals

void | asteriskPressed(Qt3DInput::QKeyEvent *event)
void | backPressed(Qt3DInput::QKeyEvent *event)
void | backtabPressed(Qt3DInput::QKeyEvent *event)
void | callPressed(Qt3DInput::QKeyEvent *event)
void | cancelPressed(Qt3DInput::QKeyEvent *event)
void | context1Pressed(Qt3DInput::QKeyEvent *event)
void | context2Pressed(Qt3DInput::QKeyEvent *event)
void | context3Pressed(Qt3DInput::QKeyEvent *event)
void | context4Pressed(Qt3DInput::QKeyEvent *event)
void | deletePressed(Qt3DInput::QKeyEvent *event)
void | digit0Pressed(Qt3DInput::QKeyEvent *event)
void | digit1Pressed(Qt3DInput::QKeyEvent *event)
void | digit2Pressed(Qt3DInput::QKeyEvent *event)
void | digit3Pressed(Qt3DInput::QKeyEvent *event)
void | digit4Pressed(Qt3DInput::QKeyEvent *event)
void | digit5Pressed(Qt3DInput::QKeyEvent *event)
void | digit6Pressed(Qt3DInput::QKeyEvent *event)
void | digit7Pressed(Qt3DInput::QKeyEvent *event)
void | digit8Pressed(Qt3DInput::QKeyEvent *event)
void | digit9Pressed(Qt3DInput::QKeyEvent *event)
void | downPressed(Qt3DInput::QKeyEvent *event)
void | enterPressed(Qt3DInput::QKeyEvent *event)
void | escapePressed(Qt3DInput::QKeyEvent *event)
void | flipPressed(Qt3DInput::QKeyEvent *event)
void | focusChanged(bool focus)
void | hangupPressed(Qt3DInput::QKeyEvent *event)
void | leftPressed(Qt3DInput::QKeyEvent *event)
void | menuPressed(Qt3DInput::QKeyEvent *event)
void | noPressed(Qt3DInput::QKeyEvent *event)
void | numberSignPressed(Qt3DInput::QKeyEvent *event)
void | pressed(Qt3DInput::QKeyEvent *event)
void | released(Qt3DInput::QKeyEvent *event)
void | returnPressed(Qt3DInput::QKeyEvent *event)
void | rightPressed(Qt3DInput::QKeyEvent *event)
void | selectPressed(Qt3DInput::QKeyEvent *event)
void | sourceDeviceChanged(Qt3DInput::QKeyboardDevice *keyboardDevice)
void | spacePressed(Qt3DInput::QKeyEvent *event)
void | tabPressed(Qt3DInput::QKeyEvent *event)
void | upPressed(Qt3DInput::QKeyEvent *event)
void | volumeDownPressed(Qt3DInput::QKeyEvent *event)
void | volumeUpPressed(Qt3DInput::QKeyEvent *event)
void | yesPressed(Qt3DInput::QKeyEvent *event)

## Detailed Description

## Property Documentation

### focus : bool

Holds `true` if the QKeyboardHandlers has focus.

Access functions:

bool | focus() const
void | setFocus(bool focus)

Notifier signal:

void | focusChanged(bool focus)

### sourceDevice : Qt3DInput::QKeyboardDevice*

Holds the keyboard device of the QKeyboardHandler. Without a valid device, the QKeyboardHandler won't receive any event.

Access functions:

Qt3DInput::QKeyboardDevice * | sourceDevice() const
void | setSourceDevice(Qt3DInput::QKeyboardDevice *keyboardDevice)

Notifier signal:

void | sourceDeviceChanged(Qt3DInput::QKeyboardDevice *keyboardDevice)

## Member Function Documentation

### `[explicit]` QKeyboardHandler::QKeyboardHandler(Qt3DCore::QNode *parent = nullptr)

Constructs a new QKeyboardHandler instance with parent parent.

### `[signal]` void QKeyboardHandler::asteriskPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the * key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::backPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the back key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::backtabPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the backtab key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::callPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the call key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::cancelPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the cancel key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::context1Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the context 1 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::context2Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the context 2 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::context3Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the context 2 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::context4Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the context 4 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::deletePressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the delete key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::digit0Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the 0 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::digit1Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the 1 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::digit2Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the 2 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::digit3Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the 3 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::digit4Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the 4 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::digit5Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the 5 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::digit6Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the 6 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::digit7Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the 7 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::digit8Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the 8 key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::digit9Pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the 9 key is pressed with the event details being contained within event

### `[signal]` void QKeyboardHandler::downPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the down key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::enterPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the enter key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::escapePressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the escape key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::flipPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the flip key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::hangupPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the hangup key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::leftPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the left key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::menuPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the menu key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::noPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the yes key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::numberSignPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the number sign key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::pressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when a key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::released(Qt3DInput::QKeyEvent *event)

This signal is emitted when a key is released with the event details being contained within event.

### `[signal]` void QKeyboardHandler::returnPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the return key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::rightPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the right key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::selectPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the select key is pressed with the event details being contained within event.

### `[slot]` void QKeyboardHandler::setFocus(bool focus)

Sets the focus to focus. If focus is not currently set to `true`, this component will receive keyboard focus.

Note: Setter function for property focus.

See also focus().

### Qt3DInput::QKeyboardDevice *QKeyboardHandler::sourceDevice() const

Returns the current keyboard device.

Note: Getter function for property sourceDevice.

See also setSourceDevice().

### `[signal]` void QKeyboardHandler::spacePressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the space key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::tabPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the tab key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::upPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the up key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::volumeDownPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the volume down key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::volumeUpPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the volume up key is pressed with the event details being contained within event.

### `[signal]` void QKeyboardHandler::yesPressed(Qt3DInput::QKeyEvent *event)

This signal is emitted when the yes key is pressed with the event details being contained within event.