Jump to content

Adding more custom controls


Recommended Posts

Updated May 15th

Hi all, 

I've attached the configuration file that includes all the custom datarefs that I use with my TM Warthog and some standard commands. I use XJoyMap for all custom commands. 
See chart below for how I mapped them in X-plane. You can map these as you please, but I find this layout to be quite efficient. Furthermore some switches are based on the how the physical switches on the TM Throttle operate, but as the config file contain a lot of different button-layouts, feel free to experiment. Any ideas on how to improve would be greatly appreciated :D

  • Some controls have been taken away from the chart and config file as they're not needed on a 733 (such as prop sync, micture axis etc). 
  • Controls with "(O)" behind them,are using original X-plane commands and can be found under regular advanced buttons. 
    • I'll add these later when I figure out how to back up the bindings from X-plane itself.
  • The TM Joystick use datarefs already configures by IXEG (such as flaps), and some other commands (X-camera, trim etc) so I excluded these for now. 

xjoymap.ini contains all customs controls
Comments.txt contains all custom datarefs from IXEG and the documentation from XJoyMap devs. 

I highly recommend using Notepad++ for editing the files! 

Challenges/Problems:

  • Mapping Keyboard commands does not work. It will work until you restart X-plane. Then it renames the command and it stops working. 
  • I've not been able to combine commands yet. Tried every logical combination there is. Any suggestions you might have, please share!

Warthog Chart:

Thrustmaster Warthog Chart - Throttle.png

 

Hello! My first post and my first encounter with the X-plane community. This is going to be fun!

I've installed X-plane a couple of weeks ago in order to get ready for the 733. In the beginning, it was quite hard to figure out the different concepts used in X-plane as they often differ from the way things are done in Prepar3d. Two weeks have passed, tons of pages read, a vast number of forums visited and I'm really starting to understand why things are done in a certain manner and the value it brings to our simulation.

Using the 733 has been a joy from the start. Yes, there are some minor bugs and glitches but all fade away when I turn off the Autopilot and manually fly this wonderful simulation. Nothing surpasses the feeling of having all your confidence stripped away when trying to land in Norway during a winter storm. Never ever have I experienced anything like this in a simulator before!

Outstanding work Gentlemen!

So over to my first of probably many questions to come:

In the Interface guide PDF, there are several custom controls that are listed. Mapping these was surprisingly simple, and I can now use my Thrustmaster Hotas for the most common controls needed. There are however more controls listed underneath in the same document for "more advanced users" that I would certainly like to map as well. How do I configure X-plane to use these controls? Are there any information or general documentation on the subject? I have read some SDK-info and are starting to figure out how the logic behind the mapping is done, but I'm struggling to find out how one configures controllers to the custom controls within the simulator itself. 

Any advice or "pointing me in the right direction" would be greatly appreciated. 

Sincerely

Torbjørn

Comments.txt

xjoymap.ini

Edited by Torbjoern
  • Upvote 1
Link to post
Share on other sites
  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi gents...welcome.   I've been a bit too busy to come play with you guys but will at some point.   Once we get a few more features in and this things stabilizes, then I'll poke my head in here and we

Thanks Jeremy!  Looks really very promising indeed. Keep 'em coming ;o)  

Hi Kopelent.  EHSI Map mode and range below. xjoymap will create reversed commands automatically. This is button-based. For axis/wheel, I found that there are several good examples in xjoymaps do

Posted Images

Hi Guys,

 

first of all thanks to the team for sharing all those custom commands with us - a pleasure for us cockpit builders.

@ Torbjørn:

I figured that the plugin xjoymap works fine with this plane. You will have to install the Python Script plugin to get it working - but no worries, it is very straight forward.

Attached you find my config file with the full light panel, the Power source panel and the Fuel panel as well as the engine starter panel working for me (perhaps not 100% mapping the Hotas positions but a starter)

I will continue working on the mapping - but basically you can place all those custom commands in the config file.

As soon as you did this, you can map those commands which are now know to the sim to the switches in this context menue:

The now globally known commands are then placed here:

 

Please let me know if that helps! :-)

Tobi

PythonInterface.ini

Link to post
Share on other sites

Hi Tobi!

Awesome info. Thanks! We're are definitely heading in the right direction now. It seems that the file you attached only draws callback from the debug, but that might be intended? Anyhow, I can see a template for the x737 that is included in the plugin (.xjm file), but if you already have one on the way, could you share that one as well?

Again, thanks for the help so far :o)

 

Edit1:

Tried adding a simple Taxi-light command:

[Taxi Light]
new_command=Taxi
dataref="ixeg/733/lighting/taxi_lt_act"
on_value = 1
off_value = 0

Works like a charm! Outstanding :o) 

Well, time to open a Redbull and get started creating some new controls. 

 

Torbjørn

 

 

Edited by Torbjoern
  • Upvote 1
Link to post
Share on other sites

Hey Torbjørn,

I will start on the x737 after I finisehd this plane as the 3D cockpit version will only be released end of this month.

" It seems that the file you attached only draws callback from the debug, " can you explain in detail what you mean by that ;-)? Sorry but I dont get it.

 

Tobi

 

Link to post
Share on other sites

When i open the attached file "PythonInterface.ini", it contains:

[DEBUG]
DebugCallbacks = 0
CheckCallbacks = 0
 

The x737 was only an example file provided with the plugin, so i used it as an example on the type of file I'm looking for. You don't have to do another file for the x737 just for me :o)

But I'm guessing you've attached the wrong file?

Torbjørn

 

 

 

  • Upvote 1
Link to post
Share on other sites

Puh! I started to fell somewhat stupid there for a second.

This looks much better. Thank you so much Tobi. If this is the benchmark of the community, then my X-plane future is lookin' good!
I will try to create a sensible Warthog Hotas config-set from all of this and continue with the control-sets. 

If you're building a cockpit yourself, please don't hesitate to share more info. It's always interesting to see what the experts are able to pull off.

Sincerely

Torbjørn

 

  • Upvote 1
Link to post
Share on other sites

Hi gents...welcome.   I've been a bit too busy to come play with you guys but will at some point.   Once we get a few more features in and this things stabilizes, then I'll poke my head in here and we can discuss if any extra datarefs are needed.  Thanks for jumping in.

-tkyler

  • Upvote 4
Link to post
Share on other sites

EDIT: EHSI now working

Okay, so been trying for a couple of days now...

Some experiences so far is shared below. If anyone see something interesting or odd, please shout out.  I'm more than happy to try out different approaches and ways to get all the datarefs I want to work :o) 

My goal is to provide a "complete" control-set for the most used switches, buttons and knobs for the TM Warthog. 
 

Landing Lights
Turning the all on, no issue at all. Using a toggle-button on my hotas. Flip up; all light on. 

;Regular Landing Lights all on, but cant turn off. 
[Landing Lights On]
new_command=Landing Lights
dataref=ixeg/733/lighting/land_light_all_act
on_value = 1
off_value = 0

Turning the off is a different matter. I tried to solve this by taking the inboard LL first, as they are only two staged and makes things less complicated. The issue is however how to combine two datarefs into one command. There was some hints that I could first combine multiple datarefs, then set the value applicable for theese and different on/off values, and then combine these into one button, but I did not succeed. 

Inboard and outboard also contain different values themselves. Inboard is 0 and 1. Outboard is 0(off), 1(extend) and 2 (on). Finding a logical solution of combining them all in a good manner is quite challenging. Also after watching the wonderful video from Airline2Sim, it turns out that one doesn't extent the inboard lights on takeoff due to drag (same as with MD80) which was quite informative. So combining the datarefs for inboard lights is my priority.

See failed try:

;Defining left light Combo6
[Landing Light Combo]
new_command=Landing Lights Combo6
dataref=ixeg/733/lighting/l_inboard_ll_act

;Defining right light Combo7
[Landing Light Combo]
new_command=Landing Lights Combo7
dataref=ixeg/733/lighting/r_inboard_ll_act

;Defining Command that combines nr 6 and 7 to one command "8" and sending it to X-plane
[Landing Light Combo]
new_command=Landing Lights Combo8
main_command=Landing Lights Combo6
main_command=Landing Lights Combo7
on_value = 1
off_value = 0

Taxi-lights.
Quite easy. Simple on/off state. Flip a switch, they're on and visa versa:

;Regular Taxi Light On Off Switch
[Taxi Light]
new_command=Taxi Lights
dataref=ixeg/733/lighting/taxi_lt_act
on_value = 1
off_value = 0

Turnoff-lights (using spring switch)
This was just for fun. The TM Hotas has two spring-switches with three values. 0(regular "off") 1(regular "on") and 2(spring). I wanted the spring-switch "2" to turn the lights on. Then when I did the same thing again, turn them off. Flick up to turn on and flick up to turn off again.   
The problem is that the the switch "springs" back, the light turns off (naturally). So finding some way to keep the value of the input, and then repeat it is something I'm looking into. Right now I'm not using the spring-value and simply use "0" and "1". Works fine for now. 

;PROBLEM: Cant set spring button to set and forget
[Runway Turnoff Left]
new_command=Runway Turnoff Left
dataref=ixeg/733/lighting/l_rwy_turnoff_act
description=Runway Turnoff Left
on_value = 1
off_value = 0

[Runway Turnoff Right]
new_command=Runway Turnoff Right
dataref=ixeg/733/lighting/r_rwy_turnoff_act
description=Runway Turnoff Right
on_value = 1
off_value = 0

 

EHSI increase by button
Alright. This does the trick. xjoymap also creates a "reverse" command automatically. I now use the four-way mic-toggle to increase and decrease EHSI map range. Cool!

[EHSI Mode Flick]
new_command=EHSI Mode Flick
dataref=ixeg/733/ehsi/ehsi_mode_cpt_act
description=EHSI Test
values = 0, 1, 2, 3, 4


This one is quite interesting. I'm able to move the rotating switch. But I can't figure out a way to limit the rotation. 
Say that button-click rotates the EHSI-knob once to the right, when you get to the last value and click it again, it actually rotates the knob beyond the limit and it returns a Gizmo-warning. The switch actually physically rotates beyond the limit as well ;o) So setting a fixed limit, giving each point on the rotation a value and making sure that increasing (or decreasing by another button) does not exceed that limit is something I simply can't figure out. Below is just an example of the multiple ways I've tried. 

;Problem Limit is reached and return Console warning. How to set threshold
;[EHSI Mode Increase by one]
;new_command=EHSI mode increase by one
;dataref=ixeg/733/ehsi/ehsi_mode_cpt_act
;description=EHSI mode increase by one
;values = 0, 1, 2, 3, 4
;increment=1

;[EHSI Mode Decrease by one]
;new_command=EHSI Mode Decrease by one
;dataref=ixeg/733/ehsi/ehsi_mode_cpt_act
;description=EHSI Mode Decrease by one
;increment=-1
;type=float
;repeat=True

Other ways to program buttons
The way as described above has its limitations. I looked at "Cosmopilots" lua-file (here
I was able to import this into FlyWithLua, but the script stopped "due to unknown character after then", but the script seems fine to me. It should probably use something else than FlyWithLua? 

 

 

Edited by Torbjoern
  • Upvote 1
Link to post
Share on other sites

Tobi,

Thanks for the above - it's extremely helpful.

I've used your 737 template as a starting point and am able to operate all the lights correctly using my VRInsight FMCU. (I use keymapper to assign various key combinations to the unit. I use pushbuttons for the lights - rather than toggles -  so altered the values to reflect this.)

I have come across an issue which seems to be related to the order in which the python script is loaded, however: my X-Plane Keys.prf is being over-written every time I load XP. The PythonInterfaceLog shows that the datarefs being referenced via Xjoymap are not being loaded in time so I assume that XP attempts to replace the relevant key combinations.

I can manually reselect these key combinations from within XP but this gets cumbersome when there are so many of them!

Any suggestions here???

  • Upvote 1
Link to post
Share on other sites

Hi Jeremy, 

Taking the liberty to answer this.  Check the python-script for any commands that remove the bindings. If its a template, usually it is one of the first commands. Several templates I have found, start the script by removing any bindings you already have. Luckily, I spotted it simply by chance after reading some feedback on the posters from another forum :o)

I think the idea is that they "clear" out any problems before loading their own bindings. 

Torbjørn

  • Upvote 1
Link to post
Share on other sites
13 hours ago, Torbjoern said:

Hi Jeremy, 

Taking the liberty to answer this.  Check the python-script for any commands that remove the bindings. If its a template, usually it is one of the first commands. Several templates I have found, start the script by removing any bindings you already have. Luckily, I spotted it simply by chance after reading some feedback on the posters from another forum :o)

I think the idea is that they "clear" out any problems before loading their own bindings. 

Torbjørn

Hi Torbjørn,

Many thanks for this. I'll check the scripts and report back!

  • Upvote 2
Link to post
Share on other sites
3 hours ago, Kopelent said:

datarefs for EHSI Map range and map mode would be very helpfully for many user i think

Hi Kopelent. 

EHSI Map mode and range below. xjoymap will create reversed commands automatically. This is button-based. For axis/wheel, I found that there are several good examples in xjoymaps documentation. But I mainly use buttons, so I haven't looked at that. 

--code--

[EHSI Mode]
new_command=EHSI Mode
dataref=ixeg/733/ehsi/ehsi_mode_pt_act
description=EHSI Mode
values = 0, 1, 2, 3, 4

[EHSI Range]
new_command=EHSI Range
dataref=ixeg/733/ehsi/ehsi_range_pt_act
description=EHSI Range
values = 0, 1, 2, 3, 4, 5

  • Upvote 2
Link to post
Share on other sites

Hi Torbjørn,

No success... XP still over-writes the saved buttons from XJOY

The commands all still there but, for example, the button I select for "Landing Lights 1" reverts to just "Landing Lights" when I reload XP.

Hmmmmm

Edited by Jeremy Carter
  • Upvote 1
Link to post
Share on other sites
24 minutes ago, Jeremy Carter said:

Hi Torbjørn,

No success... XP still over-writes the saved buttons from XJOY

The commands all still there but, for example, the button I select for Landing Lights 1 reverts to just "Landing Lights" when I reload XP.

Hmmmmm

Hmm, interesting. Could you share the script and what plugins you use? 

I simply installed the Python-interface plugin, and Xjoymap. Inserted the datarefs needed, and they popped up in X-plane custom commands under settings (xjoymap). Never experienced that X-plane removed the bindings. Are you sure that there aren't any LUA-scripts running and interfering with xjoymap?

 

EDIT: Here is my config-file so far. 

xjoymap.ini

Edited by Torbjoern
  • Upvote 1
Link to post
Share on other sites
1 minute ago, Torbjoern said:

Hmm, interesting. Could you share the script and what plugins you use? 

I simply installed the Python-interface plugin, and Xjoymap. Inserted the datarefs needed, and they popped up in X-plane custom commands under settings (xjoymap). Never experienced that X-plane removed the bindings. Are you sure that there aren't any LUA-scripts running and interfering with xjoymap?

Sure:

EFASS, Gizmo64 (for iXEG 737), Python Interface (obviously!), SilverLining (Skymaxx), XPUIPC, XPWideClient, XSquawkbox, Landing Speed, GroudTraffic (Aerosoft)

Files attached. The IXEG makes extensive use of LUA but I removed FlyWithLua plugin and it made no difference.

Thanks in advance for your help!!

 

PI_xJoyMap.py

xjoymap.ini

  • Upvote 1
Link to post
Share on other sites

Can't see anything wrong here. Did a compare on the files to look for errors in the PI_xJoyMap.py and it looks just like mine. 

One thing I do see, is that EHSI Map Range is written three times at the top using the same dataref and same name, but with minor adjustments. If you, like me, only use buttons, I would try to remove everything you don't use in the xjoymap.ini file (after making a copy of course), and see if that helps. It's a long shot, but worth at least worth a try ;o)

I don't use XPUIPC, XPWideClient, Landing Speed, GroundTraffic or SilverLining, so I can't say if these are interfering in any way. 
It should be noted that I'm an X-plane newbie ;o)

 

Found something on x-plane.org. Relevant?

On 3/17/2012 at 2:59 AM, Rich Webb said:
Joan, thanks for the great script! I'm using this to map CRJ-200 datarefs to advanced commands and I'm running into a problem with what I think is the load order of things. If I just start up xplane and the crj is the default aircraft none of my keys work straight away. I have to either reload the scripts using the python interface plugin control panel or reload the aircraft. Once I do that everything works. Do you know of a way I could fix that?ThanksRich

Hi Rich,

Its just that xjoymap loads too soon and the crj plugin haven't had time to register its datarefs. That's a known issue that I have to correct some day. I have to add a configurable wait delay on the xjoymap files and code the feature. Since then, the reload is mandatory, sorry for that ;-P.

Oh there's no need to reload python just use the xjoymap "reload config" menu item.

Thanks for your comments.

PD: Its not all my fault, others planes like x737 send a "I've finished loading" message that xjoymap can wait for.

Edited by Torbjoern
  • Upvote 1
Link to post
Share on other sites

Thanks. Will remove the redundant references to EHSI though tried this before - with just lights added - and that didn't work.

Where do you place your xjoymap.ini btw? In the resources/plugin folder or in the aircraft one?

When you say you installed XjoyMap.... do you mean you created a folder for it in plugins?

  • Upvote 1
Link to post
Share on other sites

Also check if the info from the edit above helps (reloading xjoymap after loading everything). 
This has not been a problem for me, but it might be worth trying. 

Right now I'm looking at this file: http://forums.x-plane.org/index.php?/files/file/13581-crj200-custom-buttons/&tab=comments
Their approach is to create a sort of "profile" that is included in the aircraft folder. There might be some value to doing it this way, especially if I'm going to do multiple configurations for multiple aircraft. There is also a plugin that lets me set up one profile for each aircraft so I can change the bindings for each aircraft automatically. 

I''m really starting to like X-plane a lot! Although I miss FSUIPCs user interface and PMDGs way of setting up the controls directly in the FMC, the customization options is endless. Cool stuff indeed. 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...