MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / isSendShortcut

Method isSendShortcut

ChatView/ChatRootView.cpp:779–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779bool ChatRootView::isSendShortcut(int key, int modifiers) const
780{
781 const QKeySequence sequence = sendMessageKeySequence();
782 if (sequence.isEmpty())
783 return false;
784
785 const QKeyCombination combination = sequence[0];
786 const int sequenceKey = combination.key();
787
788 const int relevantMask = Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier
789 | Qt::MetaModifier;
790 const int sequenceModifiers = combination.keyboardModifiers() & relevantMask;
791 const int eventModifiers = modifiers & relevantMask;
792
793 const bool isReturnLike = sequenceKey == Qt::Key_Return || sequenceKey == Qt::Key_Enter;
794 const bool keyMatches = key == sequenceKey
795 || (isReturnLike && (key == Qt::Key_Return || key == Qt::Key_Enter));
796
797 return keyMatches && eventModifiers == sequenceModifiers;
798}
799
800QString ChatRootView::sendShortcutText() const
801{

Callers

nothing calls this directly

Calls 2

sendMessageKeySequenceFunction · 0.85
isEmptyMethod · 0.45

Tested by

no test coverage detected