Commit 82dbf435 authored by yanmorin's avatar yanmorin
Browse files

Add <esc>

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