summaryrefslogtreecommitdiff
path: root/noncore/applets/keyhelper/keyhelperconf
authoralwin <alwin>2005-02-28 09:40:30 (UTC)
committer alwin <alwin>2005-02-28 09:40:30 (UTC)
commit2b64a84d39eeed5681d0ee5068c7d11a01527750 (patch) (unidiff)
treec8693340dbc5ef5e2f9afa90b690829ddff2c4bd /noncore/applets/keyhelper/keyhelperconf
parent61fa699140c5efbb6ba0bf2a62f7e8fbf62976be (diff)
downloadopie-2b64a84d39eeed5681d0ee5068c7d11a01527750.zip
opie-2b64a84d39eeed5681d0ee5068c7d11a01527750.tar.gz
opie-2b64a84d39eeed5681d0ee5068c7d11a01527750.tar.bz2
other keymapping tool - not working this moment, I have to check it out
- the reason is that the config file is somewhat easier to understand than from zkbapplet and has a nice config tool. Please don't put it into any repositories this moment.
Diffstat (limited to 'noncore/applets/keyhelper/keyhelperconf') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/keyhelper/keyhelperconf/KHCWidget.cpp307
-rw-r--r--noncore/applets/keyhelper/keyhelperconf/KHCWidget.h68
-rw-r--r--noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.cpp162
-rw-r--r--noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.h56
-rw-r--r--noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.ui569
-rw-r--r--noncore/applets/keyhelper/keyhelperconf/KeyNames.cpp274
-rw-r--r--noncore/applets/keyhelper/keyhelperconf/KeyNames.h49
-rw-r--r--noncore/applets/keyhelper/keyhelperconf/keyhelperconf.pro13
-rw-r--r--noncore/applets/keyhelper/keyhelperconf/khcmain.cpp11
9 files changed, 1509 insertions, 0 deletions
diff --git a/noncore/applets/keyhelper/keyhelperconf/KHCWidget.cpp b/noncore/applets/keyhelper/keyhelperconf/KHCWidget.cpp
new file mode 100644
index 0000000..b0767cf
--- a/dev/null
+++ b/noncore/applets/keyhelper/keyhelperconf/KHCWidget.cpp
@@ -0,0 +1,307 @@
1#include "KHCWidget.h"
2
3KHCWidget::KHCWidget(QWidget* parent, const char* name, WFlags fl)
4 : KHCWidgetBase(parent, name, fl)
5{
6 m_isEnable = true;
7 setLayout();
8 setHandler();
9
10 txtOrgKey->installEventFilter(this);
11 txtMapKey->installEventFilter(this);
12}
13
14KHCWidget::~KHCWidget()
15{
16}
17
18void KHCWidget::setLayout()
19{
20 QBoxLayout* topLayout = new QVBoxLayout(this, 5);
21
22 QBoxLayout* orgLayout1 = new QHBoxLayout(topLayout);
23 orgLayout1->addWidget(lblOriginal);
24 orgLayout1->addWidget(txtOrgKey);
25
26 QBoxLayout* orgLayout2 = new QHBoxLayout(topLayout);
27 orgLayout2->addWidget(lblOrgK);
28 orgLayout2->addWidget(lblOrgKeycode);
29#if 0
30 orgLayout2->addWidget(lblOrgM);
31 orgLayout2->addWidget(lblOrgModifiers);
32#endif
33 orgLayout2->addWidget(lblOrgU);
34 orgLayout2->addWidget(lblOrgUnicode);
35 orgLayout2->addWidget(chkOrgShift);
36 orgLayout2->addWidget(chkOrgCtrl);
37 orgLayout2->addWidget(chkOrgAlt);
38
39 QBoxLayout* mapLayout1 = new QHBoxLayout(topLayout);
40 mapLayout1->addWidget(lblMapping);
41 mapLayout1->addWidget(txtMapKey);
42
43 QBoxLayout* mapLayout2 = new QHBoxLayout(topLayout);
44 mapLayout2->addWidget(lblMapK);
45 mapLayout2->addWidget(lblMapKeycode);
46#if 0
47 mapLayout2->addWidget(lblMapM);
48 mapLayout2->addWidget(lblMapModifiers);
49#endif
50 mapLayout2->addWidget(lblMapU);
51 mapLayout2->addWidget(lblMapUnicode);
52 mapLayout2->addWidget(chkMapShift);
53 mapLayout2->addWidget(chkMapCtrl);
54 mapLayout2->addWidget(chkMapAlt);
55
56 QBoxLayout* btnLayout = new QHBoxLayout(topLayout);
57 btnLayout->addWidget(btnGen);
58 btnLayout->addWidget(btnCopy);
59 btnLayout->addWidget(btnCtrl);
60
61 topLayout->addWidget(mleDefine);
62}
63
64void KHCWidget::setHandler()
65{
66 connect(btnGen, SIGNAL(clicked()), this, SLOT(onClick_Gen()));
67 connect(btnCopy, SIGNAL(clicked()), this, SLOT(onClick_Copy()));
68 connect(btnCtrl, SIGNAL(clicked()), this, SLOT(onClick_Ctrl()));
69}
70
71bool KHCWidget::eventFilter(QObject* o, QEvent* e)
72{
73 if(::strcmp(o->name(), "txtOrgKey") == 0){
74 if(e->type() == QEvent::KeyPress){
75 QKeyEvent* ke = (QKeyEvent*)e;
76 if(ke->isAutoRepeat() == false){
77 onPress_Org(ke);
78 }
79 return(true);
80 }
81 } else if(::strcmp(o->name(), "txtMapKey") == 0){
82 if(e->type() == QEvent::KeyPress){
83 QKeyEvent* ke = (QKeyEvent*)e;
84 if(ke->isAutoRepeat() == false){
85 onPress_Map(ke);
86 }
87 return(true);
88 }
89 }
90
91 return QWidget::eventFilter(o, e);
92}
93
94void KHCWidget::onPress_Org(QKeyEvent* ke)
95{
96 /* keycode */
97 const QString& name = KeyNames::getName(ke->key());
98 if(name == QString::null){
99 lblOrgKeycode->setText(QString::number(ke->key(), 16));
100 } else {
101 lblOrgKeycode->setText(name);
102 }
103 /* modifiers */
104 chkOrgShift->setChecked(ke->state() & Qt::ShiftButton);
105 chkOrgCtrl->setChecked(ke->state() & Qt::ControlButton);
106 chkOrgAlt->setChecked(ke->state() & Qt::AltButton);
107
108 /* unicode */
109 if(ke->text()[0].isPrint()){
110 lblOrgUnicode->setText(ke->text());
111 } else {
112 lblOrgUnicode->setText(QString::number(ke->ascii(), 16));
113 }
114 m_OrgkeyData.setData(ke);
115}
116
117void KHCWidget::onPress_Map(QKeyEvent* ke)
118{
119 /* keycode */
120 const QString& name = KeyNames::getName(ke->key());
121 if(name == QString::null){
122 lblMapKeycode->setText(QString::number(ke->key(), 16));
123 } else {
124 lblMapKeycode->setText(name);
125 }
126 /* modifiers */
127 chkMapShift->setChecked(ke->state() & Qt::ShiftButton);
128 chkMapCtrl->setChecked(ke->state() & Qt::ControlButton);
129 chkMapAlt->setChecked(ke->state() & Qt::AltButton);
130
131 /* unicode */
132 if(ke->text()[0].isPrint()){
133 lblMapUnicode->setText(ke->text());
134 } else {
135 lblMapUnicode->setText(QString::number(ke->ascii(), 16));
136 }
137 m_MapkeyData.setData(ke);
138}
139
140void KHCWidget::onClick_Gen()
141{
142 mleDefine->clear();
143 if(m_OrgkeyData.key == 0
144 || m_MapkeyData.key == 0){
145 return;
146 }
147 /* original key */
148 QString line;
149 const QString& name = KeyNames::getName(m_OrgkeyData.key);
150 line = "<define ";
151 if(name == QString::null){
152 line.append("code=\"");
153 line.append(QString::number(m_OrgkeyData.key, 16));
154 } else {
155 line.append("key=\"");
156 line.append(name);
157 }
158 line.append("\">");
159 mleDefine->append(line);
160
161 /* original modifiers */
162 bool need = false;
163 line = "<modifier";
164 if(chkOrgShift->isChecked()){
165 line.append(" Shift=\"On\"");
166 need = true;
167 }
168 if(chkOrgCtrl->isChecked()){
169 line.append(" Control=\"On\"");
170 need = true;
171 }
172 if(chkOrgAlt->isChecked()){
173 line.append(" Alt=\"On\"");
174 need = true;
175 }
176 line.append("/>");
177 if(need){
178 mleDefine->append(line);
179 }
180
181 /* mapping key */
182 const QString& mapname = KeyNames::getName(m_MapkeyData.key);
183 line = "<map";
184 if(mapname == QString::null){
185 line.append(" code=\"");
186 line.append(QString::number(m_MapkeyData.key, 16));
187 } else {
188 line.append(" key=\"");
189 line.append(mapname);
190 }
191 line.append("\"/>");
192 mleDefine->append(line);
193
194 /* mapping modifiers */
195 need = false;
196 line = "<map_modifier";
197 bool on = chkMapShift->isChecked();
198 if(chkOrgShift->isChecked() != on){
199 line.append(" Shift=\"");
200 if(on){
201 line.append("On\"");
202 } else {
203 line.append("Off\"");
204 }
205 need = true;
206 }
207 on = chkMapCtrl->isChecked();
208 if(chkOrgCtrl->isChecked() != on){
209 line.append(" Control=\"");
210 if(on){
211 line.append("On\"");
212 } else {
213 line.append("Off\"");
214 }
215 need = true;
216 }
217 on = chkMapAlt->isChecked();
218 if(chkOrgAlt->isChecked() != on){
219 line.append(" Alt=\"");
220 if(on){
221 line.append("On\"");
222 } else {
223 line.append("Off\"");
224 }
225 need = true;
226 }
227 line.append("/>");
228 if(need){
229 mleDefine->append(line);
230 }
231
232 /* mapping unicode */
233 bool found = false;
234 for(const QWSServer::KeyMap* m = QWSServer::keyMap();
235 m->key_code != 0; m++){
236 if(m->key_code == m_MapkeyData.key){
237 if(m_MapkeyData.state & Qt::ControlButton){
238 if(m->ctrl_unicode == m_MapkeyData.ascii){
239 found = true;
240 break;
241 }
242 } else if(m_MapkeyData.state & Qt::ShiftButton){
243 if(m->shift_unicode == m_MapkeyData.ascii){
244 found = true;
245 break;
246 }
247 } else {
248 if(m->unicode == m_MapkeyData.ascii){
249 found = true;
250 break;
251 }
252 }
253 }
254 }
255 if(found == false){
256 if(m_MapkeyData.text[0].isPrint()){
257 line = "<map_unicode";
258 if(m_MapkeyData.state & Qt::ControlButton){
259 line.append(" ctrl_unicode=\"");
260 } else if(m_MapkeyData.state & Qt::ShiftButton){
261 line.append(" shift_unicode=\"");
262 } else {
263 line.append(" unicode=\"");
264 }
265 line.append(m_MapkeyData.text);
266 line.append("\"/>");
267 mleDefine->append(line);
268 } else {
269 mleDefine->clear();
270 mleDefine->append("Not Support");
271 return;
272 }
273 }
274
275 /* close tag */
276 line = "</define>";
277 mleDefine->append(line);
278}
279
280void KHCWidget::onClick_Copy()
281{
282 mleDefine->selectAll();
283 mleDefine->copy();
284 mleDefine->deselect();
285}
286
287void KHCWidget::onClick_Ctrl()
288{
289 if(m_isEnable){
290 QCopEnvelope e("QPE/KeyHelper", "disable()");
291 btnCtrl->setText(tr("Enable"));
292 //btnCtrl->update();
293 } else {
294 QCopEnvelope e("QPE/KeyHelper", "enable()");
295 btnCtrl->setText(tr("Disable"));
296 //btnCtrl->update();
297 }
298 m_isEnable = !m_isEnable;
299}
300
301void KHCWidget::closeEvent(QCloseEvent* ce)
302{
303 qDebug("closeEvent()");
304 QCopEnvelope e("QPE/KeyHelper", "enable()");
305 ce->accept();
306}
307
diff --git a/noncore/applets/keyhelper/keyhelperconf/KHCWidget.h b/noncore/applets/keyhelper/keyhelperconf/KHCWidget.h
new file mode 100644
index 0000000..08b29b3
--- a/dev/null
+++ b/noncore/applets/keyhelper/keyhelperconf/KHCWidget.h
@@ -0,0 +1,68 @@
1#ifndef _KHC_WIDGET_H_
2#define _KHC_WIDGET_H_
3
4#include <stdlib.h>
5
6#include <qlabel.h>
7#include <qpushbutton.h>
8#include <qlineedit.h>
9#include <qmultilineedit.h>
10#include <qgroupbox.h>
11#include <qcheckbox.h>
12#include <qlayout.h>
13
14#include <qwindowsystem_qws.h>
15
16#include <qpe/qcopenvelope_qws.h>
17
18#include "KHCWidgetBase.h"
19#include "KeyNames.h"
20
21struct KeyData
22{
23 KeyData(){
24 key = 0;
25 state = 0;
26 ascii = 0;
27 }
28 void setData(QKeyEvent* ke) {
29 key = ke->key();
30 state = ke->state();
31 ascii = ke->ascii();
32 text = ke->text();
33 }
34 int key;
35 int state;
36 int ascii;
37 QString text;
38};
39
40class KHCWidget : public KHCWidgetBase
41{
42 Q_OBJECT
43public:
44 KHCWidget(QWidget* parent=0, const char* name=0, WFlags fl=0);
45 virtual ~KHCWidget();
46
47protected:
48 void closeEvent(QCloseEvent* ce);
49
50private:
51 void setLayout();
52 void setHandler();
53
54 void onPress_Org(QKeyEvent* ke);
55 void onPress_Map(QKeyEvent* ke);
56
57 bool eventFilter(QObject* o, QEvent* e);
58
59 bool m_isEnable;
60 KeyData m_OrgkeyData;
61 KeyData m_MapkeyData;
62private slots:
63 void onClick_Gen();
64 void onClick_Copy();
65 void onClick_Ctrl();
66};
67
68#endif /* _KHC_WIDGET_H_ */
diff --git a/noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.cpp b/noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.cpp
new file mode 100644
index 0000000..16841f1
--- a/dev/null
+++ b/noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.cpp
@@ -0,0 +1,162 @@
1/****************************************************************************
2** Form implementation generated from reading ui file 'KHCWidgetBase.ui'
3**
4** Created: Mon Feb 28 09:58:22 2005
5** by: The User Interface Compiler (uic)
6**
7** WARNING! All changes made in this file will be lost!
8****************************************************************************/
9#include "KHCWidgetBase.h"
10
11#include <qcheckbox.h>
12#include <qlabel.h>
13#include <qlineedit.h>
14#include <qmultilineedit.h>
15#include <qpushbutton.h>
16#include <qlayout.h>
17#include <qvariant.h>
18#include <qtooltip.h>
19#include <qwhatsthis.h>
20
21/*
22 * Constructs a KHCWidgetBase which is a child of 'parent', with the
23 * name 'name' and widget flags set to 'f'
24 */
25KHCWidgetBase::KHCWidgetBase( QWidget* parent, const char* name, WFlags fl )
26 : QWidget( parent, name, fl )
27{
28 if ( !name )
29 setName( "KHCWidgetBase" );
30 resize( 431, 388 );
31 setCaption( tr( "KeyHelperConf" ) );
32
33 btnCtrl = new QPushButton( this, "btnCtrl" );
34 btnCtrl->setGeometry( QRect( 280, 150, 121, 31 ) );
35 btnCtrl->setText( tr( "Disable" ) );
36
37 btnGen = new QPushButton( this, "btnGen" );
38 btnGen->setGeometry( QRect( 10, 150, 110, 31 ) );
39 btnGen->setText( tr( "Generate" ) );
40
41 btnCopy = new QPushButton( this, "btnCopy" );
42 btnCopy->setGeometry( QRect( 140, 150, 121, 31 ) );
43 btnCopy->setText( tr( "Copy" ) );
44
45 lblOrgK = new QLabel( this, "lblOrgK" );
46 lblOrgK->setGeometry( QRect( 20, 50, 50, 20 ) );
47 lblOrgK->setText( tr( "K" ) );
48
49 lblMapK = new QLabel( this, "lblMapK" );
50 lblMapK->setGeometry( QRect( 20, 120, 20, 20 ) );
51 lblMapK->setText( tr( "K" ) );
52
53 lblMapKeycode = new QLabel( this, "lblMapKeycode" );
54 lblMapKeycode->setGeometry( QRect( 40, 120, 80, 21 ) );
55 lblMapKeycode->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, lblMapKeycode->sizePolicy().hasHeightForWidth() ) );
56 lblMapKeycode->setFrameShape( QLabel::Panel );
57 lblMapKeycode->setFrameShadow( QLabel::Sunken );
58 lblMapKeycode->setText( tr( "keycode" ) );
59
60 txtMapKey = new QLineEdit( this, "txtMapKey" );
61 txtMapKey->setGeometry( QRect( 200, 80, 200, 22 ) );
62
63 txtOrgKey = new QLineEdit( this, "txtOrgKey" );
64 txtOrgKey->setGeometry( QRect( 190, 10, 200, 22 ) );
65
66 lblOriginal = new QLabel( this, "lblOriginal" );
67 lblOriginal->setGeometry( QRect( 10, 10, 120, 31 ) );
68 lblOriginal->setFrameShape( QLabel::Box );
69 lblOriginal->setFrameShadow( QLabel::Raised );
70 lblOriginal->setText( tr( "Original Key" ) );
71
72 lblMapping = new QLabel( this, "lblMapping" );
73 lblMapping->setGeometry( QRect( 10, 80, 120, 21 ) );
74 lblMapping->setFrameShape( QLabel::Box );
75 lblMapping->setFrameShadow( QLabel::Raised );
76 lblMapping->setText( tr( "Mapping Key" ) );
77
78 mleDefine = new QMultiLineEdit( this, "mleDefine" );
79 mleDefine->setGeometry( QRect( 10, 200, 391, 110 ) );
80 mleDefine->setReadOnly( TRUE );
81
82 lblOrgKeycode = new QLabel( this, "lblOrgKeycode" );
83 lblOrgKeycode->setGeometry( QRect( 50, 50, 70, 21 ) );
84 lblOrgKeycode->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, lblOrgKeycode->sizePolicy().hasHeightForWidth() ) );
85 lblOrgKeycode->setFrameShape( QLabel::Panel );
86 lblOrgKeycode->setFrameShadow( QLabel::Sunken );
87 lblOrgKeycode->setText( tr( "keycode" ) );
88
89 lblOrgU = new QLabel( this, "lblOrgU" );
90 lblOrgU->setGeometry( QRect( 130, 50, 20, 21 ) );
91 lblOrgU->setText( tr( "U" ) );
92
93 lblOrgUnicode = new QLabel( this, "lblOrgUnicode" );
94 lblOrgUnicode->setGeometry( QRect( 150, 50, 80, 21 ) );
95 lblOrgUnicode->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, lblOrgUnicode->sizePolicy().hasHeightForWidth() ) );
96 lblOrgUnicode->setFrameShape( QLabel::Panel );
97 lblOrgUnicode->setFrameShadow( QLabel::Sunken );
98 lblOrgUnicode->setText( tr( "unicode" ) );
99
100 lblMapU = new QLabel( this, "lblMapU" );
101 lblMapU->setGeometry( QRect( 130, 120, 20, 21 ) );
102 lblMapU->setText( tr( "U" ) );
103
104 lblMapUnicode = new QLabel( this, "lblMapUnicode" );
105 lblMapUnicode->setGeometry( QRect( 150, 120, 80, 21 ) );
106 lblMapUnicode->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, lblMapUnicode->sizePolicy().hasHeightForWidth() ) );
107 lblMapUnicode->setFrameShape( QLabel::Panel );
108 lblMapUnicode->setFrameShadow( QLabel::Sunken );
109 lblMapUnicode->setText( tr( "unicode" ) );
110
111 chkMapShift = new QCheckBox( this, "chkMapShift" );
112 chkMapShift->setGeometry( QRect( 260, 120, 33, 19 ) );
113 chkMapShift->setText( tr( "S" ) );
114 chkMapShift->setAutoResize( TRUE );
115
116 chkMapCtrl = new QCheckBox( this, "chkMapCtrl" );
117 chkMapCtrl->setGeometry( QRect( 310, 120, 34, 19 ) );
118 chkMapCtrl->setText( tr( "C" ) );
119 chkMapCtrl->setAutoResize( TRUE );
120
121 chkMapAlt = new QCheckBox( this, "chkMapAlt" );
122 chkMapAlt->setGeometry( QRect( 360, 120, 34, 19 ) );
123 chkMapAlt->setText( tr( "A" ) );
124 chkMapAlt->setAutoResize( TRUE );
125
126 chkOrgShift = new QCheckBox( this, "chkOrgShift" );
127 chkOrgShift->setGeometry( QRect( 250, 50, 33, 19 ) );
128 chkOrgShift->setText( tr( "S" ) );
129 chkOrgShift->setAutoResize( TRUE );
130
131 chkOrgCtrl = new QCheckBox( this, "chkOrgCtrl" );
132 chkOrgCtrl->setGeometry( QRect( 300, 50, 34, 19 ) );
133 chkOrgCtrl->setText( tr( "C" ) );
134 chkOrgCtrl->setAutoResize( TRUE );
135
136 chkOrgAlt = new QCheckBox( this, "chkOrgAlt" );
137 chkOrgAlt->setGeometry( QRect( 350, 50, 34, 19 ) );
138 chkOrgAlt->setText( tr( "A" ) );
139 chkOrgAlt->setAutoResize( TRUE );
140
141 // tab order
142 setTabOrder( txtOrgKey, chkOrgShift );
143 setTabOrder( chkOrgShift, chkOrgCtrl );
144 setTabOrder( chkOrgCtrl, chkOrgAlt );
145 setTabOrder( chkOrgAlt, txtMapKey );
146 setTabOrder( txtMapKey, chkMapShift );
147 setTabOrder( chkMapShift, chkMapCtrl );
148 setTabOrder( chkMapCtrl, chkMapAlt );
149 setTabOrder( chkMapAlt, btnGen );
150 setTabOrder( btnGen, btnCopy );
151 setTabOrder( btnCopy, btnCtrl );
152 setTabOrder( btnCtrl, mleDefine );
153}
154
155/*
156 * Destroys the object and frees any allocated resources
157 */
158KHCWidgetBase::~KHCWidgetBase()
159{
160 // no need to delete child widgets, Qt does it all for us
161}
162
diff --git a/noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.h b/noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.h
new file mode 100644
index 0000000..8193b61
--- a/dev/null
+++ b/noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.h
@@ -0,0 +1,56 @@
1/****************************************************************************
2** Form interface generated from reading ui file 'KHCWidgetBase.ui'
3**
4** Created: Mon Feb 28 09:54:07 2005
5** by: The User Interface Compiler (uic)
6**
7** WARNING! All changes made in this file will be lost!
8****************************************************************************/
9#ifndef KHCWIDGETBASE_H
10#define KHCWIDGETBASE_H
11
12#include <qvariant.h>
13#include <qwidget.h>
14class QVBoxLayout;
15class QHBoxLayout;
16class QGridLayout;
17class QCheckBox;
18class QLabel;
19class QLineEdit;
20class QMultiLineEdit;
21class QPushButton;
22
23class KHCWidgetBase : public QWidget
24{
25 Q_OBJECT
26
27public:
28 KHCWidgetBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
29 ~KHCWidgetBase();
30
31 QPushButton* btnCtrl;
32 QPushButton* btnGen;
33 QPushButton* btnCopy;
34 QLabel* lblOrgK;
35 QLabel* lblMapK;
36 QLabel* lblMapKeycode;
37 QLineEdit* txtMapKey;
38 QLineEdit* txtOrgKey;
39 QLabel* lblOriginal;
40 QLabel* lblMapping;
41 QMultiLineEdit* mleDefine;
42 QLabel* lblOrgKeycode;
43 QLabel* lblOrgU;
44 QLabel* lblOrgUnicode;
45 QLabel* lblMapU;
46 QLabel* lblMapUnicode;
47 QCheckBox* chkMapShift;
48 QCheckBox* chkMapCtrl;
49 QCheckBox* chkMapAlt;
50 QCheckBox* chkOrgShift;
51 QCheckBox* chkOrgCtrl;
52 QCheckBox* chkOrgAlt;
53
54};
55
56#endif // KHCWIDGETBASE_H
diff --git a/noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.ui b/noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.ui
new file mode 100644
index 0000000..2be0772
--- a/dev/null
+++ b/noncore/applets/keyhelper/keyhelperconf/KHCWidgetBase.ui
@@ -0,0 +1,569 @@
1<!DOCTYPE UI><UI>
2<class>KHCWidgetBase</class>
3<widget>
4 <class>QWidget</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>KHCWidgetBase</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>431</width>
15 <height>388</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>KeyHelperConf</string>
21 </property>
22 <widget>
23 <class>QPushButton</class>
24 <property stdset="1">
25 <name>name</name>
26 <cstring>btnCtrl</cstring>
27 </property>
28 <property stdset="1">
29 <name>geometry</name>
30 <rect>
31 <x>280</x>
32 <y>150</y>
33 <width>121</width>
34 <height>31</height>
35 </rect>
36 </property>
37 <property stdset="1">
38 <name>text</name>
39 <string>Disable</string>
40 </property>
41 </widget>
42 <widget>
43 <class>QPushButton</class>
44 <property stdset="1">
45 <name>name</name>
46 <cstring>btnGen</cstring>
47 </property>
48 <property stdset="1">
49 <name>geometry</name>
50 <rect>
51 <x>10</x>
52 <y>150</y>
53 <width>110</width>
54 <height>31</height>
55 </rect>
56 </property>
57 <property stdset="1">
58 <name>text</name>
59 <string>Generate</string>
60 </property>
61 </widget>
62 <widget>
63 <class>QPushButton</class>
64 <property stdset="1">
65 <name>name</name>
66 <cstring>btnCopy</cstring>
67 </property>
68 <property stdset="1">
69 <name>geometry</name>
70 <rect>
71 <x>140</x>
72 <y>150</y>
73 <width>121</width>
74 <height>31</height>
75 </rect>
76 </property>
77 <property stdset="1">
78 <name>text</name>
79 <string>Copy</string>
80 </property>
81 </widget>
82 <widget>
83 <class>QLabel</class>
84 <property stdset="1">
85 <name>name</name>
86 <cstring>lblOrgK</cstring>
87 </property>
88 <property stdset="1">
89 <name>geometry</name>
90 <rect>
91 <x>20</x>
92 <y>50</y>
93 <width>50</width>
94 <height>20</height>
95 </rect>
96 </property>
97 <property stdset="1">
98 <name>text</name>
99 <string>K</string>
100 </property>
101 </widget>
102 <widget>
103 <class>QLabel</class>
104 <property stdset="1">
105 <name>name</name>
106 <cstring>lblMapK</cstring>
107 </property>
108 <property stdset="1">
109 <name>geometry</name>
110 <rect>
111 <x>20</x>
112 <y>120</y>
113 <width>20</width>
114 <height>20</height>
115 </rect>
116 </property>
117 <property stdset="1">
118 <name>text</name>
119 <string>K</string>
120 </property>
121 </widget>
122 <widget>
123 <class>QLabel</class>
124 <property stdset="1">
125 <name>name</name>
126 <cstring>lblMapKeycode</cstring>
127 </property>
128 <property stdset="1">
129 <name>geometry</name>
130 <rect>
131 <x>40</x>
132 <y>120</y>
133 <width>80</width>
134 <height>21</height>
135 </rect>
136 </property>
137 <property stdset="1">
138 <name>sizePolicy</name>
139 <sizepolicy>
140 <hsizetype>7</hsizetype>
141 <vsizetype>1</vsizetype>
142 </sizepolicy>
143 </property>
144 <property stdset="1">
145 <name>frameShape</name>
146 <enum>Panel</enum>
147 </property>
148 <property stdset="1">
149 <name>frameShadow</name>
150 <enum>Sunken</enum>
151 </property>
152 <property stdset="1">
153 <name>text</name>
154 <string>keycode</string>
155 </property>
156 </widget>
157 <widget>
158 <class>QLineEdit</class>
159 <property stdset="1">
160 <name>name</name>
161 <cstring>txtMapKey</cstring>
162 </property>
163 <property stdset="1">
164 <name>geometry</name>
165 <rect>
166 <x>200</x>
167 <y>80</y>
168 <width>200</width>
169 <height>22</height>
170 </rect>
171 </property>
172 </widget>
173 <widget>
174 <class>QLineEdit</class>
175 <property stdset="1">
176 <name>name</name>
177 <cstring>txtOrgKey</cstring>
178 </property>
179 <property stdset="1">
180 <name>geometry</name>
181 <rect>
182 <x>190</x>
183 <y>10</y>
184 <width>200</width>
185 <height>22</height>
186 </rect>
187 </property>
188 </widget>
189 <widget>
190 <class>QLabel</class>
191 <property stdset="1">
192 <name>name</name>
193 <cstring>lblOriginal</cstring>
194 </property>
195 <property stdset="1">
196 <name>geometry</name>
197 <rect>
198 <x>10</x>
199 <y>10</y>
200 <width>120</width>
201 <height>31</height>
202 </rect>
203 </property>
204 <property stdset="1">
205 <name>frameShape</name>
206 <enum>Box</enum>
207 </property>
208 <property stdset="1">
209 <name>frameShadow</name>
210 <enum>Raised</enum>
211 </property>
212 <property stdset="1">
213 <name>text</name>
214 <string>Original Key</string>
215 </property>
216 </widget>
217 <widget>
218 <class>QLabel</class>
219 <property stdset="1">
220 <name>name</name>
221 <cstring>lblMapping</cstring>
222 </property>
223 <property stdset="1">
224 <name>geometry</name>
225 <rect>
226 <x>10</x>
227 <y>80</y>
228 <width>120</width>
229 <height>21</height>
230 </rect>
231 </property>
232 <property stdset="1">
233 <name>frameShape</name>
234 <enum>Box</enum>
235 </property>
236 <property stdset="1">
237 <name>frameShadow</name>
238 <enum>Raised</enum>
239 </property>
240 <property stdset="1">
241 <name>text</name>
242 <string>Mapping Key</string>
243 </property>
244 </widget>
245 <widget>
246 <class>QMultiLineEdit</class>
247 <property stdset="1">
248 <name>name</name>
249 <cstring>mleDefine</cstring>
250 </property>
251 <property stdset="1">
252 <name>geometry</name>
253 <rect>
254 <x>10</x>
255 <y>200</y>
256 <width>391</width>
257 <height>110</height>
258 </rect>
259 </property>
260 <property stdset="1">
261 <name>readOnly</name>
262 <bool>true</bool>
263 </property>
264 </widget>
265 <widget>
266 <class>QLabel</class>
267 <property stdset="1">
268 <name>name</name>
269 <cstring>lblOrgKeycode</cstring>
270 </property>
271 <property stdset="1">
272 <name>geometry</name>
273 <rect>
274 <x>50</x>
275 <y>50</y>
276 <width>70</width>
277 <height>21</height>
278 </rect>
279 </property>
280 <property stdset="1">
281 <name>sizePolicy</name>
282 <sizepolicy>
283 <hsizetype>7</hsizetype>
284 <vsizetype>1</vsizetype>
285 </sizepolicy>
286 </property>
287 <property stdset="1">
288 <name>frameShape</name>
289 <enum>Panel</enum>
290 </property>
291 <property stdset="1">
292 <name>frameShadow</name>
293 <enum>Sunken</enum>
294 </property>
295 <property stdset="1">
296 <name>text</name>
297 <string>keycode</string>
298 </property>
299 </widget>
300 <widget>
301 <class>QLabel</class>
302 <property stdset="1">
303 <name>name</name>
304 <cstring>lblOrgU</cstring>
305 </property>
306 <property stdset="1">
307 <name>geometry</name>
308 <rect>
309 <x>130</x>
310 <y>50</y>
311 <width>20</width>
312 <height>21</height>
313 </rect>
314 </property>
315 <property stdset="1">
316 <name>text</name>
317 <string>U</string>
318 </property>
319 </widget>
320 <widget>
321 <class>QLabel</class>
322 <property stdset="1">
323 <name>name</name>
324 <cstring>lblOrgUnicode</cstring>
325 </property>
326 <property stdset="1">
327 <name>geometry</name>
328 <rect>
329 <x>150</x>
330 <y>50</y>
331 <width>80</width>
332 <height>21</height>
333 </rect>
334 </property>
335 <property stdset="1">
336 <name>sizePolicy</name>
337 <sizepolicy>
338 <hsizetype>7</hsizetype>
339 <vsizetype>1</vsizetype>
340 </sizepolicy>
341 </property>
342 <property stdset="1">
343 <name>frameShape</name>
344 <enum>Panel</enum>
345 </property>
346 <property stdset="1">
347 <name>frameShadow</name>
348 <enum>Sunken</enum>
349 </property>
350 <property stdset="1">
351 <name>text</name>
352 <string>unicode</string>
353 </property>
354 </widget>
355 <widget>
356 <class>QLabel</class>
357 <property stdset="1">
358 <name>name</name>
359 <cstring>lblMapU</cstring>
360 </property>
361 <property stdset="1">
362 <name>geometry</name>
363 <rect>
364 <x>130</x>
365 <y>120</y>
366 <width>20</width>
367 <height>21</height>
368 </rect>
369 </property>
370 <property stdset="1">
371 <name>text</name>
372 <string>U</string>
373 </property>
374 </widget>
375 <widget>
376 <class>QLabel</class>
377 <property stdset="1">
378 <name>name</name>
379 <cstring>lblMapUnicode</cstring>
380 </property>
381 <property stdset="1">
382 <name>geometry</name>
383 <rect>
384 <x>150</x>
385 <y>120</y>
386 <width>80</width>
387 <height>21</height>
388 </rect>
389 </property>
390 <property stdset="1">
391 <name>sizePolicy</name>
392 <sizepolicy>
393 <hsizetype>7</hsizetype>
394 <vsizetype>1</vsizetype>
395 </sizepolicy>
396 </property>
397 <property stdset="1">
398 <name>frameShape</name>
399 <enum>Panel</enum>
400 </property>
401 <property stdset="1">
402 <name>frameShadow</name>
403 <enum>Sunken</enum>
404 </property>
405 <property stdset="1">
406 <name>text</name>
407 <string>unicode</string>
408 </property>
409 </widget>
410 <widget>
411 <class>QCheckBox</class>
412 <property stdset="1">
413 <name>name</name>
414 <cstring>chkMapShift</cstring>
415 </property>
416 <property stdset="1">
417 <name>geometry</name>
418 <rect>
419 <x>260</x>
420 <y>120</y>
421 <width>33</width>
422 <height>19</height>
423 </rect>
424 </property>
425 <property stdset="1">
426 <name>text</name>
427 <string>S</string>
428 </property>
429 <property stdset="1">
430 <name>autoResize</name>
431 <bool>true</bool>
432 </property>
433 </widget>
434 <widget>
435 <class>QCheckBox</class>
436 <property stdset="1">
437 <name>name</name>
438 <cstring>chkMapCtrl</cstring>
439 </property>
440 <property stdset="1">
441 <name>geometry</name>
442 <rect>
443 <x>310</x>
444 <y>120</y>
445 <width>34</width>
446 <height>19</height>
447 </rect>
448 </property>
449 <property stdset="1">
450 <name>text</name>
451 <string>C</string>
452 </property>
453 <property stdset="1">
454 <name>autoResize</name>
455 <bool>true</bool>
456 </property>
457 </widget>
458 <widget>
459 <class>QCheckBox</class>
460 <property stdset="1">
461 <name>name</name>
462 <cstring>chkMapAlt</cstring>
463 </property>
464 <property stdset="1">
465 <name>geometry</name>
466 <rect>
467 <x>360</x>
468 <y>120</y>
469 <width>34</width>
470 <height>19</height>
471 </rect>
472 </property>
473 <property stdset="1">
474 <name>text</name>
475 <string>A</string>
476 </property>
477 <property stdset="1">
478 <name>autoResize</name>
479 <bool>true</bool>
480 </property>
481 </widget>
482 <widget>
483 <class>QCheckBox</class>
484 <property stdset="1">
485 <name>name</name>
486 <cstring>chkOrgShift</cstring>
487 </property>
488 <property stdset="1">
489 <name>geometry</name>
490 <rect>
491 <x>250</x>
492 <y>50</y>
493 <width>33</width>
494 <height>19</height>
495 </rect>
496 </property>
497 <property stdset="1">
498 <name>text</name>
499 <string>S</string>
500 </property>
501 <property stdset="1">
502 <name>autoResize</name>
503 <bool>true</bool>
504 </property>
505 </widget>
506 <widget>
507 <class>QCheckBox</class>
508 <property stdset="1">
509 <name>name</name>
510 <cstring>chkOrgCtrl</cstring>
511 </property>
512 <property stdset="1">
513 <name>geometry</name>
514 <rect>
515 <x>300</x>
516 <y>50</y>
517 <width>34</width>
518 <height>19</height>
519 </rect>
520 </property>
521 <property stdset="1">
522 <name>text</name>
523 <string>C</string>
524 </property>
525 <property stdset="1">
526 <name>autoResize</name>
527 <bool>true</bool>
528 </property>
529 </widget>
530 <widget>
531 <class>QCheckBox</class>
532 <property stdset="1">
533 <name>name</name>
534 <cstring>chkOrgAlt</cstring>
535 </property>
536 <property stdset="1">
537 <name>geometry</name>
538 <rect>
539 <x>350</x>
540 <y>50</y>
541 <width>34</width>
542 <height>19</height>
543 </rect>
544 </property>
545 <property stdset="1">
546 <name>text</name>
547 <string>A</string>
548 </property>
549 <property stdset="1">
550 <name>autoResize</name>
551 <bool>true</bool>
552 </property>
553 </widget>
554</widget>
555<tabstops>
556 <tabstop>txtOrgKey</tabstop>
557 <tabstop>chkOrgShift</tabstop>
558 <tabstop>chkOrgCtrl</tabstop>
559 <tabstop>chkOrgAlt</tabstop>
560 <tabstop>txtMapKey</tabstop>
561 <tabstop>chkMapShift</tabstop>
562 <tabstop>chkMapCtrl</tabstop>
563 <tabstop>chkMapAlt</tabstop>
564 <tabstop>btnGen</tabstop>
565 <tabstop>btnCopy</tabstop>
566 <tabstop>btnCtrl</tabstop>
567 <tabstop>mleDefine</tabstop>
568</tabstops>
569</UI>
diff --git a/noncore/applets/keyhelper/keyhelperconf/KeyNames.cpp b/noncore/applets/keyhelper/keyhelperconf/KeyNames.cpp
new file mode 100644
index 0000000..e3d90b4
--- a/dev/null
+++ b/noncore/applets/keyhelper/keyhelperconf/KeyNames.cpp
@@ -0,0 +1,274 @@
1#include "KeyNames.h"
2
3QMap<QString, int> KeyNames::codemap;
4QMap<int, QString> KeyNames::namemap;
5
6static struct {
7 int code;
8 char* name;
9} stKeyNames[] = {
10{Qt::Key_Escape, "Escape"},
11{Qt::Key_Tab, "Tab"},
12{Qt::Key_Backtab, "Backtab"},
13{Qt::Key_BackTab, "BackTab"},
14{Qt::Key_Backtab, "Backtab"},
15{Qt::Key_Backspace, "Backspace"},
16{Qt::Key_BackSpace, "BackSpace"},
17{Qt::Key_Backspace, "Backspace"},
18{Qt::Key_Return, "Return"},
19{Qt::Key_Enter, "Enter"},
20{Qt::Key_Insert, "Insert"},
21{Qt::Key_Delete, "Delete"},
22{Qt::Key_Pause, "Pause"},
23{Qt::Key_Print, "Print"},
24{Qt::Key_SysReq, "SysReq"},
25{Qt::Key_Home, "Home"},
26{Qt::Key_End, "End"},
27{Qt::Key_Left, "Left"},
28{Qt::Key_Up, "Up"},
29{Qt::Key_Right, "Right"},
30{Qt::Key_Down, "Down"},
31{Qt::Key_Prior, "Prior"},
32{Qt::Key_PageUp, "PageUp"},
33{Qt::Key_Prior, "Prior"},
34{Qt::Key_Next, "Next"},
35{Qt::Key_PageDown, "PageDown"},
36{Qt::Key_Next, "Next"},
37{Qt::Key_Shift, "Shift"},
38{Qt::Key_Control, "Control"},
39{Qt::Key_Meta, "Meta"},
40{Qt::Key_Alt, "Alt"},
41{Qt::Key_CapsLock, "CapsLock"},
42{Qt::Key_NumLock, "NumLock"},
43{Qt::Key_ScrollLock, "ScrollLock"},
44{Qt::Key_F1, "F1"},
45{Qt::Key_F2, "F2"},
46{Qt::Key_F3, "F3"},
47{Qt::Key_F4, "F4"},
48{Qt::Key_F5, "F5"},
49{Qt::Key_F6, "F6"},
50{Qt::Key_F7, "F7"},
51{Qt::Key_F8, "F8"},
52{Qt::Key_F9, "F9"},
53{Qt::Key_F10, "F10"},
54{Qt::Key_F11, "F11"},
55{Qt::Key_F12, "F12"},
56{Qt::Key_F13, "F13"},
57{Qt::Key_F14, "F14"},
58{Qt::Key_F15, "F15"},
59{Qt::Key_F16, "F16"},
60{Qt::Key_F17, "F17"},
61{Qt::Key_F18, "F18"},
62{Qt::Key_F19, "F19"},
63{Qt::Key_F20, "F20"},
64{Qt::Key_F21, "F21"},
65{Qt::Key_F22, "F22"},
66{Qt::Key_F23, "F23"},
67{Qt::Key_F24, "F24"},
68{Qt::Key_F25, "F25"},
69{Qt::Key_F26, "F26"},
70{Qt::Key_F27, "F27"},
71{Qt::Key_F28, "F28"},
72{Qt::Key_F29, "F29"},
73{Qt::Key_F30, "F30"},
74{Qt::Key_F31, "F31"},
75{Qt::Key_F32, "F32"},
76{Qt::Key_F33, "F33"},
77{Qt::Key_F34, "F34"},
78{Qt::Key_F35, "F35"},
79{Qt::Key_Super_L, "Super_L"},
80{Qt::Key_Super_R, "Super_R"},
81{Qt::Key_Menu, "Menu"},
82{Qt::Key_Hyper_L, "Hyper_L"},
83{Qt::Key_Hyper_R, "Hyper_R"},
84{Qt::Key_Help, "Help"},
85{Qt::Key_Space, "Space"},
86{Qt::Key_Any, "Any"},
87{Qt::Key_Space, "Space"},
88{Qt::Key_Exclam, "Exclam"},
89{Qt::Key_QuoteDbl, "QuoteDbl"},
90{Qt::Key_NumberSign, "NumberSign"},
91{Qt::Key_Dollar, "Dollar"},
92{Qt::Key_Percent, "Percent"},
93{Qt::Key_Ampersand, "Ampersand"},
94{Qt::Key_Apostrophe, "Apostrophe"},
95{Qt::Key_ParenLeft, "ParenLeft"},
96{Qt::Key_ParenRight, "ParenRight"},
97{Qt::Key_Asterisk, "Asterisk"},
98{Qt::Key_Plus, "Plus"},
99{Qt::Key_Comma, "Comma"},
100{Qt::Key_Minus, "Minus"},
101{Qt::Key_Period, "Period"},
102{Qt::Key_Slash, "Slash"},
103{Qt::Key_0, "0"},
104{Qt::Key_1, "1"},
105{Qt::Key_2, "2"},
106{Qt::Key_3, "3"},
107{Qt::Key_4, "4"},
108{Qt::Key_5, "5"},
109{Qt::Key_6, "6"},
110{Qt::Key_7, "7"},
111{Qt::Key_8, "8"},
112{Qt::Key_9, "9"},
113{Qt::Key_Colon, "Colon"},
114{Qt::Key_Semicolon, "Semicolon"},
115{Qt::Key_Less, "Less"},
116{Qt::Key_Equal, "Equal"},
117{Qt::Key_Greater, "Greater"},
118{Qt::Key_Question, "Question"},
119{Qt::Key_At, "At"},
120{Qt::Key_A, "A"},
121{Qt::Key_B, "B"},
122{Qt::Key_C, "C"},
123{Qt::Key_D, "D"},
124{Qt::Key_E, "E"},
125{Qt::Key_F, "F"},
126{Qt::Key_G, "G"},
127{Qt::Key_H, "H"},
128{Qt::Key_I, "I"},
129{Qt::Key_J, "J"},
130{Qt::Key_K, "K"},
131{Qt::Key_L, "L"},
132{Qt::Key_M, "M"},
133{Qt::Key_N, "N"},
134{Qt::Key_O, "O"},
135{Qt::Key_P, "P"},
136{Qt::Key_Q, "Q"},
137{Qt::Key_R, "R"},
138{Qt::Key_S, "S"},
139{Qt::Key_T, "T"},
140{Qt::Key_U, "U"},
141{Qt::Key_V, "V"},
142{Qt::Key_W, "W"},
143{Qt::Key_X, "X"},
144{Qt::Key_Y, "Y"},
145{Qt::Key_Z, "Z"},
146{Qt::Key_BracketLeft, "BracketLeft"},
147{Qt::Key_Backslash, "Backslash"},
148{Qt::Key_BracketRight, "BracketRight"},
149{Qt::Key_AsciiCircum, "AsciiCircum"},
150{Qt::Key_Underscore, "Underscore"},
151{Qt::Key_QuoteLeft, "QuoteLeft"},
152{Qt::Key_BraceLeft, "BraceLeft"},
153{Qt::Key_Bar, "Bar"},
154{Qt::Key_BraceRight, "BraceRight"},
155{Qt::Key_AsciiTilde, "AsciiTilde"},
156{Qt::Key_nobreakspace, "nobreakspace"},
157{Qt::Key_exclamdown, "exclamdown"},
158{Qt::Key_cent, "cent"},
159{Qt::Key_sterling, "sterling"},
160{Qt::Key_currency, "currency"},
161{Qt::Key_yen, "yen"},
162{Qt::Key_brokenbar, "brokenbar"},
163{Qt::Key_section, "section"},
164{Qt::Key_diaeresis, "diaeresis"},
165{Qt::Key_copyright, "copyright"},
166{Qt::Key_ordfeminine, "ordfeminine"},
167{Qt::Key_guillemotleft, "guillemotleft"},
168{Qt::Key_notsign, "notsign"},
169{Qt::Key_hyphen, "hyphen"},
170{Qt::Key_registered, "registered"},
171{Qt::Key_macron, "macron"},
172{Qt::Key_degree, "degree"},
173{Qt::Key_plusminus, "plusminus"},
174{Qt::Key_twosuperior, "twosuperior"},
175{Qt::Key_threesuperior, "threesuperior"},
176{Qt::Key_acute, "acute"},
177{Qt::Key_mu, "mu"},
178{Qt::Key_paragraph, "paragraph"},
179{Qt::Key_periodcentered, "periodcentered"},
180{Qt::Key_cedilla, "cedilla"},
181{Qt::Key_onesuperior, "onesuperior"},
182{Qt::Key_masculine, "masculine"},
183{Qt::Key_guillemotright, "guillemotright"},
184{Qt::Key_onequarter, "onequarter"},
185{Qt::Key_onehalf, "onehalf"},
186{Qt::Key_threequarters, "threequarters"},
187{Qt::Key_questiondown, "questiondown"},
188{Qt::Key_Agrave, "Agrave"},
189{Qt::Key_Aacute, "Aacute"},
190{Qt::Key_Acircumflex, "Acircumflex"},
191{Qt::Key_Atilde, "Atilde"},
192{Qt::Key_Adiaeresis, "Adiaeresis"},
193{Qt::Key_Aring, "Aring"},
194{Qt::Key_AE, "AE"},
195{Qt::Key_Ccedilla, "Ccedilla"},
196{Qt::Key_Egrave, "Egrave"},
197{Qt::Key_Eacute, "Eacute"},
198{Qt::Key_Ecircumflex, "Ecircumflex"},
199{Qt::Key_Ediaeresis, "Ediaeresis"},
200{Qt::Key_Igrave, "Igrave"},
201{Qt::Key_Iacute, "Iacute"},
202{Qt::Key_Icircumflex, "Icircumflex"},
203{Qt::Key_Idiaeresis, "Idiaeresis"},
204{Qt::Key_ETH, "ETH"},
205{Qt::Key_Ntilde, "Ntilde"},
206{Qt::Key_Ograve, "Ograve"},
207{Qt::Key_Oacute, "Oacute"},
208{Qt::Key_Ocircumflex, "Ocircumflex"},
209{Qt::Key_Otilde, "Otilde"},
210{Qt::Key_Odiaeresis, "Odiaeresis"},
211{Qt::Key_multiply, "multiply"},
212{Qt::Key_Ooblique, "Ooblique"},
213{Qt::Key_Ugrave, "Ugrave"},
214{Qt::Key_Uacute, "Uacute"},
215{Qt::Key_Ucircumflex, "Ucircumflex"},
216{Qt::Key_Udiaeresis, "Udiaeresis"},
217{Qt::Key_Yacute, "Yacute"},
218{Qt::Key_THORN, "THORN"},
219{Qt::Key_ssharp, "ssharp"},
220{Qt::Key_agrave, "agrave"},
221{Qt::Key_aacute, "aacute"},
222{Qt::Key_acircumflex, "acircumflex"},
223{Qt::Key_atilde, "atilde"},
224{Qt::Key_adiaeresis, "adiaeresis"},
225{Qt::Key_aring, "aring"},
226{Qt::Key_ae, "ae"},
227{Qt::Key_ccedilla, "ccedilla"},
228{Qt::Key_egrave, "egrave"},
229{Qt::Key_eacute, "eacute"},
230{Qt::Key_ecircumflex, "ecircumflex"},
231{Qt::Key_ediaeresis, "ediaeresis"},
232{Qt::Key_igrave, "igrave"},
233{Qt::Key_iacute, "iacute"},
234{Qt::Key_icircumflex, "icircumflex"},
235{Qt::Key_idiaeresis, "idiaeresis"},
236{Qt::Key_eth, "eth"},
237{Qt::Key_ntilde, "ntilde"},
238{Qt::Key_ograve, "ograve"},
239{Qt::Key_oacute, "oacute"},
240{Qt::Key_ocircumflex, "ocircumflex"},
241{Qt::Key_otilde, "otilde"},
242{Qt::Key_odiaeresis, "odiaeresis"},
243{Qt::Key_division, "division"},
244{Qt::Key_oslash, "oslash"},
245{Qt::Key_ugrave, "ugrave"},
246{Qt::Key_uacute, "uacute"},
247{Qt::Key_ucircumflex, "ucircumflex"},
248{Qt::Key_udiaeresis, "udiaeresis"},
249{Qt::Key_yacute, "yacute"},
250{Qt::Key_thorn, "thorn"},
251{Qt::Key_ydiaeresis, "ydiaeresis"},
252{Qt::Key_unknown, "unknown"},
253{0,0},
254};
255
256void KeyNames::setCodeMap()
257{
258 int i;
259
260 codemap.clear();
261 for(i=0; stKeyNames[i].code != 0; i++){
262 codemap.insert(stKeyNames[i].name, stKeyNames[i].code);
263 }
264}
265
266void KeyNames::setNameMap()
267{
268 int i;
269
270 namemap.clear();
271 for(i=0; stKeyNames[i].code != 0; i++){
272 namemap.insert(stKeyNames[i].code, stKeyNames[i].name);
273 }
274}
diff --git a/noncore/applets/keyhelper/keyhelperconf/KeyNames.h b/noncore/applets/keyhelper/keyhelperconf/KeyNames.h
new file mode 100644
index 0000000..edd7dc5
--- a/dev/null
+++ b/noncore/applets/keyhelper/keyhelperconf/KeyNames.h
@@ -0,0 +1,49 @@
1#ifndef _KEY_NAMES_H_
2#define _KEY_NAMES_H_
3
4#include <qstring.h>
5#include <qmap.h>
6#include <qnamespace.h>
7
8class KeyNames
9{
10public:
11 static const QString& getName(int code){
12 if(namemap.isEmpty()) setNameMap();
13 if(namemap.contains(code)){
14 return(namemap[code]);
15 } else {
16 return(QString::null);
17 }
18 }
19 static void clearName(){
20 namemap.clear();
21 }
22 static int getCode(const QString& s){
23 if(codemap.isEmpty()) setCodeMap();
24 if(codemap.contains(s)){
25 return(codemap[s]);
26 } else {
27 return(0);
28 }
29 }
30 static void setCode(const QString& s, int code){
31 if(codemap.contains(s) == false){
32 codemap.insert(s, code);
33 }
34 }
35 static void clearCode(){
36 codemap.clear();
37 }
38 static void reset(){
39 clearCode();
40 }
41private:
42 static QMap<QString, int> codemap;
43 static QMap<int, QString> namemap;
44
45 static void setCodeMap();
46 static void setNameMap();
47};
48
49#endif /* _KEY_NAMES_H_ */
diff --git a/noncore/applets/keyhelper/keyhelperconf/keyhelperconf.pro b/noncore/applets/keyhelper/keyhelperconf/keyhelperconf.pro
new file mode 100644
index 0000000..f84db3d
--- a/dev/null
+++ b/noncore/applets/keyhelper/keyhelperconf/keyhelperconf.pro
@@ -0,0 +1,13 @@
1 CONFIG = qt warn_on quick-app
2 HEADERS = KHCWidget.h \
3 KeyNames.h
4 SOURCES = KHCWidget.cpp \
5 KeyNames.cpp \
6 khcmain.cpp
7 INTERFACES= KHCWidgetBase.ui
8 DESTDIR =$(OPIEDIR)/bin
9INCLUDEPATH += . $(OPIEDIR)/include
10DEPENDPATH += $(OPIEDIR)/include
11 LIBS +=-lqpe
12
13include( $(OPIEDIR)/include.pro )
diff --git a/noncore/applets/keyhelper/keyhelperconf/khcmain.cpp b/noncore/applets/keyhelper/keyhelperconf/khcmain.cpp
new file mode 100644
index 0000000..757bde0
--- a/dev/null
+++ b/noncore/applets/keyhelper/keyhelperconf/khcmain.cpp
@@ -0,0 +1,11 @@
1#include <qpe/qpeapplication.h>
2#include "KHCWidget.h"
3
4int main(int argc, char* argv[])
5{
6 QPEApplication a(argc, argv);
7
8 KHCWidget w;
9 a.showMainWidget(&w);
10 return a.exec();
11}