Commit 82dbf435 authored by yanmorin's avatar yanmorin

Add <esc>

parent f700e87a
......@@ -511,6 +511,11 @@ PhoneLineManagerImpl::sendKey(Qt::Key c)
case Qt::Key_F6:
selectLine(c - Qt::Key_F1);
break;
case Qt::Key_Escape:
if (selectedLine) {
selectedLine->hangup(true);
}
default:
if (!selectedLine) {
......
......@@ -167,11 +167,16 @@ void SFLPhoneWindow::initWindowButtons()
void
SFLPhoneWindow::keyPressEvent(QKeyEvent *e) {
// Misc. key
if (e->state() & Qt::ControlButton || e->key() == Qt::Key_Control) {
// Misc. key
int key = e->key();
if (e->state() & Qt::ControlButton || key == Qt::Key_Control) {
emit shortcutPressed(e);
} else if (e->key() != Qt::Key_Shift) {
emit keyPressed(Qt::Key(e->key()));
} else if (key != Qt::Key_Shift &&
key != Qt::Key_Meta &&
key != Qt::Key_Alt &&
key != Qt::Key_Mode_switch
) {
emit keyPressed(Qt::Key(key));
}
}
......
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