MythTV  master
mythvirtualkeyboard.h
Go to the documentation of this file.
1 #ifndef MYTHUIVIRTUALKEYBOARD_H_
2 #define MYTHUIVIRTUALKEYBOARD_H_
3 
4 #include "mythscreentype.h"
5 
6 class QKeyEvent;
7 
10 {
16 };
17 
19 {
20  QString name;
21  QString type;
22  QString normal, shift, alt, altshift;
23  QString up, down, left, right;
24 };
25 
27 {
28  int keyCode {0};
29  Qt::KeyboardModifiers modifiers;
30 };
31 
43 {
44  Q_OBJECT
45 
46  public:
47  MythUIVirtualKeyboard(MythScreenStack *parentStack, MythUITextEdit *m_parentEdit);
48  ~MythUIVirtualKeyboard() override = default;
49  bool Create(void) override; // MythScreenType
50  bool keyPressEvent(QKeyEvent *e) override; // MythScreenType
51 
52  signals:
53  void keyPressed(QString key);
54 
55  protected slots:
56  void charClicked(void);
57  void shiftClicked(void);
58  void delClicked(void);
59  void lockClicked(void);
60  void altClicked(void);
61  void compClicked(void);
62  void moveleftClicked(void);
63  void moverightClicked(void);
64  void backClicked(void);
65  void returnClicked(void);
66 
67  private:
68  void loadKeyDefinitions(const QString &lang);
69  void parseKey(const QDomElement &element);
70  void updateKeys(bool connectSignals = false);
71  static QString decodeChar(QString c);
72  QString getKeyText(const KeyDefinition& key) const;
73  static void loadEventKeyDefinitions(KeyEventDefinition *keyDef, const QString &action);
74 
75  MythUITextEdit *m_parentEdit {nullptr};
77 
78  QMap<QString, KeyDefinition> m_keyMap;
79 
80  MythUIButton *m_lockButton {nullptr};
81  MythUIButton *m_altButton {nullptr};
82  MythUIButton *m_compButton {nullptr};
83  MythUIButton *m_shiftLButton {nullptr};
84  MythUIButton *m_shiftRButton {nullptr};
85 
86  bool m_shift {false};
87  bool m_alt {false};
88  bool m_lock {false};
89 
90  bool m_composing {false};
91  QString m_composeStr;
92 
98 };
99 
100 #endif
MythUIVirtualKeyboard::m_leftKey
KeyEventDefinition m_leftKey
Definition: mythvirtualkeyboard.h:95
KeyDefinition::alt
QString alt
Definition: mythvirtualkeyboard.h:22
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1420
KeyEventDefinition
Definition: mythvirtualkeyboard.h:27
KeyDefinition::shift
QString shift
Definition: mythvirtualkeyboard.h:22
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
VK_POSTOPDIALOG
@ VK_POSTOPDIALOG
Definition: mythvirtualkeyboard.h:13
KeyDefinition::normal
QString normal
Definition: mythvirtualkeyboard.h:22
VK_POSBELOWEDIT
@ VK_POSBELOWEDIT
Definition: mythvirtualkeyboard.h:12
MythUIVirtualKeyboard::~MythUIVirtualKeyboard
~MythUIVirtualKeyboard() override=default
MythScreenStack
Definition: mythscreenstack.h:16
MythScreenType::Create
virtual bool Create(void)
Definition: mythscreentype.cpp:282
KeyDefinition::right
QString right
Definition: mythvirtualkeyboard.h:23
KeyDefinition::altshift
QString altshift
Definition: mythvirtualkeyboard.h:22
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:33
MythUIVirtualKeyboard::m_upKey
KeyEventDefinition m_upKey
Definition: mythvirtualkeyboard.h:93
KeyDefinition::down
QString down
Definition: mythvirtualkeyboard.h:23
VK_POSBOTTOMDIALOG
@ VK_POSBOTTOMDIALOG
Definition: mythvirtualkeyboard.h:14
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
KeyDefinition::name
QString name
Definition: mythvirtualkeyboard.h:20
KeyEventDefinition::keyCode
int keyCode
Definition: mythvirtualkeyboard.h:28
MythUIVirtualKeyboard::m_preferredPos
PopupPosition m_preferredPos
Definition: mythvirtualkeyboard.h:76
KeyDefinition::up
QString up
Definition: mythvirtualkeyboard.h:23
MythUIVirtualKeyboard::m_newlineKey
KeyEventDefinition m_newlineKey
Definition: mythvirtualkeyboard.h:97
MythUIVirtualKeyboard::m_downKey
KeyEventDefinition m_downKey
Definition: mythvirtualkeyboard.h:94
VK_POSCENTERDIALOG
@ VK_POSCENTERDIALOG
Definition: mythvirtualkeyboard.h:15
KeyDefinition::type
QString type
Definition: mythvirtualkeyboard.h:21
MythUIButton
A single button widget.
Definition: mythuibutton.h:22
KeyDefinition
Definition: mythvirtualkeyboard.h:19
MythUIVirtualKeyboard::keyPressed
void keyPressed(QString key)
MythUIVirtualKeyboard
A popup onscreen keyboard for easy alphanumeric and text entry using a remote control or mouse.
Definition: mythvirtualkeyboard.h:43
MythUIVirtualKeyboard::m_rightKey
KeyEventDefinition m_rightKey
Definition: mythvirtualkeyboard.h:96
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:414
MythUIVirtualKeyboard::m_composeStr
QString m_composeStr
Definition: mythvirtualkeyboard.h:91
build_compdb.action
action
Definition: build_compdb.py:9
PopupPosition
PopupPosition
Preferred position to place virtual keyboard popup.
Definition: mythvirtualkeyboard.h:10
KeyDefinition::left
QString left
Definition: mythvirtualkeyboard.h:23
MythUIVirtualKeyboard::m_keyMap
QMap< QString, KeyDefinition > m_keyMap
Definition: mythvirtualkeyboard.h:78
VK_POSABOVEEDIT
@ VK_POSABOVEEDIT
Definition: mythvirtualkeyboard.h:11
KeyEventDefinition::modifiers
Qt::KeyboardModifiers modifiers
Definition: mythvirtualkeyboard.h:29
mythscreentype.h