diff options
Diffstat (limited to 'src/MainWidget.cpp')
-rw-r--r-- | src/MainWidget.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/MainWidget.cpp b/src/MainWidget.cpp index c8558ae..076ebf7 100644 --- a/src/MainWidget.cpp +++ b/src/MainWidget.cpp @@ -197,7 +197,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const caps->resize ( 63,30 ); caps->setText ( "Caps" ); caps->setToggleButton ( true ); - connect ( caps,TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( toggleShift ( unsigned int ) ) ); + connect ( caps,TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( toggleShiftCapsAltGr ( unsigned int ) ) ); other_keys.append(caps); caps->res(); @@ -246,7 +246,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const lshift->resize ( 45,30 ); lshift->setText ( "Shift" ); lshift->setToggleButton ( true ); - connect ( lshift,TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( toggleShift( unsigned int ) ) ); + connect ( lshift,TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( toggleShiftCapsAltGr( unsigned int ) ) ); mod_keys.append ( lshift ); lshift->res(); @@ -295,7 +295,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const rshift->resize ( 68,30 ); rshift->setText ( "Shift" ); rshift->setToggleButton ( true ); - connect ( rshift,TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( toggleShift( unsigned int ) ) ); + connect ( rshift,TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( toggleShiftCapsAltGr( unsigned int ) ) ); mod_keys.append ( rshift ); rshift->res(); @@ -342,6 +342,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const ralt->setText ( "AltGr" ); ralt->setKeyCode ( 108 ); ralt->setToggleButton ( true ); + connect ( ralt,TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( toggleShiftCapsAltGr ( unsigned int ) ) ); mod_keys.append ( ralt ); ralt->res(); @@ -849,19 +850,20 @@ void MainWidget::updateNumlock() } } -void MainWidget::toggleShift(unsigned int keycode) +void MainWidget::toggleShiftCapsAltGr(unsigned int keycode) { send_key(keycode); - updateShiftCaps(); + updateShiftCapsAltGr(); } -void MainWidget::updateShiftCaps() +void MainWidget::updateShiftCapsAltGr() { bool shiftState = lshift->isOn() || rshift->isOn(); bool capsState = caps->isOn(); + bool altGrState = ralt->isOn(); for (unsigned a = 0; a < btns.size(); a++) { - btns[a]->shiftCapsPressed(shiftState, capsState); + btns[a]->shiftCapsAltGrPressed(shiftState, capsState, altGrState); } } @@ -873,7 +875,7 @@ void MainWidget::keyPress(unsigned int a) mod_keys[a]->setOn(false); } // Make sure the key labels are correctly updated - updateShiftCaps(); + updateShiftCapsAltGr(); } void MainWidget::send_key(unsigned int keycode) @@ -926,7 +928,7 @@ void MainWidget::queryModState() if (caps_state != caps->isOn()) { caps->setOn(caps_state); - updateShiftCaps(); + updateShiftCapsAltGr(); } bool numl_state = keyState(XK_Num_Lock); @@ -944,7 +946,7 @@ void MainWidget::mappingNotify(XMappingEvent *) btns[a]->setupTexts(display); } updateNumlock(); - updateShiftCaps(); + updateShiftCapsAltGr(); } KbdDock::KbdDock ( MainWidget *m ) |