| 1 | /**************************************************************************** | 
| 2 | ** | 
| 3 | ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). | 
| 4 | ** Contact: https://www.qt.io/licensing/ | 
| 5 | ** | 
| 6 | ** This file is part of the Qt3D module of the Qt Toolkit. | 
| 7 | ** | 
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | 
| 9 | ** Commercial License Usage | 
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | 
| 11 | ** accordance with the commercial license agreement provided with the | 
| 12 | ** Software or, alternatively, in accordance with the terms contained in | 
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | 
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | 
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | 
| 16 | ** | 
| 17 | ** GNU Lesser General Public License Usage | 
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
| 19 | ** General Public License version 3 as published by the Free Software | 
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | 
| 21 | ** packaging of this file. Please review the following information to | 
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | 
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | 
| 24 | ** | 
| 25 | ** GNU General Public License Usage | 
| 26 | ** Alternatively, this file may be used under the terms of the GNU | 
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | 
| 28 | ** Public license version 3 or any later version approved by the KDE Free | 
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | 
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | 
| 31 | ** included in the packaging of this file. Please review the following | 
| 32 | ** information to ensure the GNU General Public License requirements will | 
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | 
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | 
| 35 | ** | 
| 36 | ** $QT_END_LICENSE$ | 
| 37 | ** | 
| 38 | ****************************************************************************/ | 
| 39 |  | 
| 40 | #include "qkeyboardhandler.h" | 
| 41 | #include "qkeyboardhandler_p.h" | 
| 42 |  | 
| 43 | #include <Qt3DInput/qkeyboarddevice.h> | 
| 44 |  | 
| 45 | QT_BEGIN_NAMESPACE | 
| 46 |  | 
| 47 | using namespace Qt3DCore; | 
| 48 |  | 
| 49 | namespace Qt3DInput { | 
| 50 |  | 
| 51 | namespace { | 
| 52 |  | 
| 53 |  | 
| 54 | // SigMap and the sigMap table are taken from QQ2 QQuickKeysAttached | 
| 55 | struct SigMap { | 
| 56 |     int key; | 
| 57 |     const char *sig; | 
| 58 | }; | 
| 59 |  | 
| 60 | const SigMap sigMap[] = { | 
| 61 |     { .key: Qt::Key_Left, .sig: "leftPressed"  }, | 
| 62 |     { .key: Qt::Key_Right, .sig: "rightPressed"  }, | 
| 63 |     { .key: Qt::Key_Up, .sig: "upPressed"  }, | 
| 64 |     { .key: Qt::Key_Down, .sig: "downPressed"  }, | 
| 65 |     { .key: Qt::Key_Tab, .sig: "tabPressed"  }, | 
| 66 |     { .key: Qt::Key_Backtab, .sig: "backtabPressed"  }, | 
| 67 |     { .key: Qt::Key_Asterisk, .sig: "asteriskPressed"  }, | 
| 68 |     { .key: Qt::Key_NumberSign, .sig: "numberSignPressed"  }, | 
| 69 |     { .key: Qt::Key_Escape, .sig: "escapePressed"  }, | 
| 70 |     { .key: Qt::Key_Return, .sig: "returnPressed"  }, | 
| 71 |     { .key: Qt::Key_Enter, .sig: "enterPressed"  }, | 
| 72 |     { .key: Qt::Key_Delete, .sig: "deletePressed"  }, | 
| 73 |     { .key: Qt::Key_Space, .sig: "spacePressed"  }, | 
| 74 |     { .key: Qt::Key_Back, .sig: "backPressed"  }, | 
| 75 |     { .key: Qt::Key_Cancel, .sig: "cancelPressed"  }, | 
| 76 |     { .key: Qt::Key_Select, .sig: "selectPressed"  }, | 
| 77 |     { .key: Qt::Key_Yes, .sig: "yesPressed"  }, | 
| 78 |     { .key: Qt::Key_No, .sig: "noPressed"  }, | 
| 79 |     { .key: Qt::Key_Context1, .sig: "context1Pressed"  }, | 
| 80 |     { .key: Qt::Key_Context2, .sig: "context2Pressed"  }, | 
| 81 |     { .key: Qt::Key_Context3, .sig: "context3Pressed"  }, | 
| 82 |     { .key: Qt::Key_Context4, .sig: "context4Pressed"  }, | 
| 83 |     { .key: Qt::Key_Call, .sig: "callPressed"  }, | 
| 84 |     { .key: Qt::Key_Hangup, .sig: "hangupPressed"  }, | 
| 85 |     { .key: Qt::Key_Flip, .sig: "flipPressed"  }, | 
| 86 |     { .key: Qt::Key_Menu, .sig: "menuPressed"  }, | 
| 87 |     { .key: Qt::Key_VolumeUp, .sig: "volumeUpPressed"  }, | 
| 88 |     { .key: Qt::Key_VolumeDown, .sig: "volumeDownPressed"  }, | 
| 89 |     { .key: 0, .sig: 0 } | 
| 90 | }; | 
| 91 |  | 
| 92 | const QByteArray keyToSignal(int key) | 
| 93 | { | 
| 94 |     QByteArray keySignal; | 
| 95 |     if (key >= Qt::Key_0 && key <= Qt::Key_9) { | 
| 96 |         keySignal = "digit0Pressed" ; | 
| 97 |         keySignal[5] = '0' + (key - Qt::Key_0); | 
| 98 |     } else { | 
| 99 |         int i = 0; | 
| 100 |         while (sigMap[i].key && sigMap[i].key != key) | 
| 101 |             ++i; | 
| 102 |         keySignal = sigMap[i].sig; | 
| 103 |     } | 
| 104 |     return keySignal; | 
| 105 | } | 
| 106 |  | 
| 107 | } // anonymous | 
| 108 |  | 
| 109 | QKeyboardHandlerPrivate::QKeyboardHandlerPrivate() | 
| 110 |     : QComponentPrivate() | 
| 111 |     , m_keyboardDevice(nullptr) | 
| 112 |     , m_focus(false) | 
| 113 | { | 
| 114 |     m_shareable = false; | 
| 115 | } | 
| 116 |  | 
| 117 | QKeyboardHandlerPrivate::~QKeyboardHandlerPrivate() | 
| 118 | { | 
| 119 | } | 
| 120 |  | 
| 121 | void QKeyboardHandlerPrivate::keyEvent(QKeyEvent *event) | 
| 122 | { | 
| 123 |     Q_Q(QKeyboardHandler); | 
| 124 |     if (event->type() == QEvent::KeyPress) { | 
| 125 |         emit q->pressed(event); | 
| 126 |  | 
| 127 |         QByteArray keySignal = keyToSignal(key: event->key()); | 
| 128 |         if (!keySignal.isEmpty()) { | 
| 129 |             keySignal += "(Qt3DInput::QKeyEvent*)" ; | 
| 130 |             // TO DO: Finding if the signal is connected to anything before doing the invocation | 
| 131 |             // could be an improvement | 
| 132 |             // That's what QQ2 does but since it accesses QML private classes to do so, that may not be | 
| 133 |             // applicable in our case | 
| 134 |             int idx = QKeyboardHandler::staticMetaObject.indexOfSignal(signal: keySignal); | 
| 135 |             q->metaObject()->method(index: idx).invoke(object: q, connectionType: Qt::DirectConnection, Q_ARG(QKeyEvent*, event)); | 
| 136 |         } | 
| 137 |     } else if (event->type() == QEvent::KeyRelease) { | 
| 138 |         emit q->released(event); | 
| 139 |     } | 
| 140 | } | 
| 141 |  | 
| 142 |  | 
| 143 | /*! | 
| 144 |     \class Qt3DInput::QKeyboardHandler | 
| 145 |     \inmodule Qt3DInput | 
| 146 |     \brief Provides keyboard event notification. | 
| 147 |     \since 5.5 | 
| 148 | */ | 
| 149 |  | 
| 150 | /*! | 
| 151 |     \qmltype KeyboardHandler | 
| 152 |     \inqmlmodule Qt3D.Input | 
| 153 |     \instantiates Qt3DInput::QKeyboardHandler | 
| 154 |     \inherits Component3D | 
| 155 |     \brief QML frontend for QKeyboardHandler C++ class. | 
| 156 |     \since 5.5 | 
| 157 | */ | 
| 158 |  | 
| 159 | /*! | 
| 160 |     Constructs a new QKeyboardHandler instance with parent \a parent. | 
| 161 |  */ | 
| 162 | QKeyboardHandler::QKeyboardHandler(QNode *parent) | 
| 163 |     : QComponent(*new QKeyboardHandlerPrivate, parent) | 
| 164 | { | 
| 165 | } | 
| 166 |  | 
| 167 | /*! \internal */ | 
| 168 | QKeyboardHandler::~QKeyboardHandler() | 
| 169 | { | 
| 170 | } | 
| 171 |  | 
| 172 | /*! | 
| 173 |     \qmlproperty KeyboardDevice Qt3D.Input::KeyboardHandler::sourceDevice | 
| 174 | */ | 
| 175 |  | 
| 176 | /*! | 
| 177 |     \property Qt3DInput::QKeyboardHandler::sourceDevice | 
| 178 |  | 
| 179 |     Holds the keyboard device of the QKeyboardHandler. Without a valid device, | 
| 180 |     the QKeyboardHandler won't receive any event. | 
| 181 |  */ | 
| 182 | void QKeyboardHandler::setSourceDevice(QKeyboardDevice *keyboardDevice) | 
| 183 | { | 
| 184 |     Q_D(QKeyboardHandler); | 
| 185 |     if (d->m_keyboardDevice != keyboardDevice) { | 
| 186 |  | 
| 187 |         if (d->m_keyboardDevice) | 
| 188 |             d->unregisterDestructionHelper(node: d->m_keyboardDevice); | 
| 189 |  | 
| 190 |         if (keyboardDevice && !keyboardDevice->parent()) | 
| 191 |             keyboardDevice->setParent(this); | 
| 192 |  | 
| 193 |         d->m_keyboardDevice = keyboardDevice; | 
| 194 |  | 
| 195 |         // Ensures proper bookkeeping | 
| 196 |         if (d->m_keyboardDevice) | 
| 197 |             d->registerDestructionHelper(node: keyboardDevice, func: &QKeyboardHandler::setSourceDevice, d->m_keyboardDevice); | 
| 198 |  | 
| 199 |         emit sourceDeviceChanged(keyboardDevice); | 
| 200 |     } | 
| 201 | } | 
| 202 |  | 
| 203 | /*! | 
| 204 |     Returns the current keyboard device. | 
| 205 |  */ | 
| 206 | QKeyboardDevice *QKeyboardHandler::sourceDevice() const | 
| 207 | { | 
| 208 |     Q_D(const QKeyboardHandler); | 
| 209 |     return d->m_keyboardDevice; | 
| 210 | } | 
| 211 |  | 
| 212 | /*! | 
| 213 |     \qmlproperty bool Qt3D.Input::KeyboardHandler::focus | 
| 214 | */ | 
| 215 |  | 
| 216 | /*! | 
| 217 |     \property Qt3DInput::QKeyboardHandler::focus | 
| 218 |  | 
| 219 |     Holds \c true if the QKeyboardHandlers has focus. | 
| 220 |  */ | 
| 221 | bool QKeyboardHandler::focus() const | 
| 222 | { | 
| 223 |     Q_D(const QKeyboardHandler); | 
| 224 |     return d->m_focus; | 
| 225 | } | 
| 226 |  | 
| 227 | /*! | 
| 228 |     Sets the focus to \a focus. If focus is not currently set to \c true, | 
| 229 |     this component will receive keyboard focus. | 
| 230 |  */ | 
| 231 | void QKeyboardHandler::setFocus(bool focus) | 
| 232 | { | 
| 233 |     Q_D(QKeyboardHandler); | 
| 234 |     if (d->m_focus != focus) { | 
| 235 |         d->m_focus = focus; | 
| 236 |         emit focusChanged(focus); | 
| 237 |     } | 
| 238 | } | 
| 239 |  | 
| 240 | // TODO Unused remove in Qt6 | 
| 241 | void QKeyboardHandler::sceneChangeEvent(const QSceneChangePtr &) | 
| 242 | { | 
| 243 | } | 
| 244 |  | 
| 245 | Qt3DCore::QNodeCreatedChangeBasePtr QKeyboardHandler::createNodeCreationChange() const | 
| 246 | { | 
| 247 |     auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QKeyboardHandlerData>::create(arguments: this); | 
| 248 |     auto &data = creationChange->data; | 
| 249 |  | 
| 250 |     Q_D(const QKeyboardHandler); | 
| 251 |     data.keyboardDeviceId = qIdForNode(node: d->m_keyboardDevice); | 
| 252 |     data.focus = d->m_focus; | 
| 253 |  | 
| 254 |     return creationChange; | 
| 255 | } | 
| 256 |  | 
| 257 | /*! | 
| 258 |     \qmlsignal Qt3D.Input::KeyboardHandler::digit0Pressed(KeyEvent event) | 
| 259 |  | 
| 260 |     This signal is emitted when the 0 key is pressed with the event details being contained within \a event. | 
| 261 | */ | 
| 262 |  | 
| 263 | /*! | 
| 264 |     \qmlsignal Qt3D.Input::KeyboardHandler::digit1Pressed(KeyEvent event) | 
| 265 |  | 
| 266 |     This signal is emitted when the 1 key is pressed with the event details being contained within \a event. | 
| 267 | */ | 
| 268 |  | 
| 269 | /*! | 
| 270 |     \qmlsignal Qt3D.Input::KeyboardHandler::digit2Pressed(KeyEvent event) | 
| 271 |  | 
| 272 |     This signal is emitted when the 2 key is pressed with the event details being contained within \a event. | 
| 273 | */ | 
| 274 |  | 
| 275 | /*! | 
| 276 |     \qmlsignal Qt3D.Input::KeyboardHandler::digit3Pressed(KeyEvent event) | 
| 277 |  | 
| 278 |     This signal is emitted when the 3 key is pressed with the event details being contained within \a event. | 
| 279 | */ | 
| 280 |  | 
| 281 | /*! | 
| 282 |     \qmlsignal Qt3D.Input::KeyboardHandler::digit4Pressed(KeyEvent event) | 
| 283 |  | 
| 284 |     This signal is emitted when the 4 key is pressed with the event details being contained within \a event. | 
| 285 | */ | 
| 286 |  | 
| 287 | /*! | 
| 288 |     \qmlsignal Qt3D.Input::KeyboardHandler::digit5Pressed(KeyEvent event) | 
| 289 |  | 
| 290 |     This signal is emitted when the 5 key is pressed with the event details being contained within \a event. | 
| 291 | */ | 
| 292 |  | 
| 293 | /*! | 
| 294 |     \qmlsignal Qt3D.Input::KeyboardHandler::digit6Pressed(KeyEvent event) | 
| 295 |  | 
| 296 |     This signal is emitted when the 6 key is pressed with the event details being contained within \a event. | 
| 297 | */ | 
| 298 |  | 
| 299 | /*! | 
| 300 |     \qmlsignal Qt3D.Input::KeyboardHandler::digit7Pressed(KeyEvent event) | 
| 301 |  | 
| 302 |     This signal is emitted when the 7 key is pressed with the event details being contained within \a event. | 
| 303 | */ | 
| 304 |  | 
| 305 | /*! | 
| 306 |     \qmlsignal Qt3D.Input::KeyboardHandler::digit8Pressed(KeyEvent event) | 
| 307 |  | 
| 308 |     This signal is emitted when the 8 key is pressed with the event details being contained within \a event. | 
| 309 | */ | 
| 310 |  | 
| 311 | /*! | 
| 312 |     \qmlsignal Qt3D.Input::KeyboardHandler::digit9Pressed(KeyEvent event) | 
| 313 |  | 
| 314 |     This signal is emitted when the 9 key is pressed with the event details being contained within \a event. | 
| 315 | */ | 
| 316 |  | 
| 317 | /*! | 
| 318 |     \qmlsignal Qt3D.Input::KeyboardHandler::leftPressed(KeyEvent event) | 
| 319 |  | 
| 320 |     This signal is emitted when the left key is pressed with the event details being contained within \a event. | 
| 321 | */ | 
| 322 |  | 
| 323 | /*! | 
| 324 |     \qmlsignal Qt3D.Input::KeyboardHandler::rightPressed(KeyEvent event) | 
| 325 |  | 
| 326 |     This signal is emitted when the right key is pressed with the event details being contained within \a event | 
| 327 | */ | 
| 328 |  | 
| 329 | /*! | 
| 330 |     \qmlsignal Qt3D.Input::KeyboardHandler::upPressed(KeyEvent event) | 
| 331 |  | 
| 332 |     This signal is emitted when the up key is pressed with the event details being contained within \a event. | 
| 333 | */ | 
| 334 |  | 
| 335 | /*! | 
| 336 |     \qmlsignal Qt3D.Input::KeyboardHandler::downPressed(KeyEvent event) | 
| 337 |  | 
| 338 |     This signal is emitted when the down key is pressed with the event details being contained within \a event. | 
| 339 | */ | 
| 340 |  | 
| 341 | /*! | 
| 342 |     \qmlsignal Qt3D.Input::KeyboardHandler::tabPressed(KeyEvent event) | 
| 343 |  | 
| 344 |     This signal is emitted when the tab key is pressed with the event details being contained within \a event. | 
| 345 | */ | 
| 346 |  | 
| 347 | /*! | 
| 348 |     \qmlsignal Qt3D.Input::KeyboardHandler::backtabPressed(KeyEvent event) | 
| 349 |  | 
| 350 |     This signal is emitted when the backtab key is pressed with the event details being contained within \a event. | 
| 351 | */ | 
| 352 |  | 
| 353 | /*! | 
| 354 |     \qmlsignal Qt3D.Input::KeyboardHandler::asteriskPressed(KeyEvent event) | 
| 355 |  | 
| 356 |     This signal is emitted when the * key is pressed with the event details being contained within \a event. | 
| 357 | */ | 
| 358 |  | 
| 359 | /*! | 
| 360 |     \qmlsignal Qt3D.Input::KeyboardHandler::numberSignPressed(KeyEvent event) | 
| 361 |  | 
| 362 |     This signal is emitted when the number sign key is pressed with the event details being contained within \a event. | 
| 363 | */ | 
| 364 |  | 
| 365 | /*! | 
| 366 |     \qmlsignal Qt3D.Input::KeyboardHandler::escapePressed(KeyEvent event) | 
| 367 |  | 
| 368 |     This signal is emitted when the escape key is pressed with the event details being contained within \a event. | 
| 369 | */ | 
| 370 |  | 
| 371 | /*! | 
| 372 |     \qmlsignal Qt3D.Input::KeyboardHandler::returnPressed(KeyEvent event) | 
| 373 |  | 
| 374 |     This signal is emitted when the return key is pressed with the event details being contained within \a event. | 
| 375 |  | 
| 376 | */ | 
| 377 |  | 
| 378 | /*! | 
| 379 |     \qmlsignal Qt3D.Input::KeyboardHandler::enterPressed(KeyEvent event) | 
| 380 |  | 
| 381 |     This signal is emitted when the enter key is pressed with the event details being contained within \a event. | 
| 382 | */ | 
| 383 |  | 
| 384 | /*! | 
| 385 |     \qmlsignal Qt3D.Input::KeyboardHandler::deletePressed(KeyEvent event) | 
| 386 |  | 
| 387 |     This signal is emitted when the delete key is pressed with the event details being contained within \a event. | 
| 388 | */ | 
| 389 |  | 
| 390 | /*! | 
| 391 |     \qmlsignal Qt3D.Input::KeyboardHandler::spacePressed(KeyEvent event) | 
| 392 |  | 
| 393 |     This signal is emitted when the space key is pressed with the event details being contained within \a event. | 
| 394 | */ | 
| 395 |  | 
| 396 | /*! | 
| 397 |     \qmlsignal Qt3D.Input::KeyboardHandler::backPressed(KeyEvent event) | 
| 398 |  | 
| 399 |     This signal is emitted when the back key is pressed with the event details being contained within \a event. | 
| 400 | */ | 
| 401 |  | 
| 402 | /*! | 
| 403 |     \qmlsignal Qt3D.Input::KeyboardHandler::cancelPressed(KeyEvent event) | 
| 404 |  | 
| 405 |     This signal is emitted when the cancel key is pressed with the event details being contained within \a event. | 
| 406 | */ | 
| 407 |  | 
| 408 | /*! | 
| 409 |     \qmlsignal Qt3D.Input::KeyboardHandler::selectPressed(KeyEvent event) | 
| 410 |  | 
| 411 |     This signal is emitted when the select key is pressed with the event details being contained within \a event. | 
| 412 | */ | 
| 413 |  | 
| 414 | /*! | 
| 415 |     \qmlsignal Qt3D.Input::KeyboardHandler::yesPressed(KeyEvent event) | 
| 416 |  | 
| 417 |     This signal is emitted when the yes key is pressed with the event details being contained within \a event. | 
| 418 | */ | 
| 419 |  | 
| 420 | /*! | 
| 421 |     \qmlsignal Qt3D.Input::KeyboardHandler::noPressed(KeyEvent event) | 
| 422 |  | 
| 423 |     This signal is emitted when the yes key is pressed with the event details being contained within \a event. | 
| 424 | */ | 
| 425 |  | 
| 426 | /*! | 
| 427 |     \qmlsignal Qt3D.Input::KeyboardHandler::context1Pressed(KeyEvent event) | 
| 428 |  | 
| 429 |     This signal is emitted when the context 1  key is pressed with the event details being contained within \a event. | 
| 430 | */ | 
| 431 |  | 
| 432 | /*! | 
| 433 |     \qmlsignal Qt3D.Input::KeyboardHandler::context2Pressed(KeyEvent event) | 
| 434 |  | 
| 435 |     This signal is emitted when the context 2  key is pressed with the event details being contained within \a event. | 
| 436 | */ | 
| 437 |  | 
| 438 | /*! | 
| 439 |     \qmlsignal Qt3D.Input::KeyboardHandler::context3Pressed(KeyEvent event) | 
| 440 |  | 
| 441 |     This signal is emitted when the context 2  key is pressed with the event details being contained within \a event. | 
| 442 | */ | 
| 443 |  | 
| 444 | /*! | 
| 445 |     \qmlsignal Qt3D.Input::KeyboardHandler::context4Pressed(KeyEvent event) | 
| 446 |  | 
| 447 |     This signal is emitted when the context 4  key is pressed with the event details being contained within \a event. | 
| 448 | */ | 
| 449 |  | 
| 450 | /*! | 
| 451 |     \qmlsignal Qt3D.Input::KeyboardHandler::callPressed(KeyEvent event) | 
| 452 |  | 
| 453 |     This signal is emitted when the call  key is pressed with the event details being contained within \a event. | 
| 454 | */ | 
| 455 |  | 
| 456 | /*! | 
| 457 |     \qmlsignal Qt3D.Input::KeyboardHandler::hangupPressed(KeyEvent event) | 
| 458 |  | 
| 459 |     This signal is emitted when the hangup  key is pressed with the event details being contained within \a event. | 
| 460 | */ | 
| 461 |  | 
| 462 | /*! | 
| 463 |     \qmlsignal Qt3D.Input::KeyboardHandler::flipPressed(KeyEvent event) | 
| 464 |  | 
| 465 |     This signal is emitted when the flip key is pressed with the event details being contained within \a event. | 
| 466 | */ | 
| 467 |  | 
| 468 | /*! | 
| 469 |     \qmlsignal Qt3D.Input::KeyboardHandler::menuPressed(KeyEvent event) | 
| 470 |  | 
| 471 |     This signal is emitted when the menu key is pressed with the event details being contained within \a event. | 
| 472 | */ | 
| 473 |  | 
| 474 | /*! | 
| 475 |     \qmlsignal Qt3D.Input::KeyboardHandler::volumeUpPressed(KeyEvent event) | 
| 476 |  | 
| 477 |     This signal is emitted when the volume up key is pressed with the event details being contained within \a event. | 
| 478 | */ | 
| 479 |  | 
| 480 | /*! | 
| 481 |     \qmlsignal Qt3D.Input::KeyboardHandler::volumeDownPressed(KeyEvent event) | 
| 482 |  | 
| 483 |     This signal is emitted when the volume down key is pressed with the event details being contained within \a event. | 
| 484 | */ | 
| 485 |  | 
| 486 | /*! | 
| 487 |     \qmlsignal Qt3D.Input::KeyboardHandler::pressed(KeyEvent event) | 
| 488 |  | 
| 489 |     This signal is emitted when a key is pressed with the event details being contained within \a event. | 
| 490 | */ | 
| 491 |  | 
| 492 | /*! | 
| 493 |     \qmlsignal Qt3D.Input::KeyboardHandler::released(KeyEvent event) | 
| 494 |  | 
| 495 |     This signal is emitted when a key is released with the event details being contained within \a event. | 
| 496 | */ | 
| 497 |  | 
| 498 | /*! | 
| 499 |     \fn Qt3DInput::QKeyboardHandler::digit0Pressed(Qt3DInput::QKeyEvent *event) | 
| 500 |  | 
| 501 |     This signal is emitted when the 0 key is pressed with the event details being contained within \a event. | 
| 502 | */ | 
| 503 |  | 
| 504 | /*! | 
| 505 |     \fn Qt3DInput::QKeyboardHandler::digit1Pressed(Qt3DInput::QKeyEvent *event) | 
| 506 |  | 
| 507 |     This signal is emitted when the 1 key is pressed with the event details being contained within \a event. | 
| 508 | */ | 
| 509 |  | 
| 510 | /*! | 
| 511 |     \fn Qt3DInput::QKeyboardHandler::digit2Pressed(Qt3DInput::QKeyEvent *event) | 
| 512 |  | 
| 513 |     This signal is emitted when the 2 key is pressed with the event details being contained within \a event. | 
| 514 | */ | 
| 515 |  | 
| 516 | /*! | 
| 517 |     \fn Qt3DInput::QKeyboardHandler::digit3Pressed(Qt3DInput::QKeyEvent *event) | 
| 518 |  | 
| 519 |     This signal is emitted when the 3 key is pressed with the event details being contained within \a event. | 
| 520 | */ | 
| 521 |  | 
| 522 | /*! | 
| 523 |     \fn Qt3DInput::QKeyboardHandler::digit4Pressed(Qt3DInput::QKeyEvent *event) | 
| 524 |  | 
| 525 |     This signal is emitted when the 4 key is pressed with the event details being contained within \a event. | 
| 526 | */ | 
| 527 |  | 
| 528 | /*! | 
| 529 |     \fn Qt3DInput::QKeyboardHandler::digit5Pressed(Qt3DInput::QKeyEvent *event) | 
| 530 |  | 
| 531 |     This signal is emitted when the 5 key is pressed with the event details being contained within \a event. | 
| 532 | */ | 
| 533 |  | 
| 534 | /*! | 
| 535 |     \fn Qt3DInput::QKeyboardHandler::digit6Pressed(Qt3DInput::QKeyEvent *event) | 
| 536 |  | 
| 537 |     This signal is emitted when the 6 key is pressed with the event details being contained within \a event. | 
| 538 | */ | 
| 539 |  | 
| 540 | /*! | 
| 541 |     \fn Qt3DInput::QKeyboardHandler::digit7Pressed(Qt3DInput::QKeyEvent *event) | 
| 542 |  | 
| 543 |     This signal is emitted when the 7 key is pressed with the event details being contained within \a event. | 
| 544 | */ | 
| 545 |  | 
| 546 | /*! | 
| 547 |     \fn Qt3DInput::QKeyboardHandler::digit8Pressed(Qt3DInput::QKeyEvent *event) | 
| 548 |  | 
| 549 |     This signal is emitted when the 8 key is pressed with the event details being contained within \a event. | 
| 550 | */ | 
| 551 |  | 
| 552 | /*! | 
| 553 |     \fn Qt3DInput::QKeyboardHandler::digit9Pressed(Qt3DInput::QKeyEvent *event) | 
| 554 |  | 
| 555 |     This signal is emitted when the 9 key is pressed with the event details being contained within \a event | 
| 556 | */ | 
| 557 |  | 
| 558 | /*! | 
| 559 |     \fn Qt3DInput::QKeyboardHandler::leftPressed(Qt3DInput::QKeyEvent *event) | 
| 560 |  | 
| 561 |     This signal is emitted when the left key is pressed with the event details being contained within \a event. | 
| 562 | */ | 
| 563 |  | 
| 564 | /*! | 
| 565 |     \fn Qt3DInput::QKeyboardHandler::rightPressed(Qt3DInput::QKeyEvent *event) | 
| 566 |  | 
| 567 |     This signal is emitted when the right key is pressed with the event details being contained within \a event. | 
| 568 | */ | 
| 569 |  | 
| 570 | /*! | 
| 571 |     \fn Qt3DInput::QKeyboardHandler::upPressed(Qt3DInput::QKeyEvent *event) | 
| 572 |  | 
| 573 |     This signal is emitted when the up key is pressed with the event details being contained within \a event. | 
| 574 | */ | 
| 575 |  | 
| 576 | /*! | 
| 577 |     \fn Qt3DInput::QKeyboardHandler::downPressed(Qt3DInput::QKeyEvent *event) | 
| 578 |  | 
| 579 |     This signal is emitted when the down key is pressed with the event details being contained within \a event. | 
| 580 | */ | 
| 581 |  | 
| 582 | /*! | 
| 583 |     \fn Qt3DInput::QKeyboardHandler::tabPressed(Qt3DInput::QKeyEvent *event) | 
| 584 |  | 
| 585 |     This signal is emitted when the tab key is pressed with the event details being contained within \a event. | 
| 586 | */ | 
| 587 |  | 
| 588 | /*! | 
| 589 |     \fn Qt3DInput::QKeyboardHandler::backtabPressed(Qt3DInput::QKeyEvent *event) | 
| 590 |  | 
| 591 |     This signal is emitted when the backtab key is pressed with the event details being contained within \a event. | 
| 592 | */ | 
| 593 |  | 
| 594 | /*! | 
| 595 |     \fn Qt3DInput::QKeyboardHandler::asteriskPressed(Qt3DInput::QKeyEvent *event) | 
| 596 |  | 
| 597 |     This signal is emitted when the * key is pressed with the event details being contained within \a event. | 
| 598 | */ | 
| 599 |  | 
| 600 | /*! | 
| 601 |     \fn Qt3DInput::QKeyboardHandler::numberSignPressed(Qt3DInput::QKeyEvent *event) | 
| 602 |  | 
| 603 |     This signal is emitted when the number sign key is pressed with the event details being contained within \a event. | 
| 604 | */ | 
| 605 |  | 
| 606 | /*! | 
| 607 |     \fn Qt3DInput::QKeyboardHandler::escapePressed(Qt3DInput::QKeyEvent *event) | 
| 608 |  | 
| 609 |     This signal is emitted when the escape key is pressed with the event details being contained within \a event. | 
| 610 | */ | 
| 611 |  | 
| 612 | /*! | 
| 613 |     \fn Qt3DInput::QKeyboardHandler::returnPressed(Qt3DInput::QKeyEvent *event) | 
| 614 |  | 
| 615 |     This signal is emitted when the return key is pressed with the event details being contained within \a event. | 
| 616 | */ | 
| 617 |  | 
| 618 | /*! | 
| 619 |     \fn Qt3DInput::QKeyboardHandler::enterPressed(Qt3DInput::QKeyEvent *event) | 
| 620 |  | 
| 621 |     This signal is emitted when the enter key is pressed with the event details being contained within \a event. | 
| 622 |  | 
| 623 | */ | 
| 624 |  | 
| 625 | /*! | 
| 626 |     \fn Qt3DInput::QKeyboardHandler::deletePressed(Qt3DInput::QKeyEvent *event) | 
| 627 |  | 
| 628 |     This signal is emitted when the delete key is pressed with the event details being contained within \a event. | 
| 629 | */ | 
| 630 |  | 
| 631 | /*! | 
| 632 |     \fn Qt3DInput::QKeyboardHandler::spacePressed(Qt3DInput::QKeyEvent *event) | 
| 633 |  | 
| 634 |     This signal is emitted when the space key is pressed with the event details being contained within \a event. | 
| 635 | */ | 
| 636 |  | 
| 637 | /*! | 
| 638 |     \fn Qt3DInput::QKeyboardHandler::backPressed(Qt3DInput::QKeyEvent *event) | 
| 639 |  | 
| 640 |     This signal is emitted when the back key is pressed with the event details being contained within \a event. | 
| 641 | */ | 
| 642 |  | 
| 643 | /*! | 
| 644 |     \fn Qt3DInput::QKeyboardHandler::cancelPressed(Qt3DInput::QKeyEvent *event) | 
| 645 |  | 
| 646 |     This signal is emitted when the cancel key is pressed with the event details being contained within \a event. | 
| 647 | */ | 
| 648 |  | 
| 649 | /*! | 
| 650 |     \fn Qt3DInput::QKeyboardHandler::selectPressed(Qt3DInput::QKeyEvent *event) | 
| 651 |  | 
| 652 |     This signal is emitted when the select key is pressed with the event details being contained within \a event. | 
| 653 | */ | 
| 654 |  | 
| 655 | /*! | 
| 656 |     \fn Qt3DInput::QKeyboardHandler::yesPressed(Qt3DInput::QKeyEvent *event) | 
| 657 |  | 
| 658 |     This signal is emitted when the yes key is pressed with the event details being contained within \a event. | 
| 659 | */ | 
| 660 |  | 
| 661 | /*! | 
| 662 |     \fn Qt3DInput::QKeyboardHandler::noPressed(Qt3DInput::QKeyEvent *event) | 
| 663 |  | 
| 664 |     This signal is emitted when the yes key is pressed with the event details being contained within \a event. | 
| 665 | */ | 
| 666 |  | 
| 667 | /*! | 
| 668 |     \fn Qt3DInput::QKeyboardHandler::context1Pressed(Qt3DInput::QKeyEvent *event) | 
| 669 |  | 
| 670 |     This signal is emitted when the context 1  key is pressed with the event details being contained within \a event. | 
| 671 | */ | 
| 672 |  | 
| 673 | /*! | 
| 674 |     \fn Qt3DInput::QKeyboardHandler::context2Pressed(Qt3DInput::QKeyEvent *event) | 
| 675 |  | 
| 676 |     This signal is emitted when the context 2  key is pressed with the event details being contained within \a event. | 
| 677 | */ | 
| 678 |  | 
| 679 | /*! | 
| 680 |     \fn Qt3DInput::QKeyboardHandler::context3Pressed(Qt3DInput::QKeyEvent *event) | 
| 681 |  | 
| 682 |     This signal is emitted when the context 2  key is pressed with the event details being contained within \a event. | 
| 683 | */ | 
| 684 |  | 
| 685 | /*! | 
| 686 |     \fn Qt3DInput::QKeyboardHandler::context4Pressed(Qt3DInput::QKeyEvent *event) | 
| 687 |  | 
| 688 |     This signal is emitted when the context 4  key is pressed with the event details being contained within \a event. | 
| 689 | */ | 
| 690 |  | 
| 691 | /*! | 
| 692 |     \fn Qt3DInput::QKeyboardHandler::callPressed(Qt3DInput::QKeyEvent *event) | 
| 693 |  | 
| 694 |     This signal is emitted when the call  key is pressed with the event details being contained within \a event. | 
| 695 | */ | 
| 696 |  | 
| 697 | /*! | 
| 698 |     \fn Qt3DInput::QKeyboardHandler::hangupPressed(Qt3DInput::QKeyEvent *event) | 
| 699 |  | 
| 700 |     This signal is emitted when the hangup  key is pressed with the event details being contained within \a event. | 
| 701 | */ | 
| 702 |  | 
| 703 | /*! | 
| 704 |     \fn Qt3DInput::QKeyboardHandler::flipPressed(Qt3DInput::QKeyEvent *event) | 
| 705 |  | 
| 706 |     This signal is emitted when the flip key is pressed with the event details being contained within \a event. | 
| 707 | */ | 
| 708 |  | 
| 709 | /*! | 
| 710 |     \fn Qt3DInput::QKeyboardHandler::menuPressed(Qt3DInput::QKeyEvent *event) | 
| 711 |  | 
| 712 |     This signal is emitted when the menu key is pressed with the event details being contained within \a event. | 
| 713 | */ | 
| 714 |  | 
| 715 | /*! | 
| 716 |     \fn Qt3DInput::QKeyboardHandler::volumeUpPressed(Qt3DInput::QKeyEvent *event) | 
| 717 |  | 
| 718 |     This signal is emitted when the volume up key is pressed with the event details being contained within \a event. | 
| 719 | */ | 
| 720 |  | 
| 721 | /*! | 
| 722 |     \fn Qt3DInput::QKeyboardHandler::volumeDownPressed(Qt3DInput::QKeyEvent *event) | 
| 723 |  | 
| 724 |     This signal is emitted when the volume down key is pressed with the event details being contained within \a event. | 
| 725 | */ | 
| 726 |  | 
| 727 | /*! | 
| 728 |     \fn Qt3DInput::QKeyboardHandler::pressed(Qt3DInput::QKeyEvent *event) | 
| 729 |  | 
| 730 |     This signal is emitted when a key is pressed with the event details being contained within \a event. | 
| 731 | */ | 
| 732 |  | 
| 733 | /*! | 
| 734 |     \fn Qt3DInput::QKeyboardHandler::released(Qt3DInput::QKeyEvent *event) | 
| 735 |  | 
| 736 |     This signal is emitted when a key is released with the event details being contained within \a event. | 
| 737 | */ | 
| 738 | } // namespace Qt3DInput | 
| 739 |  | 
| 740 | QT_END_NAMESPACE | 
| 741 |  |