From 600d3c5ccb495fd59b11df0efa5b598165116b5d Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Tue, 14 Jul 2015 01:03:33 +0200 Subject: [PATCH] Add option to disable pointer button mapping In case the old behaviour of not reverse-mapping the mouse buttons is desirable, a command-line option is added to disable the mapping. This option is made experimental for the time being. The default is to do the reverse mapping, as this is the intuitive behaviour (the mouse then works as it would on the console). --- client/X11/xf_client.c | 5 ++++- client/common/cmdline.c | 5 +++++ include/freerdp/settings.h | 1 + libfreerdp/core/settings.c | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index f21bfbfc6..8a885cf63 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -1045,7 +1045,10 @@ static void xf_button_map_init (xfContext* xfc) }; /* query system for actual remapping */ - xf_get_x11_button_map (xfc, x11_map); + if (!xfc->settings->UnmapButtons) + { + xf_get_x11_button_map (xfc, x11_map); + } /* iterate over all (mapped) physical buttons; for each of them */ /* find the logical button in X11, and assign to this the */ diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 4fcac49ef..0945c1a78 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -107,6 +107,7 @@ COMMAND_LINE_ARGUMENT_A args[] = { "usb", COMMAND_LINE_VALUE_REQUIRED, "[dbg][dev][id|addr][auto]", NULL, NULL, -1, NULL, "Redirect USB device" }, { "multitouch", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Redirect multitouch input" }, { "gestures", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Consume multitouch input locally" }, + { "unmap-buttons", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Let server see real physical pointer button"}, { "echo", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, "echo", "Echo channel" }, { "disp", COMMAND_LINE_VALUE_FLAG, NULL, NULL, NULL, -1, NULL, "Display control" }, { "fonts", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Smooth fonts (ClearType)" }, @@ -2142,6 +2143,10 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, { settings->GrabKeyboard = arg->Value ? TRUE : FALSE; } + CommandLineSwitchCase(arg, "unmap-buttons") + { + settings->UnmapButtons = arg->Value ? TRUE : FALSE; + } CommandLineSwitchCase(arg, "toggle-fullscreen") { settings->ToggleFullscreen = arg->Value ? TRUE : FALSE; diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 5b3d43199..1de9a9f9a 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -1422,6 +1422,7 @@ struct rdp_settings /* * Extensions */ + ALIGN64 BOOL UnmapButtons; /* Extensions */ ALIGN64 int num_extensions; /* */ diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index df905ab7a..0ddd7d2c4 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -262,6 +262,7 @@ rdpSettings* freerdp_settings_new(DWORD flags) settings->ToggleFullscreen = TRUE; settings->DesktopPosX = 0; settings->DesktopPosY = 0; + settings->UnmapButtons = FALSE; settings->PerformanceFlags = PERF_FLAG_NONE; settings->AllowFontSmoothing = FALSE;