Skip to content

Commit

Permalink
[Issue No.63]Fix multi input virtual key send issue.
Browse files Browse the repository at this point in the history
Signed-off-by: Melvin Li <[email protected]>
  • Loading branch information
Zalafina committed Dec 7, 2024
1 parent 5d3a319 commit be427a2
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions QKeyMapper/qkeymapper_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6675,7 +6675,11 @@ int QKeyMapper_Worker::InterceptionKeyboardHookProc(UINT scan_code, int keyupdow
if (KEY_UP == keyupdown && false == returnFlag){
if (findindex >= 0
&& (QKeyMapper::KeyMappingDataList->at(findindex).Original_Key == keycodeString
|| QKeyMapper::KeyMappingDataList->at(findindex).Original_Key == QKeyMapper_Worker::getKeycodeStringRemoveMultiInput(keycodeString))) {
|| QKeyMapper::KeyMappingDataList->at(findindex).Original_Key == keycodeString_nochanged)) {
#ifdef DEBUG_LOGOUT_ON
QString debugmessage = QString("[InterceptionKeyboardHookProc] \"%1\" or \"%2\" has found in OriginalKeys, do not skip RealKey \"%3\" KEY_UP").arg(keycodeString_nochanged, keycodeString, keycodeString);
qDebug().nospace().noquote() << "\033[1;34m" << debugmessage << "\033[0m";
#endif
}
else {
if (pressedVirtualKeysList.contains(keycodeString_nochanged)) {
Expand Down Expand Up @@ -6983,13 +6987,17 @@ int QKeyMapper_Worker::InterceptionMouseHookProc(MouseEvent mouse_event, int del
if (KEY_UP == keyupdown && INTERCEPTION_RETURN_NORMALSEND == returnFlag){
if (findindex >= 0
&& (QKeyMapper::KeyMappingDataList->at(findindex).Original_Key == keycodeString
|| QKeyMapper::KeyMappingDataList->at(findindex).Original_Key == QKeyMapper_Worker::getKeycodeStringRemoveMultiInput(keycodeString))) {
|| QKeyMapper::KeyMappingDataList->at(findindex).Original_Key == keycodeString_nochanged)) {
#ifdef DEBUG_LOGOUT_ON
QString debugmessage = QString("[InterceptionMouseHookProc] \"%1\" or \"%2\" has found in OriginalKeys, do not skip RealKey \"%3\" KEY_UP").arg(keycodeString_nochanged, keycodeString, keycodeString);
qDebug().nospace().noquote() << "\033[1;34m" << debugmessage << "\033[0m";
#endif
}
else {
if (pressedVirtualKeysList.contains(keycodeString)) {
if (pressedVirtualKeysList.contains(keycodeString_nochanged)) {
returnFlag = INTERCEPTION_RETURN_BLOCKEDBY_LOWLEVELHOOK;
#ifdef DEBUG_LOGOUT_ON
qDebug("[InterceptionMouseHookProc] Virtual \"%s\" is pressed down, skip Real \"%s\" KEY_UP!", keycodeString.toStdString().c_str(), keycodeString.toStdString().c_str());
qDebug("[InterceptionMouseHookProc] Virtual \"%s\" is pressed down, skip Real \"%s\" KEY_UP!", keycodeString_nochanged.toStdString().c_str(), keycodeString_nochanged.toStdString().c_str());
#endif
}
}
Expand Down Expand Up @@ -7591,6 +7599,10 @@ LRESULT QKeyMapper_Worker::LowLevelKeyboardHookProc(int nCode, WPARAM wParam, LP
if (findindex >= 0
&& (QKeyMapper::KeyMappingDataList->at(findindex).Original_Key == keycodeString
|| QKeyMapper::KeyMappingDataList->at(findindex).Original_Key == QKeyMapper_Worker::getKeycodeStringRemoveMultiInput(keycodeString))) {
#ifdef DEBUG_LOGOUT_ON
QString debugmessage = QString("[LowLevelKeyboardHookProc] \"%1\" has found in OriginalKeys, do not skip RealKey \"%2\" KEY_UP").arg(keycodeString, keycodeString);
qDebug().nospace().noquote() << "\033[1;34m" << debugmessage << "\033[0m";
#endif
}
else {
if (pressedVirtualKeysList.contains(keycodeString)) {
Expand Down Expand Up @@ -7795,7 +7807,7 @@ LRESULT QKeyMapper_Worker::LowLevelKeyboardHookProc(int nCode, WPARAM wParam, LP
int findindex = QKeyMapper::findOriKeyInKeyMappingDataList_RemoveMultiInput(keycodeString);
if (findindex < 0) {
#ifdef DEBUG_LOGOUT_ON
QString debugmessage = QString("[LowLevelKeyboardHookProc] RealKey \"%1\" is pressed down on keyboard, skip send mapping VirtualKey \"%2\" KEYUP! sendVirtualKeyState = %3").arg(keycodeString, keycodeString).arg(sendVirtualKeyState);
QString debugmessage = QString("[LowLevelKeyboardHookProc] RealKey \"%1\" is pressed down on keyboard, skip send mapping VirtualKey \"%2\" KEY_UP! sendVirtualKeyState = %3").arg(keycodeString, keycodeString).arg(sendVirtualKeyState);
qDebug().nospace().noquote() << "\033[1;34m" << debugmessage << "\033[0m";
#endif
returnFlag = true;
Expand Down

0 comments on commit be427a2

Please sign in to comment.