|
|
@ -197,7 +197,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const
|
|
|
|
caps->resize ( 63,30 );
|
|
|
|
caps->resize ( 63,30 );
|
|
|
|
caps->setText ( "Caps" );
|
|
|
|
caps->setText ( "Caps" );
|
|
|
|
caps->setToggleButton ( true );
|
|
|
|
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);
|
|
|
|
other_keys.append(caps);
|
|
|
|
caps->res();
|
|
|
|
caps->res();
|
|
|
|
|
|
|
|
|
|
|
@ -246,7 +246,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const
|
|
|
|
lshift->resize ( 45,30 );
|
|
|
|
lshift->resize ( 45,30 );
|
|
|
|
lshift->setText ( "Shift" );
|
|
|
|
lshift->setText ( "Shift" );
|
|
|
|
lshift->setToggleButton ( true );
|
|
|
|
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 );
|
|
|
|
mod_keys.append ( lshift );
|
|
|
|
lshift->res();
|
|
|
|
lshift->res();
|
|
|
|
|
|
|
|
|
|
|
@ -295,7 +295,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const
|
|
|
|
rshift->resize ( 68,30 );
|
|
|
|
rshift->resize ( 68,30 );
|
|
|
|
rshift->setText ( "Shift" );
|
|
|
|
rshift->setText ( "Shift" );
|
|
|
|
rshift->setToggleButton ( true );
|
|
|
|
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 );
|
|
|
|
mod_keys.append ( rshift );
|
|
|
|
rshift->res();
|
|
|
|
rshift->res();
|
|
|
|
|
|
|
|
|
|
|
@ -342,6 +342,7 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const
|
|
|
|
ralt->setText ( "AltGr" );
|
|
|
|
ralt->setText ( "AltGr" );
|
|
|
|
ralt->setKeyCode ( 108 );
|
|
|
|
ralt->setKeyCode ( 108 );
|
|
|
|
ralt->setToggleButton ( true );
|
|
|
|
ralt->setToggleButton ( true );
|
|
|
|
|
|
|
|
connect ( ralt,TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( toggleShiftCapsAltGr ( unsigned int ) ) );
|
|
|
|
mod_keys.append ( ralt );
|
|
|
|
mod_keys.append ( ralt );
|
|
|
|
ralt->res();
|
|
|
|
ralt->res();
|
|
|
|
|
|
|
|
|
|
|
@ -849,19 +850,20 @@ void MainWidget::updateNumlock()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWidget::toggleShift(unsigned int keycode)
|
|
|
|
void MainWidget::toggleShiftCapsAltGr(unsigned int keycode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
send_key(keycode);
|
|
|
|
send_key(keycode);
|
|
|
|
updateShiftCaps();
|
|
|
|
updateShiftCapsAltGr();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWidget::updateShiftCaps()
|
|
|
|
void MainWidget::updateShiftCapsAltGr()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool shiftState = lshift->isOn() || rshift->isOn();
|
|
|
|
bool shiftState = lshift->isOn() || rshift->isOn();
|
|
|
|
bool capsState = caps->isOn();
|
|
|
|
bool capsState = caps->isOn();
|
|
|
|
|
|
|
|
bool altGrState = ralt->isOn();
|
|
|
|
for (unsigned a = 0; a < btns.size(); a++)
|
|
|
|
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);
|
|
|
|
mod_keys[a]->setOn(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Make sure the key labels are correctly updated
|
|
|
|
// Make sure the key labels are correctly updated
|
|
|
|
updateShiftCaps();
|
|
|
|
updateShiftCapsAltGr();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWidget::send_key(unsigned int keycode)
|
|
|
|
void MainWidget::send_key(unsigned int keycode)
|
|
|
@ -926,7 +928,7 @@ void MainWidget::queryModState()
|
|
|
|
if (caps_state != caps->isOn())
|
|
|
|
if (caps_state != caps->isOn())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
caps->setOn(caps_state);
|
|
|
|
caps->setOn(caps_state);
|
|
|
|
updateShiftCaps();
|
|
|
|
updateShiftCapsAltGr();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool numl_state = keyState(XK_Num_Lock);
|
|
|
|
bool numl_state = keyState(XK_Num_Lock);
|
|
|
@ -944,7 +946,7 @@ void MainWidget::mappingNotify(XMappingEvent *)
|
|
|
|
btns[a]->setupTexts(display);
|
|
|
|
btns[a]->setupTexts(display);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateNumlock();
|
|
|
|
updateNumlock();
|
|
|
|
updateShiftCaps();
|
|
|
|
updateShiftCapsAltGr();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KbdDock::KbdDock ( MainWidget *m )
|
|
|
|
KbdDock::KbdDock ( MainWidget *m )
|
|
|
|