Add option to disable pointer button mapping
authorRoland Kaufmann <rlndkfmn+freerdp@gmail.com>
Mon, 13 Jul 2015 23:03:33 +0000 (01:03 +0200)
committerRoland Kaufmann <rlndkfmn+freerdp@gmail.com>
Tue, 15 Dec 2015 16:42:57 +0000 (17:42 +0100)
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
client/common/cmdline.c
include/freerdp/settings.h
libfreerdp/core/settings.c

index f21bfbf..8a885cf 100644 (file)
@@ -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       */
index 4fcac49..0945c1a 100644 (file)
@@ -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;
index 5b3d431..1de9a9f 100644 (file)
@@ -1422,6 +1422,7 @@ struct rdp_settings
        /*
         * Extensions
         */
+       ALIGN64 BOOL UnmapButtons;
 
        /* Extensions */
        ALIGN64 int num_extensions; /*  */
index df905ab..0ddd7d2 100644 (file)
@@ -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;