C

BaseKey QML Type

Common parent for all key types. More...

Import Statement: import QtQuick.VirtualKeyboard.Components
Inherited By:
11 types

BackspaceKey, ChangeLanguageKey, EnterKey, FillerKey, HideKeyboardKey, InputModeKey, Key, ModeKey, ShiftKey, SpaceKey, and SymbolModeKey

Properties

Signals

Detailed Description

BaseKey is a common type for all keys in keyboard layout.

This type should not be used directly in the layouts. The specialized key types, such as Key or EnterKey should be used instead.

Without a key panel element, the key is invisible. Refer to styling documentation to learn more about how to style the key panel.

Property Documentation

active : bool

This property holds the active status of the key.

This property is automatically set to true when the key is pressed.


alternativeKeys : AlternativeKeysValue

Sets the list of alternative keys.

This property can be set to a string, or a list of strings. If the value is a string, the alternative keys are presented as individual characters of that string. If the value is a list of strings, the list is used instead.

The alternative keys are presented to the user by pressing and holding a key with this property set.

Note: If the alternative keys contains the key text, it will be filtered from the alternative keys presented to user and its position will be used as an indicator for the highlighted item instead.

The default is empty list.

AlternativeKeysValue is an opaque value type that accepts string or list of strings.


displayAlternativeKeys : AlternativeKeysValue

This property allows overriding the list of key strings presented to the user in the alternative keys view. What is being actually sent to the input methods is the keys at the respective indices in alternativeKeys.

AlternativeKeysValue is an opaque value type that accepts string or list of strings.


displayText : string

Sets the display text.

This string is rendered in the keyboard layout.

The default value is the key text.


functionKey : bool

Sets the function key attribute.

The default is false.


highlighted : bool

Sets the highlighted status of the key.

The default is false.


key : int

Sets the key code for input method processing.

The default is Qt.Key_unknown.


keyType : int

Key type for the specialized key. Possible values:

  • QtVirtualKeyboard.KeyType.BaseKey
  • QtVirtualKeyboard.KeyType.BackspaceKey
  • QtVirtualKeyboard.KeyType.ChangeLanguageKey
  • QtVirtualKeyboard.KeyType.EnterKey
  • QtVirtualKeyboard.KeyType.FillerKey
  • QtVirtualKeyboard.KeyType.HideKeyboardKey
  • QtVirtualKeyboard.KeyType.InputModeKey
  • QtVirtualKeyboard.KeyType.Key
  • QtVirtualKeyboard.KeyType.ModeKey
  • QtVirtualKeyboard.KeyType.ShiftKey
  • QtVirtualKeyboard.KeyType.SpaceKey
  • QtVirtualKeyboard.KeyType.SymbolModeKey

For example, SpaceKey sets this value to QtVirtualKeyboard.KeyType.SpaceKey.


noKeyEvent : bool

This property controls whether the key emits key events for input method processing. When true, the key events are disabled.

By default, the key event is emitted if the key is not unknown or the text is not empty.


noModifier : bool

Disables key modifiers on the emitted key.

The default is false.


pressed : bool

This property holds the pressed status of the key.

The pressed status can only be true if the key is both enabled and active. When the key state becomes pressed, it triggers a key down event for the input engine. A key up event is triggered when the key is released.


repeat : bool

Sets the key repeat attribute.

If the repeat is enabled, the key will repeat the input events while held down. The repeat should not be used if alternativeKeys is also set.

The default is false.

Note: This property currently has no effect.


showPreview : bool

Sets the show preview attribute.

By default, the character preview popup is not shown for function keys.


smallText : string

Sets the small text rendered in the corner of the key.

The default value based on the default item in the alternative keys.


smallTextVisible : bool

Sets the visibility of small text.

The default value is inherited from KeyboardLayout.smallTextVisible


text : string

Sets the key text for input method processing.

In most cases, this is the Unicode representation of the key code.

The default value is an empty string.


uppercased : bool

This property holds the uppercase status of the key.

By default, this property reflects the uppercase status of the keyboard.


weight : real

Sets the key weight value which determines the relative size of the key.

Use this property to change the key size in the layout.

The default value is inherited from KeyboardLayout.keyWeight


Signal Documentation

clicked()

This signal is triggered when the key is pressed, allowing custom processing of key.

Note: The corresponding handler is onClicked.


Available under certain Qt licenses.
Find out more.