Send callbacks to Falcon BMS
-
Is there a way to send callbacks to Falcon BMS directly? Basically, an API to send something like AFGearToggle programmatically? I have searched around the forums and found some vaguely similar threads, but no definitive answers and they’re all older threads.
I have found F4Utils.Process in the lightningtools repository. It says “… and send keyboard callbacks to Falcon”. Is that what I am looking for? I am asking because my C# knowledge is non-existent, before I dwell further into it. My second question would be, if there are any Python bindings for that or a Python version of that library (a quick internet search yielded no results)?
-
I’m not aware of any Phyton library. The only 2 tools that are open source and include such code I’m aware of are Lighnings and Helios both are C#.
What would be the trigger you want to execute the callback.
Physical hardware or another piece of software.so basically both work by using the key file. by reading the keyfile finding the assigned keystrokes of a given callback and sending those keystrokes to the BMS Process.
If the input is physical hardware that allows to be seen as Directinput there is not even a API needed at all as this can be handeled directly within BMSGesendet von meinem SM-G930F mit Tapatalk
-
It would be sent by another piece of software.
basically both work by using the key file
Oh, that’s disheartening. I was hoping there would be something that works without modifying or depending on people’s keyfiles. Something along the shared memory but with writes (I’m not sure if button/switch states are something that’s exposed in that).
Thanks for the info.
-
It would be sent by another piece of software.
…I was hoping there would be something that works without modifying or depending on people’s keyfiles. …You and me both… and JanJan (well, not anymore, now that he put in the hours to read/parse keys from user keyfile)… C’est la Vie
Best wishes and good luck in your project!
-
You and me both… and JanJan (well, not anymore, now that he put in the hours to read/parse keys from user keyfile)… C’est la Vie
Best wishes and good luck in your project!
Technically it’s not reading keystrokes but keycodes from the key file. That one of the pros I see in parsing the key file as you are independent of keyboard layout language
Gesendet von meinem SM-G930F mit Tapatalk
-
+1 for this but I fully realize it’s probably not going to happen … would basically entail making FalconBMS.exe into a local COM or RPC service.
I have no idea what Win32 interop looks like in python (is it even a thing?) but the Win32 API you want is called SendInput(). Hmm… I found this which may or may not be helpful:
https://nitratine.net/blog/post/simulate-keypresses-in-python/If you want to see what calling SendInput() to generate keypresses looks like in C#, here’s an interop wrapper I wrote…
https://github.com/arithex/DragWheel/blob/main/src/Win32_SendInput.cs -
Is there a way to send callbacks to Falcon BMS directly? Basically, an API to send something like AFGearToggle programmatically? I have searched around the forums and found some vaguely similar threads, but no definitive answers and they’re all older threads.
I have found F4Utils.Process in the lightningtools repository. It says “… and send keyboard callbacks to Falcon”. Is that what I am looking for? I am asking because my C# knowledge is non-existent, before I dwell further into it. My second question would be, if there are any Python bindings for that or a Python version of that library (a quick internet search yielded no results)?
The only way I really see something like this happening is if you use some kind of pseudo-software joystick devices where you can have DX inputs which can then be mapped to the callbacks. Shared memory is read-only it doesn’t take any input.
Sent from my iPhone using Tapatalk
-
It looks like there was a tiny toehold of precedent for making sharedmem two-way read/write… eg. lines 270-275 in flightData.h … I have no idea if the code that did/does read that is dead or alive. probably was an early attempt at integrating head-tracking or done for some automated testing purposes or something.
A shared-memory section for all analog-axis inputs could help a lot of scenarios that need vJoy/Gremlin today. And maybe help devs with automated testing.
But for callbacks it would be pretty awkward. Just opening a NamedPipe and reading null-terminated strings would probably be the way to go.
-
The only way I really see something like this happening is if you use some kind of pseudo-software joystick devices where you can have DX inputs which can then be mapped to the callbacks. Shared memory is read-only it doesn’t take any input.
Sent from my iPhone using Tapatalk
Called vJoy
-
Shared mem isn’t read only it just don’t make sense as any value you write to it will immediately get overwritten again.
The purpose of writing shared mem is shown in Lighnings shared mem mirror where you read it on one machine and write it back on another that doesn’t run BMS in order to have it available for other 3rd party toolsGesendet von meinem SM-G930F mit Tapatalk
-
Technically it’s not reading keystrokes but keycodes from the key file. That one of the pros I see in parsing the key file as you are independent of keyboard layout language
Yeah, I know. I remember when he was first tinkering with it - he’s built an absolute gem of an application! Inspired me to do the same for any macro profile I create in the future (which isn’t just QWERTY/QWERTZ/AZERTY like AVCS4 BMS). Already working on an Arma 3 keyfile parser, and when I dive back into my Elite Dangerous project, I might ditch bindED for my own parser just for the experience (and to not ‘require’ a plugin).
The important part is having a means to re-read the file if it changes, either by manual command or automagically. Tons of macro programs already exist from the VoiceAttack program that JanJan and I use to AutoHotKey, etc. etc. The big hurdle is often sharing work with users and different control setups, for sure.
-
I’d have a look into vJoy.