Elvas Tower: Does OR recognize mouse button switching? - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Does OR recognize mouse button switching? Rate Topic: -----

#1 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,014
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 29 October 2014 - 09:06 AM

To equalize wear of arms and hands ( :offtopic: ) I am in this period using the left hand for the mouse, and inverted the mouse buttons. However OR does not seem to recognize the inversion of the buttons. Am I doing something wrong?

#2 User is offline   dennisat 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 474
  • Joined: 16-February 13
  • Gender:Male
  • Simulator:Open Rails & MSTS
  • Country:

Posted 29 October 2014 - 09:47 AM

See this Bug Report: Mouse Operations don't honour left hand setup

Dennis

#3 User is offline   edwardk 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 1,350
  • Joined: 11-December 09
  • Gender:Male
  • Location:Chula Vista, CA
  • Simulator:MSTS
  • Country:

Posted 30 October 2014 - 01:15 PM

I started experimenting in this area and this is what I found out. There is no XNA method to swap mouse buttons which leaves the following method below.

[DllImport("user32.dll")]
public static extern Int32 SwapMouseButton(Int32 bSwap);


Since the above is to be used in a class, I created a class called MouseSwap(). Under the options form, I created the IsLeftHandedMouse option under the experimental tab and created a procedure to call the above process. With my preliminary test, the mouse buttons are swapped, but since the call is made at the driver level, the button change is reflected outside OR as well until the IsLeftHandedMouse option is unchecked. If you alt tab out of the program to do something, the buttons will be swapped. The best option in this case is to make sure the mouse buttons are set back to default when exiting OR.

Edward K.

#4 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,014
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 31 October 2014 - 12:49 PM

Thanks Edward.
By the way there is an internal incoherence in OR, as the OR menu honours mouse left hand setup.

#5 User is offline   gpz 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,772
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 31 October 2014 - 02:58 PM

Edward, why don't you just simply modify the UserInput.IsMouseLeftButtonDown(), and the other 5 methods of these here to send reversed events? This way nothing would be changed in Windows, just OpenRails would handle the mouse buttons reversed.

I believe there is also a way to query the windows driver setting about left-handedness, and use that info as the base of the reversed handling.

Carlo, the menu honours it because that is handled by winforms, unlike the game window.

#6 User is offline   atsf37l 

  • Executive Vice President
  • Group: Status: First Class
  • Posts: 4,648
  • Joined: 25-February 05
  • Gender:Male
  • Location:San Diego
  • Simulator:ORTS
  • Country:

Posted 31 October 2014 - 03:51 PM

I have always used a reversed mouse, being a southpaw, and I've never had trouble with ORTS recognizing my mouse clicks. No, I didn't have to change any settings. What Build of OR are you running? :bigboss:

#7 User is offline   edwardk 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 1,350
  • Joined: 11-December 09
  • Gender:Male
  • Location:Chula Vista, CA
  • Simulator:MSTS
  • Country:

Posted 05 November 2014 - 01:26 PM

Peter,

I was thinking about following this method at first, but initially I doubt it will work since XNA follows the mouse click via MouseState.LeftButton which would be tied by driver/hardware to the left button. Researching this process only led to the original method that I posted.


Edward K.


View Postgpz, on 31 October 2014 - 02:58 PM, said:

Edward, why don't you just simply modify the UserInput.IsMouseLeftButtonDown(), and the other 5 methods of these here to send reversed events? This way nothing would be changed in Windows, just OpenRails would handle the mouse buttons reversed.

I believe there is also a way to query the windows driver setting about left-handedness, and use that info as the base of the reversed handling.

Carlo, the menu honours it because that is handled by winforms, unlike the game window.


#8 User is offline   gpz 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,772
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 05 November 2014 - 01:40 PM

Yes, but please note there is an indirection here: OpenRails windowmanager asks UserInput.IsMouseLeftButtonPressed(), wich you can modify to { return MouseState.RightButton == ButtonState.Pressed && LastMouseState.RightButton == ButtonState.Released; } in case of a left handed mouse.

Indeed there are two queries in Viewer.cs for MouseState.LeftButton at uncouple and throw-switch commands, but I think this is incorrect here, and needs to be modified to query the UserInput.IsMouseLeftButtonPressed() instead.

#9 User is offline   atsf37l 

  • Executive Vice President
  • Group: Status: First Class
  • Posts: 4,648
  • Joined: 25-February 05
  • Gender:Male
  • Location:San Diego
  • Simulator:ORTS
  • Country:

Posted 22 April 2024 - 11:42 PM

View Postatsf37l, on 31 October 2014 - 03:51 PM, said:

I have always used a reversed mouse, being a southpaw, and I've never had trouble with ORTS recognizing my mouse clicks. No, I didn't have to change any settings. What Build of OR are you running? :bigboss:


But it does now! I loaded 1.5.1 today and the reversed mouse buttons are not recognized in OR. Every 10 years it pops up! This is on the full stable version with installer - getting lazy in my old age.

So how do we get it fixed?

#10 User is offline   atsf37l 

  • Executive Vice President
  • Group: Status: First Class
  • Posts: 4,648
  • Joined: 25-February 05
  • Gender:Male
  • Location:San Diego
  • Simulator:ORTS
  • Country:

Posted 04 May 2024 - 01:07 PM

Once more I ask, "So how do we get it fixed?" Lots of south paws out here.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users