xpl_command "ONCE" & "PRESS"?

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: xpl_command "ONCE" & "PRESS"?

#11 Post by Keith Baxter »

Corjan wrote: Sat Jul 24, 2021 7:34 pm Hi,


Will have to look closely how it is implemented exactly, has been a while.

Will get back to you next week,

Corjan
Corjan,

I know that you are busy so probably one overlooked? Please find some time for this.
Appreciated.


Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: xpl_command "ONCE" & "PRESS"?

#12 Post by Corjan »

Hi,


Maybe I'm overlooking something, but it seems you can only do these command types in X-plane:
XPLMCommandBegin
XPLMCommandOnce
XPLMCommandEnd

https://developer.x-plane.com/sdk/XPLMUtilities/


Not sure what they do when you send a 'PRESS', it is not something native to X-plane it seems,

Corjan

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: xpl_command "ONCE" & "PRESS"?

#13 Post by Keith Baxter »

Corjan wrote: Fri Aug 06, 2021 8:43 am Hi,


Maybe I'm overlooking something, but it seems you can only do these command types in X-plane:
XPLMCommandBegin
XPLMCommandOnce
XPLMCommandEnd

https://developer.x-plane.com/sdk/XPLMUtilities/


Not sure what they do when you send a 'PRESS', it is not something native to X-plane it seems,

Corjan
Corjan.

Thank you for taking a look. Not sure if something has changed. If one clicks on <Details> in DRT A window pops up and one has two options. <Command press> & and <Command once>

If we have the the options "BEGIN", "ONCE" and "END" like we have is the SI commands that would be perfect.

If the command is then used in a button, while the button is pressed then the command is fired. When the button is released then stop is fired.

ice_screenshot_20210806-105328.png
Keith


EDIT: Check point 8.3 in the link you shared.

Looks Like press is depreciated ,

"XPLMCommandButtonPress
XPLM_API void XPLMCommandButtonPress(
XPLMCommandButtonID inButton);
This function simulates any of the actions that might be taken by pressing a joystick button. However, this lets you call the command directly rather than have to know which button is mapped where. Important: you must release each button you press. The APIs are separate so that you can ‘hold down’ a button for a fixed amount of time.

Deprecated: use XPLMCommandBegin."
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: xpl_command "ONCE" & "PRESS"?

#14 Post by Keith Baxter »

Corjan,


Are my eyes playing tricks again. :mrgreen: :mrgreen:


I see that the API now has a value 1 to begin and 0 to end. I take it no value is a once.

This page was last edited on 31 October 2019, at 14:26. :oops: :oops: :oops:


Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: xpl_command "ONCE" & "PRESS"?

#15 Post by Corjan »

Hi,


Yeah, it is deprecated, so Begin does the same thing.

Not sure what the datareftool does when you do a 'press', since 'press' is not a X-plane thing. My guess would be that is a ONCE command instead.


Corjan

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: xpl_command "ONCE" & "PRESS"?

#16 Post by Keith Baxter »

@Corjan

It might be better for consistency and to stop confusion to have both SI_command() and xpl_command() the same.

This is Xplane.
2 value Number Optional field. Providing it with 1 will send a BEGIN command, Providing it with 0 will send an END command.

This is SI Command
2 type String (Optional) Can be "BEGIN", "ONCE" or "END".


Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: xpl_command "ONCE" & "PRESS"?

#17 Post by Corjan »

True, this is a bit of legacy.

Have changed the code so 'xpl_command' also accepts "BEGIN", "ONCE" and "END".


Corjan

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: xpl_command "ONCE" & "PRESS"?

#18 Post by Keith Baxter »

Corjan wrote: Fri Aug 06, 2021 10:00 am True, this is a bit of legacy.

Have changed the code so 'xpl_command' also accepts "BEGIN", "ONCE" and "END".


Corjan
Corjan.

Thank you for taking time out to look into this. Make things a lot clearer.


Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: xpl_command "ONCE" & "PRESS"?

#19 Post by Corjan »

Yeah, but doesn't solve the original issue I guess :)

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: xpl_command "ONCE" & "PRESS"?

#20 Post by Keith Baxter »

Corjan wrote: Fri Aug 06, 2021 10:06 am Yeah, but doesn't solve the original issue I guess :)
Corjan,

For me it is perfect and exactly what I was missing.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply