NDEVR
API Documentation

A popup for showing a virtual keyboard or keypad. More...

Collaboration diagram for Keypad:
[legend]

Public Member Functions

 Keypad (QWidget *parent=nullptr)
 Constructs a Keypad widget.
 ~Keypad ()
 Destructor.
QWidget * currentWidget () const
 Returns the widget currently receiving keypad input.
QCustomLineEditeditor () const
 Returns the internal QCustomLineEdit used by the keypad for editing.
void focusInEvent (QFocusEvent *focus) override
 Handles focus-in events for the keypad widget.
bool isFullKeyboard () const
 Checks whether the keypad is currently showing a full QWERTY keyboard.
QWidget * lastWidget () const
 Returns the last widget that had keypad focus.
QSize minimumSizeHint () const override
 Returns the minimum size hint for the keypad.
void mousePressEvent (QMouseEvent *event) override
 Handles mouse press events on the keypad.
void onFocusObjectDeleted ()
 Slot called when the current focus object is destroyed.
void requestHideSignal ()
 Emitted to request that the keypad popup be hidden.
void requestHideSlot ()
 Slot that triggers the keypad popup to hide.
void requestPopupSignal ()
 Emitted to request that the keypad popup be shown.
void requestPopupSlot ()
 Slot that triggers the keypad popup to appear.
void setCurrentInputHints (Qt::InputMethodHints hints)
 Sets the input method hints that determine which keys are available.
void setLineEdit (QLineEdit *line_edit)
 Attaches the keypad to a QLineEdit for input.
void setTextEdit (QTextEdit *line_edit)
 Attaches the keypad to a QTextEdit for input.
void setUpperCase (bool uppercase)
 Sets whether the keypad displays uppercase characters.
void showSettings (PopupInfo info)
 Shows the keypad settings dialog as a popup.
QSize sizeHint () const override
 Returns the preferred size hint for the keypad.
void slideInKeyboard (uint04 value)
 Slides in a specific keyboard layout page.
void updateCurrentText ()
 Updates the displayed text to match the current target widget content.
void updateUppercase ()
 Updates the case state of keyboard letter buttons.

Static Public Member Functions

static KeypadDefaultKeypad ()
 Returns the global default Keypad instance.
static bool IsCurrentKeypadFocus (const QWidget *widget)
 Checks whether the given widget currently has keypad focus.
static bool IsKeypadInitialized ()
 Checks whether the global default keypad has been initialized.

Protected Member Functions

void addChar (char value)
 Appends a character to the current input.
void backspace ()
 Removes the last character from the current input.
void clear ()
 Clears the current input text.
void complete ()
 Accepts the current input and closes the keypad.
void focusNextWidget ()
 Moves focus to the next widget in the tab order.
void focusPreviousWidget ()
 Moves focus to the previous widget in the tab order.
void setupButton (Button *b)
 Configures a button with its default behavior.
void setupButton (Button *b, char insert_char, bool add_to_lookup=true)
 Configures a button to insert a specific character when pressed.
void unsetCurrent ()
 Detaches the keypad from its current target widget.
void updateFocusGroups ()
 Updates the focus chain groups for tab navigation.
void updateWindowTitle ()
 Updates the window title to reflect the current input context.

Protected Attributes

Dictionary< char, Button * > m_button_ids
 Mapping from characters to their corresponding buttons.
Buffer< Button * > m_buttons
 All buttons on the keypad.
String m_current_text
 The current text being edited in the keypad.
Qt::InputMethodHints m_input_hints
 The current input method hints controlling available keys.
bool m_is_file
 Whether the input context is a file path.
bool m_is_folder
 Whether the input context is a folder path.
bool m_is_full_keyboard
 Whether the full QWERTY keyboard layout is active.
KeypadSettingsm_keypad_settings = nullptr
 The keypad settings dialog.
QWidget * m_last_widget
 The last widget that had keypad focus.
QLineEdit * m_line_edit
 The currently attached QLineEdit target.
String m_original_text
 The original text before keypad editing began.
QString m_original_window_title
 The original window title before keypad was shown.
Dictionary< String, Button * > m_symbols_a
 First page of symbol buttons.
Dictionary< String, Button * > m_symbols_b
 Second page of symbol buttons.
QTextEdit * m_text_edit
 The currently attached QTextEdit target.
QTimer * m_visibility_check_timer
 Timer that periodically checks whether the keypad should be visible.
Ui::KeypadUI * ui
 The auto-generated UI form.

Detailed Description

A popup for showing a virtual keyboard or keypad.


Changes based on the allowed input to a widget. Usually shown in touch mode.

Definition at line 56 of file Keypad.h.

Constructor & Destructor Documentation

◆ Keypad()

Keypad::Keypad ( QWidget * parent = nullptr)

Constructs a Keypad widget.

Parameters
[in]parentThe parent widget.

Referenced by DefaultKeypad().

Member Function Documentation

◆ addChar()

void Keypad::addChar ( char value)
protected

Appends a character to the current input.

Parameters
[in]valueThe character to insert.

◆ currentWidget()

QWidget * Keypad::currentWidget ( ) const
nodiscard

Returns the widget currently receiving keypad input.

Returns
The current target widget, or nullptr if none.

◆ DefaultKeypad()

Keypad * Keypad::DefaultKeypad ( )
staticnodiscard

Returns the global default Keypad instance.

Returns
The default keypad.

References Keypad().

◆ editor()

QCustomLineEdit * Keypad::editor ( ) const
nodiscard

Returns the internal QCustomLineEdit used by the keypad for editing.

Returns
The keypad's line editor widget.

◆ focusInEvent()

void Keypad::focusInEvent ( QFocusEvent * focus)
override

Handles focus-in events for the keypad widget.

Parameters
[in]focusThe focus event.

◆ IsCurrentKeypadFocus()

bool Keypad::IsCurrentKeypadFocus ( const QWidget * widget)
static

Checks whether the given widget currently has keypad focus.

Parameters
[in]widgetThe widget to test.
Returns
True if the widget is the current keypad focus target.

◆ isFullKeyboard()

bool Keypad::isFullKeyboard ( ) const
inline

Checks whether the keypad is currently showing a full QWERTY keyboard.

Returns
True if the full keyboard layout is active.

Definition at line 104 of file Keypad.h.

References m_is_full_keyboard.

◆ IsKeypadInitialized()

bool Keypad::IsKeypadInitialized ( )
staticnodiscard

Checks whether the global default keypad has been initialized.

Returns
True if the default keypad exists.

◆ lastWidget()

QWidget * Keypad::lastWidget ( ) const
nodiscard

Returns the last widget that had keypad focus.

Returns
The previous target widget.

◆ minimumSizeHint()

QSize Keypad::minimumSizeHint ( ) const
override

Returns the minimum size hint for the keypad.

Returns
The minimum recommended size.

◆ mousePressEvent()

void Keypad::mousePressEvent ( QMouseEvent * event)
override

Handles mouse press events on the keypad.

Parameters
[in]eventThe mouse press event.

◆ setCurrentInputHints()

void Keypad::setCurrentInputHints ( Qt::InputMethodHints hints)

Sets the input method hints that determine which keys are available.

Parameters
[in]hintsThe Qt input method hints to apply.

◆ setLineEdit()

void Keypad::setLineEdit ( QLineEdit * line_edit)

Attaches the keypad to a QLineEdit for input.

Parameters
[in]line_editThe line edit to receive keypad input.

◆ setTextEdit()

void Keypad::setTextEdit ( QTextEdit * line_edit)

Attaches the keypad to a QTextEdit for input.

Parameters
[in]line_editThe text edit to receive keypad input.

◆ setupButton() [1/2]

void Keypad::setupButton ( Button * b)
protected

Configures a button with its default behavior.

Parameters
[in]bThe button to configure.

◆ setupButton() [2/2]

void Keypad::setupButton ( Button * b,
char insert_char,
bool add_to_lookup = true )
protected

Configures a button to insert a specific character when pressed.

Parameters
[in]bThe button to configure.
[in]insert_charThe character the button will insert.
[in]add_to_lookupWhether to add the button to the character lookup dictionary.

◆ setUpperCase()

void Keypad::setUpperCase ( bool uppercase)

Sets whether the keypad displays uppercase characters.

Parameters
[in]uppercaseTrue for uppercase, false for lowercase.

◆ showSettings()

void Keypad::showSettings ( PopupInfo info)

Shows the keypad settings dialog as a popup.

Parameters
[in]infoThe popup configuration info.

◆ sizeHint()

QSize Keypad::sizeHint ( ) const
override

Returns the preferred size hint for the keypad.

Returns
The preferred size.

◆ slideInKeyboard()

void Keypad::slideInKeyboard ( uint04 value)

Slides in a specific keyboard layout page.

Parameters
[in]valueThe index of the keyboard layout page to display.

The documentation for this class was generated from the following file: