Merge pull request #449 from unxed/master

Set shift bit also if right or left shift key press detected; added workaround for some buggy clients
This commit is contained in:
Cyd
2023-03-06 19:06:16 +01:00
committed by GitHub
4 changed files with 12 additions and 4 deletions
+4
View File
@@ -3560,6 +3560,10 @@ static void do_osc(Terminal *term)
if (OpenClipboard(NULL)) {
// some clients don't flush the buffer before setting data,
// so we'll do that here just in case
EmptyClipboard();
if (!SetClipboardData(fmt, (HANDLE)hData)) {
GlobalFree(hData);
} else {
+2 -2
View File
@@ -5702,8 +5702,8 @@ if( (GetKeyState(VK_MENU)&0x8000) && (wParam==VK_SPACE) ) {
// Using bits not used by any other status for backward compatibility.
#define RIGHT_SHIFT_PRESSED 0x0400
#define LEFT_SHIFT_PRESSED 0x0200
if (GetAsyncKeyState(VK_LSHIFT)) { ctrl |= RIGHT_SHIFT_PRESSED; }
if (GetAsyncKeyState(VK_RSHIFT)) { ctrl |= LEFT_SHIFT_PRESSED; }
if (GetAsyncKeyState(VK_LSHIFT)) { ctrl |= SHIFT_PRESSED; ctrl |= RIGHT_SHIFT_PRESSED; }
if (GetAsyncKeyState(VK_RSHIFT)) { ctrl |= SHIFT_PRESSED; ctrl |= LEFT_SHIFT_PRESSED; }
// end
if ((lParam & ( 1 << 24 )) >> 24) { ctrl |= ENHANCED_KEY; }
if ((((u_short)GetKeyState(VK_NUMLOCK)) & 0xffff) != 0) { ctrl |= NUMLOCK_ON; }
+4
View File
@@ -3559,6 +3559,10 @@ static void do_osc(Terminal *term)
if (OpenClipboard(NULL)) {
// some clients don't flush the buffer before setting data,
// so we'll do that here just in case
EmptyClipboard();
if (!SetClipboardData(fmt, (HANDLE)hData)) {
GlobalFree(hData);
} else {
+2 -2
View File
@@ -5702,8 +5702,8 @@ if( (GetKeyState(VK_MENU)&0x8000) && (wParam==VK_SPACE) ) {
// Using bits not used by any other status for backward compatibility.
#define RIGHT_SHIFT_PRESSED 0x0400
#define LEFT_SHIFT_PRESSED 0x0200
if (GetAsyncKeyState(VK_LSHIFT)) { ctrl |= RIGHT_SHIFT_PRESSED; }
if (GetAsyncKeyState(VK_RSHIFT)) { ctrl |= LEFT_SHIFT_PRESSED; }
if (GetAsyncKeyState(VK_LSHIFT)) { ctrl |= SHIFT_PRESSED; ctrl |= RIGHT_SHIFT_PRESSED; }
if (GetAsyncKeyState(VK_RSHIFT)) { ctrl |= SHIFT_PRESSED; ctrl |= LEFT_SHIFT_PRESSED; }
// end
if ((lParam & ( 1 << 24 )) >> 24) { ctrl |= ENHANCED_KEY; }
if ((((u_short)GetKeyState(VK_NUMLOCK)) & 0xffff) != 0) { ctrl |= NUMLOCK_ON; }