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

Map Ctrl+Alt+Del to Ctrl+Alt+End #6186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

tcheneau
Copy link

On Microsoft Windows systems, when connecting to a remote desktop with
mstsc.exe, Ctrl+Alt+Del does not open the task manager on the remote
host. It will be intercepted by the current system and opens the task
manager locally. A different key combo is used to pass Ctrl+Alt+Del to
the remote host: Ctrl+Alt+End.

Similarly with xfreerdp, the Ctrl+Alt+Del combo is often interpreted by
the Window Manager. This patch maps Ctrl+Alt+End to pass the
Ctrl+Alt+Del combo.

Fixes issue #455 and #3494

Regards,
Tony

P.-S.: this patch was provided by a colleague of mine, hence the different author name

On Microsoft Windows systems, when connecting to a remote desktop with
mstsc.exe, Ctrl+Alt+Del does not open the task manager on the remote
host. It will be intercepted by the current system and opens the task
manager locally. A different key combo is used to pass Ctrl+Alt+Del to
the remote host: Ctrl+Alt+End.

Similarly with xfreerdp, the Ctrl+Alt+Del combo is often interpreted by
the Window Manager. This patch maps Ctrl+Alt+End to pass the
Ctrl+Alt+Del combo.

Fixes issue FreeRDP#455 and FreeRDP#3494
@freerdp-bot
Copy link

Can one of the admins verify this patch?

Copy link
Member

@akallabeth akallabeth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xfc->KeyboardState should contain the current (and properly reset) state of the whole keyboard.
Better use that one ot check which keys are currently pressed.
Doing so only in xf_keyboard_send_key will leave you with wrong states under many conditions (focus changes, ...)

@@ -43,6 +43,9 @@
#include <freerdp/log.h>
#define TAG CLIENT_TAG("x11")

static BOOL controlDown = FALSE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be part of xfContext (same is true for the existing ones, looks like a bug)

@@ -191,6 +194,28 @@ void xf_keyboard_send_key(xfContext* xfc, BOOL down, BYTE keycode)
DWORD rdp_scancode;
rdpInput* input;
input = xfc->context.input;

if (keycode == 0x25)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better check against rdp_scancode and the RDP_SCANCODE* macros instead of these magic numbers

controlDown = FALSE;
}

if (keycode == 0x40)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better check against rdp_scancode and the RDP_SCANCODE* macros instead of these magic numbers

laltDown = FALSE;
}

if (laltDown && controlDown && keycode == 0x73 && down == 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better check against rdp_scancode and the RDP_SCANCODE* macros instead of these magic numbers

@ckujau
Copy link

ckujau commented May 21, 2020

Workaround, until this is merged (and because I could not find this documented anywhere else): disable the CTRL-ALT-DEL keyboard shortcut in your window manager, that way xfreerdp should be able catch that shortcut and will be able to forward it to the remote system. For example, in the Gnome3 Settings program:

gnome_3

@jdranchman
Copy link

ctrl-alt-end works in the W10 rdp client. It should also work for freerdp (IMHO) for compatibility

@Neustradamus
Copy link

@tcheneau: Have you progressed on this PR?

@tcheneau
Copy link
Author

tcheneau commented Aug 6, 2022

@Neustradamus No, I didn't have time to get back to it despite all the very valid comments offered by @akallabeth. I left my employer since I first submitted this PR and no longer have a working setup to try the patch. I'm OK if this PR is dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants