GetBuffer Question

Announcements, general discussion
Post Reply
pepper
Posts: 8
Joined: 19 Oct 2011, 05:46

GetBuffer Question

Post by pepper » 19 Oct 2011, 06:09

Hello community,

I've been using HID Macros since a short while for the task assignment within FSX. Great program by the way :)

Currently I have some bigger problems with the Get.Buffer command.
It's no problem to send the Num-Key (0-9) into the buffer and to use it afterwards for the adjustment of the heading bug...

My problem now is to set the negative vertical speed of the AP!

HIDMacros.FSXtext "Set VS negativ"
HIDMacros.FSXEvent "AP_VS_VAR_SET_ENGLISH", -HIDMacros.GetBuffer
HIDMacros.ClearBuffer
Result: Positive value :?


Dim negativ
negativ = HIDMacros.GetBuffer * -1
HIDMacros.FSXtext "Set VS negativ"
HIDMacros.FSXEvent "AP_VS_VAR_SET_ENGLISH", negativ
HIDMacros.ClearBuffer
Result: Positive value :?

Even if i send "-200" to the buffer, the Result is still positive -> AP VS: 200.

Is there another way to send the positive numbers from the buffer as a negative number to sim connect?

Another question reagrding the use of special keys of the keyboard: I want to use the WIN-Key, NUM, Scroll-Lock-Key etc also for FSX SimConnect Events.
Is there a way to block the NUM-Key, WIN-KEY function to use them as regulary keys?

Thanks for your support!!

Regards Pepper

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: GetBuffer Question

Post by admin » 19 Oct 2011, 07:36

I'm not sure if GetBuffer is the problem. Try to send some negative value directly, not using GetBuffer.
Or try to display -GetBuffer value using FSXtext or Debug.
The issue may be in SimConnect event - if it is able to manage negative values.
Petr Medek
LUAmacros author

pepper
Posts: 8
Joined: 19 Oct 2011, 05:46

Re: GetBuffer Question

Post by pepper » 19 Oct 2011, 07:46

This is an idea from your example XML http://www.hidmacros.eu/fsx.xml <- Search for "-HID" within the xml
I'll try to enter the value directly....

pepper
Posts: 8
Joined: 19 Oct 2011, 05:46

Re: GetBuffer Question

Post by pepper » 19 Oct 2011, 11:26

Okay here are my results:

Code: Select all

     <Macro>
      <Device></Device>
      <Name>vs2</Name>
      <Direction>down</Direction>
      <Action>SCR</Action>
      <Sequence></Sequence>
      <SCEvent></SCEvent>
      <XPLCommand></XPLCommand>
      <ScriptSource>HIDMacros.FSXtext -HIDMacros.GetBuffer</ScriptSource>
      <SCText>0</SCText>
      <SCParams></SCParams>
      <Command></Command>
    </Macro>
Displays -1000 (I've send "1000" to the buffer)


Code: Select all

<Device>fsx</Device>
      <Name>vs</Name>
      <KeyCode></KeyCode>
      <Direction>down</Direction>
      <Action>SIMC</Action>
      <Sequence></Sequence>
      <SCEvent>AP_VS_VAR_SET_ENGLISH</SCEvent>
      <XPLCommand></XPLCommand>
      <ScriptSource></ScriptSource>
      <SCText>0</SCText>
      <SCParams>-1000</SCParams>
      <Command></Command>
    </Macro>
Sets AP VS to negative (-1000)


Best example:

Code: Select all

Dim vsnegative
vsnegative = -HIDMacros.GetBuffer
HIDMacros.FSXEvent "AP_VS_VAR_SET_ENGLISH", vsnegative 
HIDMacros.FSXtext vsnegative
HIDMacros.ClearBuffer
FSX shows the value negative (-1000) BUT the panel sets the value +1000


So why does the following code doesnt work:

Code: Select all

<Macro>
      <Device>fsx</Device>
      <Name>SetVsNegative</Name>
      <KeyCode>32</KeyCode>
      <Direction>down</Direction>
      <Action>SCR</Action>
      <Sequence></Sequence>
      <SCEvent></SCEvent>
      <XPLCommand></XPLCommand>
      <ScriptSource>
HIDMacros.FSXtext "Set VS negativ"
HIDMacros.FSXEvent "AP_VS_VAR_SET_ENGLISH", -HIDMacros.GetBuffer
HIDMacros.ClearBuffer
</ScriptSource>
      <SCText>0</SCText>
      <SCParams></SCParams>
      <Command></Command>
    </Macro>

BTW: I do have this issue with all planes....

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: GetBuffer Question

Post by admin » 20 Oct 2011, 08:14

Hmm, looks like HIDMacros.FSXEvent have some problems with negative numbers.
Because your second example uses predefined macro action (SC event) and not script, which is internally slightly different code.
Anyway I need to check this in application code and hopefully will come with some findings.
Petr Medek
LUAmacros author

pepper
Posts: 8
Joined: 19 Oct 2011, 05:46

Re: GetBuffer Question

Post by pepper » 20 Oct 2011, 15:36

That would be great! Hey another idea as workaround:
Is it possible to use the SCEvent and send the value from the buffer as paramter? What a plan :) EDIT <--- DOESNT WORK

Code: Select all

<Macro>
      <Device>fsx</Device>
      <Name>AP VS Set Negative</Name>
      <KeyCode>36</KeyCode>
      <Direction>down</Direction>
      <Action>SIMC</Action>
      <Sequence></Sequence>
      <SCEvent>AP_VS_VAR_SET_ENGLISH</SCEvent>
      <XPLCommand></XPLCommand>
      <ScriptSource></ScriptSource>
      <SCText>0</SCText>
      <SCParams>-HIDMacros.GetBuffer</SCParams>
      <Command></Command>
    </Macro>
Does it make sense to install SP1 + Sp2 for SDk?

My installation is: FSX Standard + Acceleration Pack
BTW: May be this would be helpfulhttp://www.fsdeveloper.com/forum/archiv ... -6109.html

pepper
Posts: 8
Joined: 19 Oct 2011, 05:46

Re: GetBuffer Question

Post by pepper » 28 Oct 2011, 16:32

Any news about this?
Best regards

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: GetBuffer Question

Post by admin » 30 Oct 2011, 14:00

There was a bug in the code, try now.
I just repacked current version at http://www.hidmacros.eu/HidMacros.zip
Petr Medek
LUAmacros author

pepper
Posts: 8
Joined: 19 Oct 2011, 05:46

Re: GetBuffer Question

Post by pepper » 03 Nov 2011, 07:04

You are awesome :o

Now, it works really great without any issues...


THANK YOU for your advanced support :!: :!: :!:

Post Reply