GetBuffer Question
GetBuffer Question
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
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
Re: GetBuffer Question
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.
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
LUAmacros author
Re: GetBuffer Question
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....
I'll try to enter the value directly....
Re: GetBuffer Question
Okay here are my results:
Displays -1000 (I've send "1000" to the buffer)
Sets AP VS to negative (-1000)
Best example:
FSX shows the value negative (-1000) BUT the panel sets the value +1000
So why does the following code doesnt work:
BTW: I do have this issue with all planes....
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>
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>
Best example:
Code: Select all
Dim vsnegative
vsnegative = -HIDMacros.GetBuffer
HIDMacros.FSXEvent "AP_VS_VAR_SET_ENGLISH", vsnegative
HIDMacros.FSXtext vsnegative
HIDMacros.ClearBuffer
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....
Re: GetBuffer Question
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.
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
LUAmacros author
Re: GetBuffer Question
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
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
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>
My installation is: FSX Standard + Acceleration Pack
BTW: May be this would be helpfulhttp://www.fsdeveloper.com/forum/archiv ... -6109.html
Re: GetBuffer Question
Any news about this?
Best regards
Best regards
Re: GetBuffer Question
There was a bug in the code, try now.
I just repacked current version at http://www.hidmacros.eu/HidMacros.zip
I just repacked current version at http://www.hidmacros.eu/HidMacros.zip
Petr Medek
LUAmacros author
LUAmacros author
Re: GetBuffer Question
You are awesome
Now, it works really great without any issues...
THANK YOU for your advanced support
Now, it works really great without any issues...
THANK YOU for your advanced support