Diffstat (limited to 'inputmethods/multikey/keyboard.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/multikey/keyboard.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/inputmethods/multikey/keyboard.h b/inputmethods/multikey/keyboard.h index 1aa7a35..8af80d0 100644 --- a/inputmethods/multikey/keyboard.h +++ b/inputmethods/multikey/keyboard.h | |||
@@ -47,55 +47,60 @@ public: | |||
47 | void initialise(); | 47 | void initialise(); |
48 | virtual QSize sizeHint() const; | 48 | virtual QSize sizeHint() const; |
49 | KeyboardConfig *dc; | 49 | KeyboardConfig *dc; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | 52 | ||
53 | class Keys { | 53 | class Keys { |
54 | public: | 54 | public: |
55 | 55 | ||
56 | Keys(); | 56 | Keys(); |
57 | Keys(const char * filename); | 57 | Keys(const char * filename); |
58 | ~Keys(); | 58 | ~Keys(); |
59 | int width(const int row, const int col); | ||
60 | int rows(); | ||
59 | ushort uni(const int row, const int col); | 61 | ushort uni(const int row, const int col); |
60 | int qcode(const int row, const int col); | 62 | int qcode(const int row, const int col); |
61 | int width(const int row, const int col); | ||
62 | bool pressed(const int row, const int col); | 63 | bool pressed(const int row, const int col); |
63 | bool *pressedPtr(const int row, const int col); | 64 | bool *pressedPtr(const int row, const int col); |
64 | ushort shift(const ushort); | 65 | ushort shift(const ushort); |
65 | ushort meta(const ushort); | 66 | ushort meta(const ushort); |
67 | ushort circumflex(const ushort); | ||
68 | ushort diaeresis(const ushort); | ||
66 | QImage *pix(const int row, const int col); | 69 | QImage *pix(const int row, const int col); |
67 | int numKeys(const int row); | 70 | int numKeys(const int row); |
68 | void setKeysFromFile(const char *filename); | 71 | void setKeysFromFile(const char *filename); |
69 | void setKey(const int row, const int qcode, const ushort unicode, | 72 | void setKey(const int row, const int qcode, const ushort unicode, |
70 | const int width, QImage *pix); | 73 | const int width, QImage *pix); |
71 | void setPressed(const int row, const int col, const bool pressed); | 74 | void setPressed(const int row, const int col, const bool pressed); |
72 | QString lang; | 75 | QString lang; |
73 | QString label; | 76 | QString label; |
74 | 77 | ||
75 | private: | 78 | private: |
76 | 79 | ||
77 | typedef struct Key { | 80 | typedef struct Key { |
78 | int qcode; // are qt key codes just unicode values? | 81 | int qcode; // are qt key codes just unicode values? |
79 | ushort unicode; | 82 | ushort unicode; |
80 | int width; // not pixels but relative key width. normal key is 2 | 83 | int width; // not pixels but relative key width. normal key is 2 |
81 | 84 | ||
82 | // only needed for keys like ctrl that can have multiple keys pressed at once | 85 | // only needed for keys like ctrl that can have multiple keys pressed at once |
83 | bool *pressed; | 86 | bool *pressed; |
84 | QImage *pix; | 87 | QImage *pix; |
85 | }; | 88 | }; |
86 | 89 | ||
87 | QList<Key> keys[6]; | 90 | QList<Key> keys[6]; |
88 | QMap<ushort,ushort> shiftMap; | 91 | QMap<ushort,ushort> shiftMap; |
89 | QMap<ushort,ushort> metaMap; | 92 | QMap<ushort,ushort> metaMap; |
93 | QMap<ushort,ushort> circumflexMap; | ||
94 | QMap<ushort,ushort> diaeresisMap; | ||
90 | 95 | ||
91 | }; | 96 | }; |
92 | 97 | ||
93 | class Keyboard : public QFrame | 98 | class Keyboard : public QFrame |
94 | { | 99 | { |
95 | Q_OBJECT | 100 | Q_OBJECT |
96 | public: | 101 | public: |
97 | Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); | 102 | Keyboard( QWidget* parent=0, const char* name=0, WFlags f=0 ); |
98 | ~Keyboard(); | 103 | ~Keyboard(); |
99 | 104 | ||
100 | void resetState(); | 105 | void resetState(); |
101 | 106 | ||
@@ -108,37 +113,41 @@ public: | |||
108 | 113 | ||
109 | QSize sizeHint() const; | 114 | QSize sizeHint() const; |
110 | 115 | ||
111 | signals: | 116 | signals: |
112 | void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool ); | 117 | void key( ushort scancode, ushort unicode, ushort modifiers, bool, bool ); |
113 | 118 | ||
114 | private slots: | 119 | private slots: |
115 | void repeat(); | 120 | void repeat(); |
116 | void togglePickboard(bool on_off); | 121 | void togglePickboard(bool on_off); |
117 | void toggleRepeat(bool on_off); | 122 | void toggleRepeat(bool on_off); |
118 | void setMapToDefault(); | 123 | void setMapToDefault(); |
119 | void setMapToFile(QString map); | 124 | void setMapToFile(QString map); |
125 | void cleanupConfigDlg(); | ||
120 | 126 | ||
121 | // used to redraw keyboard after edited colors | 127 | // used to redraw keyboard after edited colors |
122 | void reloadKeyboard(); | 128 | void reloadKeyboard(); |
123 | 129 | ||
124 | private: | 130 | private: |
125 | int getKey( int &w, int j = -1 ); | 131 | int getKey( int &w, int j = -1 ); |
126 | void clearHighlight(); | 132 | void clearHighlight(); |
127 | 133 | ||
128 | bool *shift; | 134 | bool *shift; |
129 | bool *lock; | 135 | bool *lock; |
130 | bool *ctrl; | 136 | bool *ctrl; |
131 | bool *alt; | 137 | bool *alt; |
132 | bool *meta; | 138 | bool *meta; |
139 | bool *circumflex; | ||
140 | bool *diaeresis; | ||
141 | |||
133 | uint useLargeKeys:1; | 142 | uint useLargeKeys:1; |
134 | uint usePicks:1; | 143 | uint usePicks:1; |
135 | uint useRepeat:1; | 144 | uint useRepeat:1; |
136 | 145 | ||
137 | int pressedKeyRow; | 146 | int pressedKeyRow; |
138 | int pressedKeyCol; | 147 | int pressedKeyCol; |
139 | 148 | ||
140 | KeyboardPicks *picks; | 149 | KeyboardPicks *picks; |
141 | 150 | ||
142 | int keyHeight; | 151 | int keyHeight; |
143 | int defaultKeyWidth; | 152 | int defaultKeyWidth; |
144 | int xoffs; | 153 | int xoffs; |