Skip to content
Snippets Groups Projects
Commit 82dbf435 authored by yanmorin's avatar yanmorin
Browse files

Add <esc>

parent f700e87a
Branches
No related tags found
No related merge requests found
......@@ -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));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment