Skip to content

Keyboard shortcut to answer/hangup? [feature-request] #882

Open
@SummerSeaSun

Description

@SummerSeaSun

Dear Sirs,

I'm wondering if you ever considered the possibility to add a custom keyboard event i.e CTRL+R to answer instead of clicking on the green icon (and CTRL+R again while in call to hangup).

I'm trying to figure out how to add this but my knowledge is too limited, can you help to make this edits, I've cloned the repo and tried to add these lines ./linphone-desktop/Linphone/core/call/CallGui.cpp would it be the right place ?


void CallGui::handleAnswerShortcut() {
    if (mCore && mCore->isInCall()) {
        QMetaObject::invokeMethod(mCore.get(), "answerCall", Qt::QueuedConnection);
    }
}


void CallGui::keyPressEvent(QKeyEvent *event) {
    if (event->modifiers() == Qt::ControlModifier && event->key() == Qt::Key_R) {  // CTRL + R to answer
        handleAnswerShortcut();
    }
    else {
        QWidget::keyPressEvent(event);
    }
}


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions