Board index FlightGear Support Hardware

Joystick xml codes Library project - open for contributions  Topic is solved

Joysticks, pedals, monitors.

Joystick xml codes Library project - open for contributions

Postby sim » Sun Jun 05, 2011 4:00 pm

UPDATE 19JULY2019
https://www.dropbox.com/sh/8y5z6dqde0i9bja/AADebJGckB9glOyCswcK0mNLa?dl=0
OLD LINKS SEEM TO HAVE DISABLED BY DROPBOX BUT ABOVE NEW LINK MAY OPEN FOLDER CONTAINING SOME FLIGHTGEAR FILES STORED

LIST OF NUMBERED FILES TO HELP YOU FIND SPECIFIC ITEMS
some you will be read only but most can be downloaded


1 BUTTON AXIS STICK TESTER
2 AILERON TRIM
3 BRAKE LEFT OR RIGHT
4 BRAKES
5 ELEVATOR TRIM
6 FLAPS
7 LANDING GEAR SCRIPTS
8 PAN VIEW DIRECTION AND PITCH
9 RESET VIEW
10 ZOOM VIEW
11 Adjust view, have one quick look 90 deg left or right
12 ADJUST XYZ VIEWPOINT SCRIPTS
13 Ajust View by Hat, LeftRight, UpDown
14 Adjust View, have a progressive look left or right, by the stick twist axis -if you have a separate rudder Pedals
15 TAIL WHEEL LOCK
16 Joystick Button Number Tester
17 STICK NOT WORKING?
18 INSTALLING FLIGHTGEAR SCENERY FOR A WINDOWS PC
19 TIPS TO GET A JOYSTICK WORKING (INCLUDING DIFFICULT CASES)
20 SINGLE BUTTON SPEEDBRAKES
21 COORDINATION OF AILERON & RUDDER - AN ESSENTIAL SKILL
22 USE OF RUDDER WHERE AUTOCOORDINATION MUST BE OFF
23 VIRTUAL MUSEUM ALL WORLDS AIRCRAFT OLD & NEW LOOK HERE
24 PS3 Joypad XML from FG forum contributed by anewb
25 Named Aircraft specific configuration of a control
26 INSTALLING PLANES
27 HAT or 2 Button RUDDER TRIM CODE by Dany
28 Saitek FLY 5 xml joystick code
29 HELICOPTOR SomeGuy’s Code to set throttle used as collective
30 INSTALING SEVERAL VERSIONS OF FIGHTGEAR
31 JOYSTICK XML "for Genius Metal Strike 3D" by Tomaskom
32 Microsoft Sidewinder Joystick xml

Logitech Extreme Digital 3D Pro Joystick
Polly's.....viewtopic.php?f=24&t=36124#p351246
http://www.flightgear.org/forums/viewto ... 15#p155554
CyborgX xml
637 Logitek Attack 3xml
Saitek Rumble Pad P2500
Last edited by sim on Fri Jul 19, 2019 2:10 pm, edited 41 times in total.
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Joystick xml codes simple Library project

Postby dany93 » Sun Jun 05, 2011 10:36 pm

Very nice idea and initiative.

If possible (but we need Gijs), an easier way to fill in and find out the subjects would be in this forum. That seems possible because such code is small in memory.
I imagine a hierarchy (Support < Hardware < Joystick Library, or Joystick code, or some short title) with a topic like this as the chief one, then sub topics which could be "Views", "Elevator Trim", "Aileron Trim", "Rudder Trim", "Gear", "Brakes" "Flaps", "Magnetos", "Mixture", "Propeller RPM" etc.... New subtopics could be created by everyone if not yet existing, or filled in simply by the mean of a new post with a descriptive title if the appropriate subtopic is already created. Some explanatory comments at the beginning the code would be welcome, especilally if we wish to gather it into a Wiki later.

Advantage: It would be flexible and easy to consult and fill in, not discouraging for contributors.

Possible problems:
- needs some self-discipline to be short and abide by the subject contents when created,
- not easy to later gather it into a wiki (needs manual collecting of code lines).

Just maybe for the idea, probably still to improve....

Dany
dany93
 
Posts: 861
Joined: Mon Sep 07, 2009 4:43 pm
Location: France (Paris region)
Version: 2020.4.0
OS: Linux Mint 20.3

Re: Joystick xml codes simple Library project

Postby sim » Mon Jun 06, 2011 2:01 am

Thanks Dany,
As you suggest each notepad just covers one script topic, so fliers will not be taking on too much, choosing one notebook subject. Most script possibilities will have been topics of previous posts. Searching the forum will help them compile codes relevant to their chosen task.
Not sure if there are enough old hands to help out, we will see. Hope we have a few contributors just to get started as I don't expect miracles. If there is some enthusiasm I reckon in a years time this topic will still be running and the "Library" will be 50% complete.
That amount of progress will mean newcomers will easily be able to find most simple scripts and quite a few more sophisticated codes.
I will be Librarian for now and use Dropbox to store them. Easy to post the Dropbox URL here, so everyone has access.

Fingers crossed, I hope this works!.........sim

http://dl.dropbox.com/u/11151437/XML%20LIBRARY.zip
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Joystick xml codes simple Library project

Postby dany93 » Mon Jun 06, 2011 9:24 am

OK, that's a way to have it in a consistent form, almost ready for a Wiki. But, if I understand well, contributions have to be gathered into a single XML LIBRARY (.zip) folder.

What is the procedure if I (or someone else) have some code to add,
- either into an already existing notepad (i.e. your ADJUST VIEWPOINT SCRIPTS.txt),
- or if I wish to create, and start filling in a new notepad (i.e. ELEVATOR-TRIM.txt)?
==> Send them as code in this thread, for you to copy and include them into your Dropbox XML LIBRARY (into the right notepad subject, or by creating a new notepad)?

Waiting for your response to send you my first contribution. I'm not sure to understand what you wish, but I would prefer sending my known code lines for insertion into several subjects (notepads).

We just have to start some notepads. Once started, the notepads should attract contributors and live...

Note: Several code instructions in a row on the same line (like LANDING GEAR SCRIPTS.txt, ADJUST VIEWPOINT SCRIPTS.txt) have to avoided. That's almost unreadable.

Dany
dany93
 
Posts: 861
Joined: Mon Sep 07, 2009 4:43 pm
Location: France (Paris region)
Version: 2020.4.0
OS: Linux Mint 20.3

Re: Joystick xml codes simple Library project

Postby Gijs » Mon Jun 06, 2011 11:27 am

dany93 wrote in Mon Jun 06, 2011 9:24 am:OK, that's a way to have it in a consistent form, almost ready for a Wiki.

Right, and that's the place where such "documentation" is at its best. The forum isn't ideal for documentation; you can discuss joystick files here though or ask for extra help (apart from the wiki docs)...
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Joystick xml codes simple Library project

Postby Talmid » Mon Jun 06, 2011 11:57 am

Hi Dany, Hi sim, Hi Gijs,

I hope you don't mind if I chip in my 2 cents, pence, whatever. :D And I hope I don't sound like a broken record. But from a newbie's perspective, we come to the forum for this type of information. It's what we know and it's comfortable. So why put the information outside of the forum? sim, I have to agree with Dany on this point.

My original thought was that URL links to types of code snippets could be organized in a 'sticky' thread at the top of the subforum for joysticks. So the original 'sticky' would be a series of commented links to 'locked' threads that only the mod (read: librarian) could edit or modify. Since these locked threads can be exported easily, this would facilitate building the wiki too.

There would also need to be a separate and open thread or threads specifically for contributions. The contributions could be simply evaluated, edited and moved into the locked threads; 1) keeping the librarian in charge all organizational aspects of the project, 2) keeping the contribution thread(s) manageable because posts are being removed as they are evaluated and 3) offer a motivation to the users in the forum to contribute the code they find, because contributions would be credited to the first person to contribute them (not excluding the credits already in the commented code, of course)! People love to see their names in lights so to speak. In this way, non-coders can be motivated to participate and included in the task of locating, evaluating and submitting the code they find. I would even suggest a 'tally' at the top of the forum tracking the top 10 contributors. Nothing like a little competition to fire up people to a cause.

What is there, five years or more of code for bindings out there? We're going to need all the help we can get!

BTW, I would like to suggest a final catagory of code: Complete binding files, ready to copy and use 'out of the box'. So that for the Attack-3 for example, might have 5, 10 or 25 different complete files ranging in complexity and configuration as final products of the contributed code snippets. A newbie or an old hand could simply select and install a pre-tested joystick configuration that suited their needs and preferences. Or for that matter, build a library of files so that an individual file might be loaded based on which plane they are flying.

Now I know that there the Git repository of XML files for joysticks, but they are relatively basic, no? So Git would only benefit from a project such as this. I'm looking for the proverbial win-win. So what do you think?
Dain Bramaged...
Talmid
 
Posts: 80
Joined: Thu May 26, 2011 5:14 am
Location: Gulf Plains of Texas
Version: 2020.3.11
OS: Windoze 10

Re: Joystick xml codes simple Library project

Postby sim » Mon Jun 06, 2011 2:09 pm

Fine Talmid, As far as I can see that all makes sense. I confess though I seldom go to the WIKI for script info, prefering to trawl through old code boxes posted on the Forum by the pundits who show just how amazingly flexible xml stuff is. Or search FG xml and nas for snippets!
Tried the FSX trial version and found it fails abyssmally when it comes to joystick formating, not a patch on what FG gives you!
Notepad is by far the simplest and easiest file to search so I really don't want to bother WIKI people and make work for them at this stage in formalising it. Unless WIKI can host the "Library" as simple notepads readily available to all. They will have of course to be hosted as "read only" so contributors don't have anyone accidently or deliberately messing files up!
Meanwhile I have put a few notepads in DropBox and it works. Why fix it, if it ain't broke! After all once we have an "official librarian" he can copy the lot and put 'em where ever fliers agree is best...........sim

http://dl.dropbox.com/u/11151437/XML%20LIBRARY.zip
Last edited by sim on Mon Jun 06, 2011 2:39 pm, edited 1 time in total.
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Joystick xml codes simple Library project

Postby dany93 » Mon Jun 06, 2011 2:30 pm

Talmid wrote in Mon Jun 06, 2011 11:57 am:BTW, I would like to suggest a final catagory of code: Complete binding files, ready to copy and use 'out of the box'.

Hi Talmid,

Such binding files can already be found in FlightGear\data\Input\Joysticks\ , although in a limited number and not for all of the joysticks. But the number of possible configurations even for a given joystick is very large, hence the interest of such a "Library" of elementary codes, which, most of the time AFAIK for my system, are not joystick-dependent.

Hints for beginners (or advanced ones, but not too much) :
For me, those ready-to-use joysticks files have been my first source to build my own file, starting from one not too far from my need and easy to understand. I could have started from FlightGear\data\Input\Joysticks\Default\Joysticks.xml or FlightGear\data\Input\Joysticks\template.xml. After that, my other sources for adding elementary actions have been any joystick files content. As an other important source, we can add FlightGear\data\keyboard.xml , because many questions are about using a joystick button to do a usually keyboard action. For this, finding your desired code lines in keyboard.xml is easier if you know your key or key-combination output number. It can be read in (File > Browse Internal Properties)/devices/status/keyboard/event/ key = ' '. After having found your binding code, you just have to copy-paste it, changing <key> for <button> at each end.

I think those points are important to be known by new users (as the +/-1 shift on button numbers between files and joystick labels, usual question). Good to have an easy enough starting point, but better to have the tools than recipes or 'Black Boxes'.

Dany
dany93
 
Posts: 861
Joined: Mon Sep 07, 2009 4:43 pm
Location: France (Paris region)
Version: 2020.4.0
OS: Linux Mint 20.3

Re: Joystick xml codes simple Library project

Postby dany93 » Mon Jun 06, 2011 3:14 pm

Hi, Sim (the 'Librarian')

Here are my contributions (elementary but we have to start...)

Brakes (0, or 1 when pressed)

Code: Select all
<button n="0">
  <desc>Brakes</desc>
  <binding>
   <command>nasal</command>
   <script>controls.applyBrakes(1)</script>
  </binding>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>controls.applyBrakes(0)</script>
   </binding>
  </mod-up>
 </button>


Elevator Trim

Code: Select all
<button n="2">
  <desc>Elevator trim up</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-adjust</command>
   <property>/controls/flight/elevator-trim</property>
   <step type="double">-0.001</step>
  </binding>
 </button>

 <button n="3">
  <desc>Elevator trim down</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-adjust</command>
   <property>/controls/flight/elevator-trim</property>
   <step type="double">0.001</step>
  </binding>
 </button>


Aileron Trim

Code: Select all
<button n="10">
  <desc>Aileron trim left</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-adjust</command>
   <property>/controls/flight/aileron-trim</property>
   <step type="double">-0.001</step>
   <!-- <command>nasal</command>
   <script>controls.aileronTrim(-0.5)</script> -->
  </binding>
 </button>

 <button n="11">
  <desc>Aileron trim right</desc>
  <repeatable type="bool">true</repeatable>
  <binding>
   <command>property-adjust</command>
   <property>/controls/flight/aileron-trim</property>
   <step type="double">0.001</step>
   <!-- <command>nasal</command>
   <script>controls.aileronTrim(0.5)</script> -->
  </binding>
 </button>



Flaps

Code: Select all
<button n="4">
  <desc>Flaps down</desc>
  <repeatable>false</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.flapsDown(1)</script>
  </binding>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>controls.flapsDown(0)</script>
   </binding>
  </mod-up>
 </button>

 <button n="5">
  <desc>Flaps up</desc>
  <repeatable>false</repeatable>
  <binding>
   <command>nasal</command>
   <script>controls.flapsDown(-1)</script>
  </binding>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>controls.flapsDown(0)</script>
   </binding>
  </mod-up>
 </button>


Landing Gear (two buttons, seems same as yours, but easier to read with CR's)

Code: Select all
<button n="6">
  <desc>Landing Gear Up</desc>
  <binding>
   <command>nasal</command>
   <script>controls.gearDown(-1)</script>
  </binding>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>controls.gearDown(0)</script>
   </binding>
  </mod-up>
 </button>

 <button n="7">
  <desc>Landing Gear Down</desc>
  <binding>
   <command>nasal</command>
   <script>controls.gearDown(1)</script>
  </binding>
  <mod-up>
   <binding>
    <command>nasal</command>
    <script>controls.gearDown(0)</script>
   </binding>
  </mod-up>
 </button>


Adjust view, have one quick look 90 deg left or right

Code: Select all
<button n="8">
   <desc>Look left</desc>
   <binding>
    <command>property-assign</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <property>/sim/view/config/left-direction-deg</property>
   </binding>
  <mod-up>
   <desc>Look forward</desc>
   <binding>
    <command>property-assign</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <property>/sim/view/config/front-direction-deg</property>
   </binding>
  </mod-up>
 </button>

 <button n="9">
   <desc>Look right</desc>
   <binding>
    <command>property-assign</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <property>/sim/view/config/right-direction-deg</property>
   </binding>
  <mod-up>
   <desc>Look forward</desc>
   <binding>
    <command>property-assign</command>
    <property>/sim/current-view/goal-heading-offset-deg</property>
    <property>/sim/view/config/front-direction-deg</property>
   </binding>
  </mod-up>
 </button>


Adjust View, have a progressive look left or right, by the stick twist axis (if you have a separate rudder pedals)

Code: Select all
<axis n="3">
  <desc>(twist) View Direction</desc>
  <binding>
   <command>property-scale</command>
     <property>/sim/current-view/goal-heading-offset-deg</property>
   <factor type="double">-180</factor>
  </binding>
 </axis>


Ajust View by Hat, Left/Right, Up/Down

Code: Select all
  <axis n="6">
   <desc>View Direction</desc>
   <low>
    <repeatable>true</repeatable>
    <binding>
     <command>property-adjust</command>
     <property>/sim/current-view/goal-heading-offset-deg</property>
     <step type="double">1.0</step>
    </binding>
   </low>
   <high>
    <repeatable>true</repeatable>
    <binding>
     <command>property-adjust</command>
     <property>/sim/current-view/goal-heading-offset-deg</property>
     <step type="double">-1.0</step>
    </binding>
   </high>
  </axis>

  <axis n="7">
   <desc>View Elevation</desc>
   <low>
    <repeatable>true</repeatable>
    <binding>
     <command>property-adjust</command>
     <property>/sim/current-view/goal-pitch-offset-deg</property>
     <step type="double">1.0</step>
    </binding>
   </low>
   <high>
    <repeatable>true</repeatable>
    <binding>
     <command>property-adjust</command>
     <property>/sim/current-view/goal-pitch-offset-deg</property>
     <step type="double">-1.0</step>
    </binding>
   </high>
  </axis>
dany93
 
Posts: 861
Joined: Mon Sep 07, 2009 4:43 pm
Location: France (Paris region)
Version: 2020.4.0
OS: Linux Mint 20.3

Re: Joystick xml codes simple Library project

Postby sim » Mon Jun 06, 2011 5:29 pm

Talmid,Dany,Gijs.
Can you all check DropBox link works ok for you? Let's put initial contributions there for now. Until we have built enough of a collection to make WIKI..ing them meaningful!

WIKI is a foreign country to me. So Talmid!... sounds as though you are at home there and can be our first Librarian if you are happy to do it?

You can start transfering them to WIKI once each notepad has the thumbs-up.

Your "out of the box" idea is good for the simple button codes and property-assign, property-toggle etc bindings. LANDING GEAR SCRIPTS notepad gives 3 ready to go formats. Just button numbers to ammend if required.

LANDING GEAR SCRIPTS 2nd and 3rd items are lengthier setprop codes that go between <script> markers. Is that ok with all of you?
There are going to be many such setprop getprop etc codes. Not sure we should even try to pack all these into neat little button bindings as "ready to go". I love 'em because you can stick half a dozen, end to end, between <script> markers so they all go off like fireworks just when you need 'em! FSX eat your heart out! So joking aside do we really need to "button them up". Or will it suffice to give beginners one nice example buttoned up and ready to go to delight them and wet their appetite!.............sim
User avatar
sim
 
Posts: 1431
Joined: Tue Jun 30, 2009 3:13 pm
Location: Shropshire England
Callsign: Fly4Fun
Version: 0.9.10 up
OS: 64 Win 10 HD6450

Re: Joystick xml codes simple Library project

Postby Talmid » Mon Jun 06, 2011 5:41 pm

Hi Guys,

Hey sim, WIKI is foreign to me too, except for what I read. I have a dynamic IP address so it won't even let me register, much less login. :(
Dain Bramaged...
Talmid
 
Posts: 80
Joined: Thu May 26, 2011 5:14 am
Location: Gulf Plains of Texas
Version: 2020.3.11
OS: Windoze 10

Re: Joystick xml codes simple Library project

Postby Talmid » Mon Jun 06, 2011 6:22 pm

Hi sim, Hi Dany, Hi Gijs, Hi everyone,

Could you guys look at THIS POST and THIS POST. I want to be able to contribute, but I need a little help. :shock: Now aren't you glad you got me started programming again after a decade or more off? :P

OH! How do I determine which aircraft is loaded in FG from a joystick XML? It is probably a property, right? But I don't know which one. I guess I might need links to all FG properties and some nasal referrences and instructions. Is there a command referrence with syntax templates? Anyway, thanks in advance for the help. I'll try not to bug you too much after I get up and running. :D

Thanks you, thank you, thank you...
Dain Bramaged...
Talmid
 
Posts: 80
Joined: Thu May 26, 2011 5:14 am
Location: Gulf Plains of Texas
Version: 2020.3.11
OS: Windoze 10

Re: Joystick xml codes simple Library project

Postby dany93 » Mon Jun 06, 2011 6:58 pm

Talmid wrote in Mon Jun 06, 2011 6:22 pm:How do I determine which aircraft is loaded in FG from a joystick XML?

See (Internal Properties)/sim/aircraft = ' '

But I could not find how to use this information to point to a particular joystick_Binding_File.xml (condition? nasal?).

Dany
dany93
 
Posts: 861
Joined: Mon Sep 07, 2009 4:43 pm
Location: France (Paris region)
Version: 2020.4.0
OS: Linux Mint 20.3

Re: Joystick xml codes simple Library project

Postby Talmid » Mon Jun 06, 2011 7:01 pm

dany93 wrote in Mon Jun 06, 2011 6:58 pm:
Talmid wrote in Mon Jun 06, 2011 6:22 pm:How do I determine which aircraft is loaded in FG from a joystick XML?

See (Internal Properties)/sim/aircraft = ' '

But I could not find how to use this information to point to a particular joystick_Binding_File.xml (condition? nasal?).

Dany


Thanks Dany, but see where? Is there a link? Is it in a directory somewhere?
Dain Bramaged...
Talmid
 
Posts: 80
Joined: Thu May 26, 2011 5:14 am
Location: Gulf Plains of Texas
Version: 2020.3.11
OS: Windoze 10

Re: Joystick xml codes simple Library project

Postby Gijs » Mon Jun 06, 2011 7:36 pm

Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 2 guests