Board index FlightGear Support Hardware

Win7 laptop two button touchpad/mouse bindings files?

Joysticks, pedals, monitors.

Win7 laptop two button touchpad/mouse bindings files?

Postby captainjack » Fri Nov 25, 2016 4:28 am

Hello,
On my gateway laptop, the mouse functions for raising or lowing instrument knobs (i.e. NAV1 volume, OBS, etc) work differently depending on the aircraft. In some aircraft, I can increment/decrement settings without problem, sometimes having to hold down the ALT key with left click to decrement.
But in other aircraft, I cannot decrement a setting no matter what I do. For example, in the Cessna citation II, once the volume is turned up on NAV1 (so I can hear the morse code identifier), no combination of mouse clicks or drags with or without modifier keys will decrement the volume, rendering the aircraft unuseable for me.
My touchpad mouse has a left and right key only, and no scroll bar.
I know there is a mice.xml file, which I have located, but I am interested in finding the mouse bindings in each aircraft specific folder. Since each aircraft configures mouse action differently for my mouse, I assume that there are configurations per aircraft that override whatever mice.xml configures. But I cannot find any such .xml or .nas files.
I do not yet know how to edit these files anyway, but my objective in this post is to learn if per aircraft mouse bindings exist in either xml or nas or both, and if so, where are they located? Am in on the right track in trying to locate and modify any such files?
xj
captainjack
 
Posts: 81
Joined: Sat Nov 05, 2016 1:52 am

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby wkitty42 » Fri Nov 25, 2016 9:21 am

sounds like you need to emulate the middle mouse button... IIRC, we used to do that by clicking both the left and right buttons at the same time... but, to be honest, i'd be getting myself a real mouse with three or more buttons and using that instead of that built-in pad thing... either a USB mouse or a wireless one... i'd be going for the USB one for security, though... it is very easy to capture and record wireless keyboard and mouse signals...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby Parnikkapore » Fri Nov 25, 2016 11:45 am

Can you set your touchpad to use two-finger or edge scrolling?

I always prefer scrolling the switches rather than middle-clicking. It feels more natural...
There are free alternatives to (almost) every program you encounter. You just have to find them.
Parnikkapore
 
Posts: 929
Joined: Thu Oct 29, 2015 11:16 am
Callsign: HS-FGS
Version: next
OS: Kubuntu

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby wkitty42 » Fri Nov 25, 2016 8:11 pm

i agree it feels more natural which is why i didn't say anything about trying to roll a scroll wheel that doubles as a middle button... i roll mine to turn knobs and push/pull sliders ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby captainjack » Sat Nov 26, 2016 2:10 am

wkitty42 wrote in Fri Nov 25, 2016 9:21 am:sounds like you need to emulate the middle mouse button... IIRC, we used to do that by clicking both the left and right buttons at the same time... but, to be honest, i'd be getting myself a real mouse with three or more buttons and using that instead of that built-in pad thing... either a USB mouse or a wireless one... i'd be going for the USB one for security, though... it is very easy to capture and record wireless keyboard and mouse signals...


wkitty thank you for the response.
In my case, I don't want to emulate another mouse.
I only want to use the mouse that is integral to my system.
It has only two mouse buttons (left and right clickable buttons), and no scroll wheel.
I don't want to get any other mouse, my USB ports are already full :)
So my objective is to get aircraft instruments to respond properly to the mouse clicks of either mouse button zero (left click) or mouse button 2 (right click) in my system as is.
cj
captainjack
 
Posts: 81
Joined: Sat Nov 05, 2016 1:52 am

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby captainjack » Sat Nov 26, 2016 2:17 am

Parnikkapore wrote in Fri Nov 25, 2016 11:45 am:Can you set your touchpad to use two-finger or edge scrolling?

I always prefer scrolling the switches rather than middle-clicking. It feels more natural...


Hello Parnikkapore and thank you for replying to my post.

My mouse has only two buttons, and no scrolling.
There is the left button (FlightGear mouse button 0), and then the right button (FlightGear mouse button 2). There are no other buttons.
There is no scrolling function in my mouse.
I am trying to get to the point where I can change aircraft instrument settings using only these two mouse buttons, because they are the only two mouse buttons that I have.
I won't (will not) add an external mouse.
I won't (will not) introduce any code or software to modify my existing mouse.
I won't (will not) attempt to modify my existing mouse to emulate any other kind of mouse.
Instead:
My objective is to learn how to modify each aircraft's XML files so that they allow me to use my existing mouse to change instrument settings, such as instrument frequency, instrument on/off, instrument rotary switch settings, OBS settings, etceteras.

cj
captainjack
 
Posts: 81
Joined: Sat Nov 05, 2016 1:52 am

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby wkitty42 » Sat Nov 26, 2016 3:04 am

captainjack wrote in Sat Nov 26, 2016 2:10 am:wkitty thank you for the response.
In my case, I don't want to emulate another mouse.

that's not what i said... i said emulate the third mouse button...

captainjack wrote in Sat Nov 26, 2016 2:10 am:I only want to use the mouse that is integral to my system.
It has only two mouse buttons (left and right clickable buttons), and no scroll wheel.

great! what happens when you push both of them at the same time? that is how we did the third mouse button on two button mice...

captainjack wrote in Sat Nov 26, 2016 2:10 am:I don't want to get any other mouse, my USB ports are already full :)
So my objective is to get aircraft instruments to respond properly to the mouse clicks of either mouse button zero (left click) or mouse button 2 (right click) in my system as is.
cj

again, try both buttons at the same time as that is generally how the third button is emulated...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby captainjack » Sat Nov 26, 2016 3:41 am

wkitty42: ok, I will try your suggestion;
I will press both mouse buttons at the same time to see if I can emulate a button #3.
I will try your suggestion on instruments in the Cessna 337G aircraft/context.
I intend to post back to this thread with results.
Thank you for spending your time to reply to my post.
captainjack
cj
captainjack
 
Posts: 81
Joined: Sat Nov 05, 2016 1:52 am

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby captainjack » Sat Nov 26, 2016 4:03 am

wkitty42 wrote in Sat Nov 26, 2016 3:04 am:
captainjack wrote in Sat Nov 26, 2016 2:10 am:wkitty thank you for the response.
In my case, I don't want to emulate another mouse.

that's not what i said... i said emulate the third mouse button...

captainjack wrote in Sat Nov 26, 2016 2:10 am:I only want to use the mouse that is integral to my system.
It has only two mouse buttons (left and right clickable buttons), and no scroll wheel.

great! what happens when you push both of them at the same time? that is how we did the third mouse button on two button mice...

captainjack wrote in Sat Nov 26, 2016 2:10 am:I don't want to get any other mouse, my USB ports are already full :)
So my objective is to get aircraft instruments to respond properly to the mouse clicks of either mouse button zero (left click) or mouse button 2 (right click) in my system as is.
cj

again, try both buttons at the same time as that is generally how the third button is emulated...
wkitty42 wrote in Sat Nov 26, 2016 3:04 am:
captainjack wrote in Sat Nov 26, 2016 2:10 am:wkitty thank you for the response.
In my case, I don't want to emulate another mouse.

that's not what i said... i said emulate the third mouse button...

captainjack wrote in Sat Nov 26, 2016 2:10 am:I only want to use the mouse that is integral to my system.
It has only two mouse buttons (left and right clickable buttons), and no scroll wheel.

great! what happens when you push both of them at the same time? that is how we did the third mouse button on two button mice...

captainjack wrote in Sat Nov 26, 2016 2:10 am:I don't want to get any other mouse, my USB ports are already full :)
So my objective is to get aircraft instruments to respond properly to the mouse clicks of either mouse button zero (left click) or mouse button 2 (right click) in my system as is.
cj

again, try both buttons at the same time as that is generally how the third button is emulated...


wkitty42:
Thank you for spending your time to assist me.
I tried your suggestions and they did not work. I tried them on the Cessna 337G aircraft DME and ADF instruments.
Your suggestion is that I attempt to "emulate" an FG mouse configuration.
You suggested that I hold down both mouse buttons to "emulate" button 3.
I ask you to please refer back to my original posts in this thread.
My goal is not to "emulate" any button 3.
My specific goal is to not "emulate" anything.
My goal is to learn how to edit XML files so that the related aircraft instruments behave according to my mouse inputs.
I have two mouse buttons.
I have mouse button zero (0), which is the left mouse button.
I have mouse button two (2), which is the right mouse button.
I have no "scroll" function.
Specifically, I do not want to emulate a "mouse button 3".
I want aircraft instruments to respond to my mouse commands based on my inputs from mouse button 0 (left click) and mouse button 2 (right click) only.
I am very appreciative of your time and efforts, and please take time to review the scope and limitations/requirements of my request.
captainjack
cj
captainjack
 
Posts: 81
Joined: Sat Nov 05, 2016 1:52 am

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby Parnikkapore » Sat Nov 26, 2016 1:09 pm

Unfortunately that's technically impossible, as the right mouse button is used for "Switch mouse functions/Pan view". You might need lots of changes....
There are free alternatives to (almost) every program you encounter. You just have to find them.
Parnikkapore
 
Posts: 929
Joined: Thu Oct 29, 2015 11:16 am
Callsign: HS-FGS
Version: next
OS: Kubuntu

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby wkitty42 » Sat Nov 26, 2016 6:48 pm

captainjack wrote in Sat Nov 26, 2016 4:03 am:I have two mouse buttons.
I have mouse button zero (0), which is the left mouse button.
I have mouse button two (2), which is the right mouse button.

what/where is mouse button one (1)?
how have you determined these buttons?

personally speaking:
your goal, while admirable, is akin to taking a modern day program that is written with modern mouse controls (at least three buttons and maybe a scroll wheel) and rewriting it for the ancient single button mac mouse where there is no left, right or middle buttons... simply said, it ain't gonna work and it certainly won't be easy...

the xml files are inside each craft's directory but you may have problems even then as the simulator is written to expect certain control input from certain devices and rewriting that means digging into the C/C++ code of the entire simulator...

the absolute best thing you could do is to get a three button mouse and use it on that system... they're really cheap and if you have all your USB ports filled, then get yourself a USB HUB and plug some of those things into the HUB which will free some ports... there is no limit of one device per USB port... just plug in a HUB and you've increased the number of USB devices that port will handle... the worst thing you will likely deal with with a USB HUB is needing more power for the devices plugged into it... aside from that, the various standards may get you if you get a HUB that only does USB 1.0, 1.1 and 2.0 but you have USB 3.0 devices...

to further your goal of learning the XML stuff in the crafts, just look at the XML files belonging to each in their directories...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby captainjack » Sun Nov 27, 2016 4:58 am

hi wkitty42,
we can determine these buttons by the debug menu when FG is running.
In the debug menu, there is an option to "browse internal properties"
After selecting "browse internal properties" window, select "devices".
After clicking on "devices", click on "status".
After clicking on "status", click on "mice".
After clicking on "mice", click on "mouse".
Then you can see the status button of each of your mouse's buttons.
The status of each button will change as you click and hold each button.
This window will show you how FG identifies each mouse button.
Button zero is not identified as zero, instead as only "button".
Button 1 is identified as "button [1]".
Button 2 is identified as "button [2]".
Etceteras.
Please try this and let me know if you can see what I am talking about.
This is how I identify which buttons on my mouse are recognized by Flightgear.
Button zero is the left button.
Button [1] is the center button, a button I do not have, because I have only a 2 button mouse.
Button [2] is the right button on a 2 button mouse.
Etceteras.
As for my 2 button mouse system, I have only buttons zero (left) and two (right).
My laptop does not have a mouse button [1] (center button).
Thank you for taking your time to respond to my posts, and please post again to let me know if you have used the Debug/Browse Internal Properties function to identify which mouse buttons FG recognizes.
captainjack
cj
Last edited by captainjack on Sun Nov 27, 2016 5:30 am, edited 1 time in total.
captainjack
 
Posts: 81
Joined: Sat Nov 05, 2016 1:52 am

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby captainjack » Sun Nov 27, 2016 5:08 am

Parnikkapore wrote in Sat Nov 26, 2016 1:09 pm:Unfortunately that's technically impossible, as the right mouse button is used for "Switch mouse functions/Pan view". You might need lots of changes....


hello Parnikkapore and thank you for taking your time to respond to my post.
Yes, FG reserves the right button for "Switch mouse functions", I agree.
But not the left mouse button.
So I am focused on the left mouse button, which is button zero [0] in FlightGear.
It is not technically impossible to modify the behavior of FG when this button is pressed.
The left button is used extensively for all kinds of changes in the aircraft flying environment.
So the question is about how to selectively modify the use of the left button [0] in the aircraft flying environment to get it to do what we want it to do.
Without modifiers, button zero is programmed to do only one thing, whatever that thing happens to have been programmed by the aircraft creator.
If we add a modifier to button zero [0] (such as the Control, Alt or Shift key on the keyboard) and then press mouse button zero, we can force button zero [0] to do something other than what the aircraft creator programmed it to do.
That is what my question is about:
How to get the mouse button zero [0] to behave other than the default programmed by the aircraft creator.
captainjack
cj
Last edited by captainjack on Tue Nov 29, 2016 1:59 am, edited 1 time in total.
captainjack
 
Posts: 81
Joined: Sat Nov 05, 2016 1:52 am

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby rominet » Mon Nov 28, 2016 9:03 pm

Hi,

It might be that you could free up your right mouse button by removing or adapting a few XML fragments like:
Code: Select all
   <button n="2">
    <binding>
        <command>cycle-mouse-mode</command>
        <reason>right-click</reason>
    </binding>
   </button>

in $FG_ROOT/mice.xml. I haven't tried it. Backup your file before testing.

For the other thing you're asking, something like:
Code: Select all
    <mod-ctrl>
      <binding>
        <command>property-adjust</command>
        <property>/controls/flight/rudder</property>
        <factor type="double">1.5</factor>
        <min type="double">-1.0</min>
        <max type="double">1.0</max>
        <wrap type="bool">false</wrap>
      </binding>
    </mod-ctrl>

in the same file should make you happy.

Another possibility is:
Code: Select all
    <binding>
     <condition>
      <property>/some/property/of/your/choice/you/can/set/from/a/keyboard/binding</property>
     </condition>
     <command>property-adjust</command>
     <property>/controls/flight/rudder</property>
     <factor type="double">1.5</factor>
     <min type="double">-1.0</min>
     <max type="double">1.0</max>
     <wrap type="bool">false</wrap>
    </binding>

in combination with:
Code: Select all
<key n="114">
  <name>r</name>
  <mod-alt>
    <desc>Toggle cj's bla bla mode</desc>
    <binding>
       <command>nasal</command>
       <script>
         setprop("/some/property/of/your/choice/you/can/set/from/a/keyboard/binding",
           !getprop("/some/property/of/your/choice/you/can/set/from/a/keyboard/binding"));
         gui.popupTip(
           "My fancy mode " ~
             (getprop("/some/property/of/your/choice/you/can/set/from/a/keyboard/binding") ?
              "enabled" : "disabled"),
           2);
       </script>
      <!-- <command>property-toggle</command> -->
      <!-- <property>/some/property/of/your/choice/you/can/set/from/a/keyboard/binding</property> -->
    </binding>
  </mod-alt>
 </key>

in $FG_ROOT/keyboard.xml.

(It would thus seem that:
Code: Select all
    <binding>
     <condition>
      <property>/devices/status/keyboard/ctrl</property>
     </condition>
     <command>property-adjust</command>
     <property>/controls/flight/rudder</property>
     <factor type="double">1.5</factor>
     <min type="double">-1.0</min>
     <max type="double">1.0</max>
     <wrap type="bool">false</wrap>
    </binding>

inside $FG_ROOT/mice.xml ought to work too, however it appears not to be the case. /devices/status/keyboard/ctrl is used in $FG_ROOT/Input/Joysticks/Saitek/Cyborg-Gold-3d-USB.xml.)

Edit: my snippets work with mouse motion, for instance inside:
Code: Select all
  <mode n="1">
   <x-axis>
    ...
   </x-axis>
  </mode n="1">

(not with button clicks) but maybe you can adapt.
rominet
 
Posts: 605
Joined: Sat Nov 01, 2014 2:33 pm
Callsign: F-KATS
Version: Git next
OS: Debian GNU/Linux

Re: Win7 laptop two button touchpad/mouse bindings files?

Postby captainjack » Tue Nov 29, 2016 2:10 am

rominet wrote in Mon Nov 28, 2016 9:03 pm:Hi,

It might be that you could free up your right mouse button ,,,,,,


Hello Rominet not Robinet,
Thank you for your post and your suggestions.
I read through your entire post and considered each point.
I believe that your advice is probably very good advice.
However:
I have a goal to not edit the mice.xml or preferences.xml files at all, because they are more global in nature, and I do not have enough understanding about how modifying them might affect individual aircraft in my hangar.
I am afraid that if I edited those "global" files, the edits might apply differently to different aircraft in my hangar and I would defeat my own purpose of making simple edits to accomplish my goals within the context of specific aircraft XML files.
I want to leave those files alone, I do not want to tamper with them at all.
To clarify:
I do not wish to edit mice.xml, to edit mice.xml would be too risky (dangerous)
I do not wish to edit preferences.xml, to edit preferences.xml would be too risky (dangerous)
Instead I want to edit XML files per aircraft only.
I hope you will post again to let me know that you understand the nature of the restriction that I have imposed, and if so, that you would offer any suggestions for per aircraft XML edits that might help me to control the behavior of mouse button zero at the aircraft instrument XML level.
For purposes of my post:
Mouse Button Zero (MBZero) is " <button>0</button> " and is also " button[0] "
I am glad that you come along to participate in my effort, thank you for that.
cj
captainjack
 
Posts: 81
Joined: Sat Nov 05, 2016 1:52 am

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 7 guests