|
|
@ -858,16 +858,17 @@ void MainWidget::updateNumlock()
|
|
|
|
void MainWidget::toggleShift(unsigned int keycode)
|
|
|
|
void MainWidget::toggleShift(unsigned int keycode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
send_key(keycode);
|
|
|
|
send_key(keycode);
|
|
|
|
updateShift();
|
|
|
|
updateShiftCaps();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWidget::updateShift()
|
|
|
|
void MainWidget::updateShiftCaps()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool state = caps->isOn() ^ (lshift->isOn() || rshift->isOn());
|
|
|
|
bool shiftState = lshift->isOn() || rshift->isOn();
|
|
|
|
|
|
|
|
bool capsState = caps->isOn();
|
|
|
|
for (unsigned a = 0; a < btns.size(); a++)
|
|
|
|
for (unsigned a = 0; a < btns.size(); a++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
VButton *v = btns[a];
|
|
|
|
VButton *v = btns[a];
|
|
|
|
v->shiftPressed(state);
|
|
|
|
v->shiftCapsPressed(shiftState, capsState);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -880,7 +881,7 @@ void MainWidget::keyPress ( unsigned int a )
|
|
|
|
mod->setOn(false);
|
|
|
|
mod->setOn(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Make sure the key labels are correctly updated
|
|
|
|
// Make sure the key labels are correctly updated
|
|
|
|
updateShift();
|
|
|
|
updateShiftCaps();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWidget::send_key(unsigned int keycode)
|
|
|
|
void MainWidget::send_key(unsigned int keycode)
|
|
|
@ -935,7 +936,7 @@ void MainWidget::queryModState()
|
|
|
|
if (caps_state != caps->isOn())
|
|
|
|
if (caps_state != caps->isOn())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
caps->setOn(caps_state);
|
|
|
|
caps->setOn(caps_state);
|
|
|
|
updateShift();
|
|
|
|
updateShiftCaps();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool numl_state = keyState(XK_Num_Lock);
|
|
|
|
bool numl_state = keyState(XK_Num_Lock);
|
|
|
|