Page 1 of 2

Knobster button command in knobXP plugin

Posted: Tue Mar 30, 2021 5:48 am
by Bulva
I would like to assign the VS / ALT mode change function to the button knobster:
1.jpg
The responsible command is:

sim / cockpit2 / autopilot / alt_vvi_is_showing_vvi

How do I make one press of the Knobster button activate VS and pressing the button again activate ALT ???

Will this modes file work correctly ???

"name": "AP_ALT_VS",
"minor_cw_cmd": "sim / autopilot / altitude_up",
"minor_ccw_cmd": "sim / autopilot / altitude_down",
"minor_acceleration": 10,
"major_cw_cmd": "sim / autopilot / vertical_speed_up",
"major_ccw_cmd": "sim / autopilot / vertical_speed_down",
"major_acceleration": 10,
"button_released_cmd": "sim / cockpit2 / autopilot / alt_vvi_is_showing_vvi",
"order": 703000

Re: Knobster button command in knobXP plugin

Posted: Tue Mar 30, 2021 7:32 am
by Keith Baxter
Hi,

I would create a button as a counter something like this.

Code: Select all

--Create a button as a counter
vs_alt_mode=0
function callback_pressed()
   vs_alt_mode=vs_alt_mode+1
   if vs_alt_mode >1 then vs_alt_mode =0 end
  print("Mode code is  "..vs_alt_mode)
end
button_id = button_add("a.png", "b.png", 100,100,200,200,callback_pressed)
Then in your dial use <vs_alt_mode> as a filter.

Keith

Re: Knobster button command in knobXP plugin

Posted: Tue Mar 30, 2021 2:49 pm
by Bulva
Thank You very, very, very much. :D
I hope to be able to deal with it as soon as the purchased knobster arrives.

PS. Maybe in the next update, you will include this mod. It is found in many aircraft. ;)

Re: Knobster button command in knobXP plugin

Posted: Tue Mar 30, 2021 2:52 pm
by Ralph
Your script is for Air Manager Keith, there's no scripting in KnobXP. There's no second press option in KnobXP. You'll have to use two separate modes.

Re: Knobster button command in knobXP plugin

Posted: Tue Mar 30, 2021 2:53 pm
by Corjan
Hi,

To be clear, the script Keith posted cannot be used with the Knobster.
Instead you have to connect your own button/rotary encoder to an Arduino.

Corjan

Re: Knobster button command in knobXP plugin

Posted: Tue Mar 30, 2021 2:58 pm
by Keith Baxter
Corjan wrote: Tue Mar 30, 2021 2:53 pm Hi,

To be clear, the script Keith posted cannot be used with the Knobster.
Instead you have to connect your own button/rotary encoder to an Arduino.

Corjan
Ok my Bad I did not take in the "knobXP" bit

Now I need some education as some peeps are wanting me to do a entegra overlay bezel for use with Knobster.

A button is not available in Knobster?

And why is AM code inconsistent across features? Should they not be the same?

Keith

Re: Knobster button command in knobXP plugin

Posted: Tue Mar 30, 2021 4:28 pm
by Bulva
Ralph wrote: Tue Mar 30, 2021 2:52 pm Your script is for Air Manager Keith, there's no scripting in KnobXP. There's no second press option in KnobXP. You'll have to use two separate modes.
Well, my joy lasted very shortly ;)

Re: Knobster button command in knobXP plugin

Posted: Tue Mar 30, 2021 4:32 pm
by Keith Baxter
Bulva wrote: Tue Mar 30, 2021 4:28 pm
Ralph wrote: Tue Mar 30, 2021 2:52 pm Your script is for Air Manager Keith, there's no scripting in KnobXP. There's no second press option in KnobXP. You'll have to use two separate modes.
Well, my joy lasted very shortly ;)
Hi,

I am Sorry to mislead. Not my intention. I Speed read and did not take into account the kbobXP.

Keith

Re: Knobster button command in knobXP plugin

Posted: Tue Mar 30, 2021 4:55 pm
by Bulva
No problem ;-). Willingness is what counts and I thank you very much for that ;-)
Then I have another stupid question.
If I could create a simple lua script with my own command that would switch ALT to VS and vice versa, with a single key, is it possible to assign this command to a Knobster button in knobXP ???

Re: Knobster button command in knobXP plugin

Posted: Tue Mar 30, 2021 5:33 pm
by Keith Baxter
Bulva wrote: Tue Mar 30, 2021 4:55 pm No problem ;-). Willingness is what counts and I thank you very much for that ;-)
Then I have another stupid question.
If I could create a simple lua script with my own command that would switch ALT to VS and vice versa, with a single key, is it possible to assign this command to a Knobster button in knobXP ???
Hi,

That one is for @Corjan or @Ralph

It is possible via Air Manager not using knobXP plugin.

That is the code I posted.

Keith