I have three number pads remapped using LuaMacros. I set the logical names as below:
The first two re-names are constant, they are always present as USB devices on a Flight Sim PC.-- assign logical name to macro keyboard
clear()
lmc_say('Assigning Keyboards');
lmc_device_set_name('Comms_systems', '3166D5A9')
lmc_device_set_name('weapons_systems', '3263C97E')
lmc_device_set_name('Aircraft_systems', '26286BE')
lmc_print_devices()
However, the third device is one of as set of keyboards that I swap in and out according to the aircraft model in use, having buttons tailored to a specific aircraft.
I don't want to load a different script for each aircraft and I want the keyboard assignment to be done without manual intervention.
My question is: Are the keyboard identifiers always unique to each keyboard, or are they likely to be different if a keyboard is swapped out?
So if I was to to do this:
Where only one of the last three assigned keyboards was present at any one run of the macro,clear()
lmc_say('Assigning Keyboards');
lmc_device_set_name('Comms_systems', '3166D5A9')
lmc_device_set_name('weapons_systems', '3263C97E')
lmc_device_set_name('Harrier_Aircraft_systems', 'AAAAAAAA')
lmc_device_set_name('Phantom_Aircraft_systems', 'BBBBBBBBB')
lmc_device_set_name('General_Aircraft_systems', 'CCCCCCCC')
lmc_print_devices()
And then logically:
So I could make the assignment above in my macro secure in the knowledge that if any two of the last three keyboards was not present, the one that was would have the correct assignment and therefore the macro would only execute the code for the present keypad.
For Harrier_Aircraft_systems do:
XXX
For Phantom_Aircraft_systems do:
XXX
For General_Aircraft_systems do:
XXX