mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Listen for push-to-talk shortcut on more widgets
This commit is contained in:
parent
0c393e717a
commit
d5ab03d03d
|
@ -207,15 +207,12 @@ void GroupChatForm::onCallClicked()
|
|||
|
||||
void GroupChatForm::keyPressEvent(QKeyEvent* ev)
|
||||
{
|
||||
qDebug() << "Press:"<<ev->key();
|
||||
// Push to talk
|
||||
if (ev->key() == Qt::Key_P && inCall)
|
||||
{
|
||||
qDebug() << "Press:"<<ev->key();
|
||||
Core* core = Core::getInstance();
|
||||
if (!core->isGroupCallMicEnabled(group->groupId))
|
||||
{
|
||||
qDebug() << "Press:"<<ev->key();
|
||||
core->enableGroupCallMic(group->groupId);
|
||||
micButton->setObjectName("green");
|
||||
micButton->style()->polish(micButton);
|
||||
|
@ -226,7 +223,6 @@ void GroupChatForm::keyPressEvent(QKeyEvent* ev)
|
|||
|
||||
void GroupChatForm::keyReleaseEvent(QKeyEvent* ev)
|
||||
{
|
||||
qDebug() << "Release:"<<ev->key();
|
||||
// Push to talk
|
||||
if (ev->key() == Qt::Key_P && inCall)
|
||||
{
|
||||
|
|
|
@ -32,6 +32,9 @@ public:
|
|||
|
||||
void onUserListChanged();
|
||||
|
||||
void keyPressEvent(QKeyEvent* ev);
|
||||
void keyReleaseEvent(QKeyEvent* ev);
|
||||
|
||||
private slots:
|
||||
void onSendTriggered();
|
||||
void onMicMuteToggle();
|
||||
|
@ -42,8 +45,6 @@ protected:
|
|||
// drag & drop
|
||||
void dragEnterEvent(QDragEnterEvent* ev);
|
||||
void dropEvent(QDropEvent* ev);
|
||||
void keyPressEvent(QKeyEvent* ev);
|
||||
void keyReleaseEvent(QKeyEvent* ev);
|
||||
|
||||
private:
|
||||
Group* group;
|
||||
|
|
|
@ -122,3 +122,17 @@ void GroupWidget::dropEvent(QDropEvent *ev)
|
|||
Core::getInstance()->groupInviteFriend(friendId, groupId);
|
||||
}
|
||||
}
|
||||
|
||||
void GroupWidget::keyPressEvent(QKeyEvent* ev)
|
||||
{
|
||||
Group* g = GroupList::findGroup(groupId);
|
||||
if (g)
|
||||
g->chatForm->keyPressEvent(ev);
|
||||
}
|
||||
|
||||
void GroupWidget::keyReleaseEvent(QKeyEvent* ev)
|
||||
{
|
||||
Group* g = GroupList::findGroup(groupId);
|
||||
if (g)
|
||||
g->chatForm->keyReleaseEvent(ev);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@ protected:
|
|||
// drag & drop
|
||||
void dragEnterEvent(QDragEnterEvent* ev);
|
||||
void dropEvent(QDropEvent* ev);
|
||||
void keyPressEvent(QKeyEvent* ev);
|
||||
void keyReleaseEvent(QKeyEvent* ev);
|
||||
|
||||
public:
|
||||
int groupId;
|
||||
|
|
Loading…
Reference in New Issue
Block a user