1
0
Fork 0

Add button bindings for engine to joystick config

At the suggestion of Gilberto AGOSTINHO, add
button bindings for throttle, mixture and prop
to the joystick configuration dialog.

Specific use-case is users of game-pads, but also
useful to users with a single throttle axis on their
joystick.
This commit is contained in:
Stuart Buchanan 2016-02-10 22:21:18 +00:00
parent c6da4a2b65
commit 221235063b
2 changed files with 228 additions and 137 deletions

View file

@ -495,6 +495,13 @@ var NasalHoldButton = {
};
var buttonBindings = [
NasalButton.new("Throttle Up", "controls.incThrottle(0.01, 1.0);", 1),
NasalButton.new("Throttle Down", "controls.incThrottle(-0.01, -1.0);", 1),
NasalButton.new("Mixture Rich", "controls.adjMixture(1);", 1),
NasalButton.new("Mixture Lean", "controls.adjMixture(-1);", 1),
NasalButton.new("Propeller Fine", "controls.adjPropeller(1);", 1),
NasalButton.new("Propeller Coarse", "controls.adjPropeller(-1);", 1),
NasalButton.new("Elevator Trim Up", "controls.elevatorTrim(-1);", 1),
NasalButton.new("Elevator Trim Down", "controls.elevatorTrim(1);", 1),
NasalButton.new("Rudder Trim Left", "controls.rudderTrim(-1);", 1),

View file

@ -67,7 +67,7 @@ var assignButton = func(cmd) {
<text>
<row>0</row>
<col>0</col>
<label>Flight surface trim</label>
<label>Flight Surface Trim</label>
</text>
<button>
@ -235,13 +235,97 @@ var assignButton = func(cmd) {
<text>
<row>0</row>
<col>2</col>
<label>Other Aircraft Controls</label>
<label>Powerplant Controls</label>
</text>
<button>
<row>1</row>
<col>2</col>
<halign>fill</halign>
<legend>Throttle Up</legend>
<binding>
<command>nasal</command>
<script>
assignButton("Throttle Up");
</script>
</binding>
</button>
<button>
<row>2</row>
<col>2</col>
<halign>fill</halign>
<legend>Throttle Down</legend>
<binding>
<command>nasal</command>
<script>
assignButton("Throttle Down");
</script>
</binding>
</button>
<button>
<row>3</row>
<col>2</col>
<halign>fill</halign>
<legend>Mixture Rich</legend>
<binding>
<command>nasal</command>
<script>
assignButton("Mixture Rich");
</script>
</binding>
</button>
<button>
<row>4</row>
<col>2</col>
<halign>fill</halign>
<legend>Mixture Lean</legend>
<binding>
<command>nasal</command>
<script>
assignButton("Mixture Lean");
</script>
</binding>
</button>
<button>
<row>5</row>
<col>2</col>
<halign>fill</halign>
<legend>Propeller Fine</legend>
<binding>
<command>nasal</command>
<script>
assignButton("Propeller Fine");
</script>
</binding>
</button>
<button>
<row>6</row>
<col>2</col>
<halign>fill</halign>
<legend>Propeller Coarse</legend>
<binding>
<command>nasal</command>
<script>
assignButton("Propeller Coarse");
</script>
</binding>
</button>
<text>
<row>0</row>
<col>3</col>
<label>Other Aircraft Controls</label>
</text>
<button>
<row>1</row>
<col>3</col>
<halign>fill</halign>
<legend>Brakes</legend>
<binding>
<command>nasal</command>
@ -253,7 +337,7 @@ var assignButton = func(cmd) {
<button>
<row>2</row>
<col>2</col>
<col>3</col>
<halign>fill</halign>
<legend>FGCom PTT</legend>
<binding>
@ -266,7 +350,7 @@ var assignButton = func(cmd) {
<button>
<row>3</row>
<col>2</col>
<col>3</col>
<halign>fill</halign>
<legend>Trigger</legend>
<binding>
@ -279,7 +363,7 @@ var assignButton = func(cmd) {
<button>
<row>4</row>
<col>2</col>
<col>3</col>
<halign>fill</halign>
<legend>Custom</legend>
<binding>
@ -292,7 +376,7 @@ var assignButton = func(cmd) {
<button>
<row>5</row>
<col>2</col>
<col>3</col>
<halign>fill</halign>
<legend>None</legend>
<binding>
@ -305,13 +389,13 @@ var assignButton = func(cmd) {
<text>
<row>0</row>
<col>3</col>
<col>4</col>
<label>View</label>
</text>
<button>
<row>1</row>
<col>3</col>
<col>4</col>
<halign>fill</halign>
<legend>View Decrease</legend>
<binding>
@ -324,7 +408,7 @@ var assignButton = func(cmd) {
<button>
<row>2</row>
<col>3</col>
<col>4</col>
<halign>fill</halign>
<legend>View Increase</legend>
<binding>
@ -337,7 +421,7 @@ var assignButton = func(cmd) {
<button>
<row>3</row>
<col>3</col>
<col>4</col>
<halign>fill</halign>
<legend>View Cycle Forwards</legend>
<binding>
@ -350,7 +434,7 @@ var assignButton = func(cmd) {
<button>
<row>4</row>
<col>3</col>
<col>4</col>
<halign>fill</halign>
<legend>View Cycle Backwards</legend>
<binding>
@ -363,7 +447,7 @@ var assignButton = func(cmd) {
<button>
<row>5</row>
<col>3</col>
<col>4</col>
<halign>fill</halign>
<legend>View Left</legend>
<binding>
@ -376,7 +460,7 @@ var assignButton = func(cmd) {
<button>
<row>6</row>
<col>3</col>
<col>4</col>
<halign>fill</halign>
<legend>View Right</legend>
<binding>
@ -389,7 +473,7 @@ var assignButton = func(cmd) {
<button>
<row>7</row>
<col>3</col>
<col>4</col>
<halign>fill</halign>
<legend>View Up</legend>
<binding>
@ -402,7 +486,7 @@ var assignButton = func(cmd) {
<button>
<row>8</row>
<col>3</col>
<col>4</col>
<halign>fill</halign>
<legend>View Down</legend>
<binding>