本页内容

Qt3DInput::QKeyboardDevice Class

class Qt3DInput::QKeyboardDevice

QKeyboardDevice 负责将键盘事件分发给关联的 QQKeyboardHandler 对象。更多内容...

头文件: #include <qkeyboarddevice.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dinput)
target_link_libraries(mytarget PRIVATE Qt6::3dinput)
qmake: QT += 3dinput
在 QML 中: KeyboardDevice
继承自: Qt3DInput::QAbstractPhysicalDevice
状态: 已弃用

该类已弃用。我们强烈建议不要在新代码中使用它。

属性

公共函数

QKeyboardDevice(Qt3DCore::QNode *parent = nullptr)
Qt3DInput::QKeyboardHandler *activeInput() const

重新实现的公共函数

virtual int axisCount() const override
virtual int axisIdentifier(const QString &name) const override
virtual QStringList axisNames() const override
virtual int buttonCount() const override
virtual int buttonIdentifier(const QString &name) const override
virtual QStringList buttonNames() const override

信号

void activeInputChanged(Qt3DInput::QKeyboardHandler *activeInput)

详细说明

属性文档

[read-only] activeInput : Qt3DInput::QKeyboardHandler*

保存设备的活动 QKeyboardHandler。

访问函数:

Qt3DInput::QKeyboardHandler *activeInput() const

通知信号:

void activeInputChanged(Qt3DInput::QKeyboardHandler *activeInput)

成员函数文档

[explicit] QKeyboardDevice::QKeyboardDevice(Qt3DCore::QNode *parent = nullptr)

使用parent 创建一个新的QKeyboardDevice实例。

[override virtual] int QKeyboardDevice::axisCount() const

重写:QAbstractPhysicalDevice::axisCount() const。

返回轴的数量。

注意:目前 始终返回零。

[override virtual] int QKeyboardDevice::axisIdentifier(const QString &name) const

重写了:QAbstractPhysicalDevice::axisIdentifier(const QString &name) const。

返回与 `name` 匹配的 `axisIdentifier`。

[override virtual] QStringList QKeyboardDevice::axisNames() const

重写了:QAbstractPhysicalDevice::axisNames() const。

返回轴名。

注意:目前 始终返回空的QStringList 。

[override virtual] int QKeyboardDevice::buttonCount() const

重写了:QAbstractPhysicalDevice::buttonCount() const。

返回按钮的数量。

[override virtual] int QKeyboardDevice::buttonIdentifier(const QString &name) const

重写了:QAbstractPhysicalDevice::buttonIdentifier(const QString &name) const。

返回与name 匹配的 buttonIdentifier。

[override virtual] QStringList QKeyboardDevice::buttonNames() const

重写了:QAbstractPhysicalDevice::buttonNames() const。

返回按钮名称。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.