ModeKey.qml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (C) 2016 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
  3. import QtQuick
  4. import QtQuick.VirtualKeyboard
  5. /*!
  6. \qmltype ModeKey
  7. \inqmlmodule QtQuick.VirtualKeyboard.Components
  8. \ingroup qmlclass
  9. \ingroup qtvirtualkeyboard-components-qml
  10. \ingroup qtvirtualkeyboard-key-types
  11. \inherits Key
  12. \since QtQuick.VirtualKeyboard 2.0
  13. \brief Generic mode key for keyboard layouts.
  14. This key provides generic mode button functionality.
  15. A key press toggles the current mode without emitting key event
  16. for input method processing.
  17. ModeKey can be used in situations where a particular mode is switched
  18. "ON / OFF", and where the mode change does not require changing the
  19. keyboard layout. When this component is used, the \l { BaseKey::displayText } { displayText } should
  20. remain the same regardless of the mode, because the keyboard style
  21. visualizes the status.
  22. */
  23. Key {
  24. /*! This property provides the current mode.
  25. The default is false.
  26. */
  27. property bool mode
  28. keyType: QtVirtualKeyboard.KeyType.ModeKey
  29. noKeyEvent: true
  30. functionKey: true
  31. highlighted: true
  32. onClicked: mode = !mode
  33. keyPanelDelegate: keyboard.style ? keyboard.style.modeKeyPanel : undefined
  34. }