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;
29  Qt::KeyboardModifiers modifiers;
30 };
31 
43 {
44  Q_OBJECT
45 
46  public:
47  MythUIVirtualKeyboard(MythScreenStack *parentStack, MythUITextEdit *m_parentEdit);
48  ~MythUIVirtualKeyboard() = 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  QString decodeChar(QString c);
72  QString getKeyText(const KeyDefinition& key);
73  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
unsigned int slots[4]
Definition: element.c:38
KeyEventDefinition m_downKey
virtual bool Create(void)
KeyEventDefinition m_leftKey
PopupPosition
Preferred position to place virtual keyboard popup.
QMap< QString, KeyDefinition > m_keyMap
A text entry and edit widget.
A single button widget.
Definition: mythuibutton.h:21
KeyEventDefinition m_rightKey
bool keyPressEvent(QKeyEvent *) override
Key event handler.
#define MUI_PUBLIC
Definition: mythuiexp.h:9
Qt::KeyboardModifiers modifiers
KeyEventDefinition m_upKey
Screen in which all other widgets are contained and rendered.
A popup onscreen keyboard for easy alphanumeric and text entry using a remote control or mouse.
KeyEventDefinition m_newlineKey