mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Remember and ignore hotkey combination before capturing
When capturing a new hotkey combination, we want to get only the delta of the keys and buttons being pressed during the capturing. ref T585
This commit is contained in:
committed by
Mat Sutcliffe
parent
c51a1b8c7b
commit
563a69e3f5
@@ -93,6 +93,7 @@ namespace BlackCore
|
||||
{
|
||||
m_captureActive = true;
|
||||
m_capturedCombination = {};
|
||||
m_combinationBeforeCapture = m_lastCombination;
|
||||
}
|
||||
|
||||
void CInputManager::callFunctionsBy(const QString &action, bool isKeyDown, bool shouldEmit)
|
||||
@@ -156,15 +157,20 @@ namespace BlackCore
|
||||
{
|
||||
if (m_captureActive)
|
||||
{
|
||||
if (currentCombination.size() < m_capturedCombination.size())
|
||||
CHotkeyCombination deltaCombination = currentCombination.getDeltaComparedTo(m_combinationBeforeCapture);
|
||||
|
||||
// Don't continue if there is no relevant combination yet
|
||||
if (m_capturedCombination.isEmpty() && deltaCombination.isEmpty()) { return; }
|
||||
|
||||
if (deltaCombination.size() < m_capturedCombination.size())
|
||||
{
|
||||
emit combinationSelectionFinished(m_capturedCombination);
|
||||
m_captureActive = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
emit combinationSelectionChanged(currentCombination);
|
||||
m_capturedCombination = currentCombination;
|
||||
emit combinationSelectionChanged(deltaCombination);
|
||||
m_capturedCombination = deltaCombination;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user