summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-05 02:11:52 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-05 02:11:52 +0000
commit0ccfedd223a18147a11ea1422a527ef024ba5359 (patch)
treee847dfb4f76e9af7c9969f4e57a0b0435f417d3e /remoting
parentd8e129b71d0138f57970f090d21ed7066f86e847 (diff)
downloadchromium_src-0ccfedd223a18147a11ea1422a527ef024ba5359.zip
chromium_src-0ccfedd223a18147a11ea1422a527ef024ba5359.tar.gz
chromium_src-0ccfedd223a18147a11ea1422a527ef024ba5359.tar.bz2
Un-swap left & right mouse buttons when injecting input to Windows.
BUG=176129 Review URL: https://chromiumcodereview.appspot.com/12386071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186058 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/event_executor_win.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/remoting/host/event_executor_win.cc b/remoting/host/event_executor_win.cc
index 6398a74db..5b0df4f 100644
--- a/remoting/host/event_executor_win.cc
+++ b/remoting/host/event_executor_win.cc
@@ -277,6 +277,17 @@ void EventExecutorWin::Core::HandleMouse(const MouseEvent& event) {
MouseEvent::MouseButton button = event.button();
bool down = event.button_down();
+
+ // If the host is configured to swap left & right buttons, inject swapped
+ // events to un-do that re-mapping.
+ if (GetSystemMetrics(SM_SWAPBUTTON)) {
+ if (button == MouseEvent::BUTTON_LEFT) {
+ button = MouseEvent::BUTTON_RIGHT;
+ } else if (button == MouseEvent::BUTTON_RIGHT) {
+ button = MouseEvent::BUTTON_LEFT;
+ }
+ }
+
if (button == MouseEvent::BUTTON_LEFT) {
button_event.mi.dwFlags =
down ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;