Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set shift bit also if right or left shift key press detected; added workaround for some buggy clients #449

Merged
merged 3 commits into from Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions 0.76_My_PuTTY/terminal.c
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions 0.76_My_PuTTY/windows/window.c
Expand Up @@ -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; }
Expand Down
4 changes: 4 additions & 0 deletions 0.76b_My_PuTTY/terminal/terminal.c
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions 0.76b_My_PuTTY/windows/window.c
Expand Up @@ -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; }
Expand Down