Changeset 1811e3f


Ignore:
Timestamp:
08/26/14 07:11:58 (3 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.1
Children:
f54545d6
Parents:
d5be4d7
Message:

Clean up the lumina-config keyboard detection routine a bit more.

Location:
lumina/lumina-config
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lumina/lumina-config/KeyCatch.h

    rde3764d r1811e3f  
    5555                qkeys = QKeySequence(event->modifiers()).toString(); 
    5656              } 
    57               //Ignore modifiers that result in a different keycode entirely (shift+a != (shift) + (a) ) 
     57               
     58              /*//Ignore modifiers that result in a different keycode entirely (shift+a != (shift) + (a) ) 
    5859              if(event->modifiers()!=Qt::ShiftModifier && event->modifiers()!=Qt::KeypadModifier){ 
    5960                //Convert the modifier to the fluxbox equivilent 
     
    6869                  if(!key.isEmpty()){ xkeys.append(key+" "); } 
    6970                } 
    70               } 
     71              }*/ 
    7172 
    7273            } 
    7374            //Now get the main key 
    74             xkeys.append( QString::number(event->nativeVirtualKey()) ); 
    75             qkeys.append( QKeySequence(event->key()).toString() ); //also save the text version (for display) 
     75            qkeys.replace("+"," "); 
     76            if(QKeySequence(event->key()).toString().isEmpty()){ 
     77              qkeys.append( QString::number(event->nativeVirtualKey()) ); 
     78            }else{ 
     79              qkeys.append( QKeySequence(event->key()).toString() ); //also save the text version (for display) 
     80            } 
     81            //Remove the modifier if it is only "shift", and the main key is not a symbol 
     82            xkeys = qkeys; 
     83            if(!xkeys.section(" ",-1).isEmpty() && xkeys.contains("Shift ")){ 
     84              if(!xkeys.section(" ",-1).at(0).isLetter()){ 
     85                xkeys.remove("Shift "); //The symbol/keycode is already different 
     86                qkeys.remove("Shift "); 
     87              } 
     88            } 
    7689            //Now close the dialog 
    7790            cancelled=false; 
  • lumina/lumina-config/mainUI.cpp

    rd5be4d7 r1811e3f  
    285285  in.replace("PgUp", "Prior"); 
    286286  in.replace("PgDown", "Next"); 
     287  in.replace("Del", "Delete"); 
     288  in.replace("Backspace", "BackSpace"); 
     289  in.replace("Ins","Insert"); 
    287290  return in; 
    288291} 
     
    295298  in.replace("Prior", "PgUp"); 
    296299  in.replace("Next", "PgDown"); 
     300  //in.replace("Delete", "Del"); //the "Delete" is better looking 
     301  in.replace("BackSpace", "Backspace"); 
     302  //in.replace("Insert", "Ins"); //the "Insert" is better looking 
    297303  return in;     
    298304} 
     
    10651071  qDebug() << "Key Press:" << dlg.xkeys << dlg.qkeys; 
    10661072  QTreeWidgetItem *it = ui->tree_shortcut->currentItem(); 
    1067   if(dlg.qkeys.endsWith("+")){ dlg.qkeys.replace("+"," "); dlg.qkeys = dlg.qkeys.append("+").simplified(); } 
    1068   else{ dlg.qkeys.replace("+"," "); } 
     1073  //if(dlg.qkeys.endsWith("+")){ dlg.qkeys.replace("+"," "); dlg.qkeys = dlg.qkeys.append("+").simplified(); } 
     1074  //else{ dlg.qkeys.replace("+"," "); } 
    10691075  it->setText(1,dlg.qkeys); 
    1070   it->setWhatsThis(1,dispToFluxKeys(dlg.qkeys)); 
     1076  it->setWhatsThis(1,dispToFluxKeys(dlg.xkeys)); 
    10711077  ui->push_save->setEnabled(true); 
    10721078  modshort=true; 
Note: See TracChangeset for help on using the changeset viewer.