Commit 7c1036d4 authored by Dirk Wilden's avatar Dirk Wilden

correct displaying of modifiers registered as keys

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@3871 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 3705e35b
......@@ -414,12 +414,13 @@ CoreWidget::keyReleaseEvent(QKeyEvent* _e) {
/** Map Key Press Events to Plugins */
void
CoreWidget::mapKeyPressEvent(QKeyEvent* _e){
std::cerr << "keypress " << _e->key() << std::endl;
//find the first plugin which wants to handle that key
for (uint i=0; i < plugins_.size(); i++)
for (int k=0; k < plugins_[i].keys.count(); k++)
if ( plugins_[i].keys[k].key == _e->key()
&& plugins_[i].keys[k].modifiers == _e->modifiers() ){
std::cerr << "keypress " << plugins_[i].name.toStdString() << std::endl;
KeyInterface* keyPlugin = qobject_cast< KeyInterface * >(plugins_[i].plugin);
if (keyPlugin){
......
......@@ -158,8 +158,17 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
for (uint i=0; i < coreKeys_.size(); i++){
QStringList row;
QKeySequence keySequence( coreKeys_[i].key + coreKeys_[i].modifiers );
row << coreKeys_[i].description << keySequence.toString();
int key = coreKeys_[i].key;
if (key == Qt::Key_AltGr || key == Qt::Key_Alt || key == Qt::Key_Control || key == Qt::Key_Shift || key == Qt::Key_Meta){
QString keyString = QKeySequence( coreKeys_[i].modifiers ).toString();
row << coreKeys_[i].description << (keyString).left(keyString.size()-1);
}else{
QString keyString = QKeySequence( key + coreKeys_[i].modifiers ).toString();
row << coreKeys_[i].description << (keyString).left(keyString.size()-1);
}
keys.append(new QTreeWidgetItem(core, row));
}
......@@ -182,8 +191,17 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
for (int k=0; k < plugins_[i].keys.count(); k++){
QStringList row;
QKeySequence keySequence( plugins_[i].keys[k].key + plugins_[i].keys[k].modifiers );
row << plugins_[i].keys[k].description << keySequence.toString();
int key = plugins_[i].keys[k].key;
if (key == Qt::Key_AltGr || key == Qt::Key_Alt || key == Qt::Key_Control || key == Qt::Key_Shift || key == Qt::Key_Meta){
QString keyString = QKeySequence( plugins_[i].keys[k].modifiers ).toString();
row << plugins_[i].keys[k].description << (keyString).left(keyString.size()-1);
}else{
QString keyString = QKeySequence( key + plugins_[i].keys[k].modifiers ).toString();
row << plugins_[i].keys[k].description << (keyString).left(keyString.size()-1);
}
keys.append(new QTreeWidgetItem(plugins[i-off], row));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment