The problem is simple:
When I run my script, I know exactly which keyboard I will use for my Macro.
But it is impossible to find out how to automatically assign it to the "handler" .
The objective of this script is to be launched at the same time as Windows (registre key, command line "LuaMacros -r srcipt.lua")
Thank you for helping me.
Incidentally, the documentation seems incomplete to me: the overload "lmc_send_keys('Hello world', 100)" is not mentioned (what is the number for?). Another one without a doc : "lmc_send_input(51, 0, 0)".
Assign a keyboard in the start of the script
Re: Assign a keyboard in the start of the script
Assigning keyboard (fixed) name is decribed in how-to section of this forum - see viewtopic.php?f=12&t=248
These days I'm improving wiki pages at github and device names is one of the topics that will show up soon.
Yesterday I added page about keyboard triggers - see https://github.com/me2d13/luamacros/wiki/Triggers
These days I'm improving wiki pages at github and device names is one of the topics that will show up soon.
Yesterday I added page about keyboard triggers - see https://github.com/me2d13/luamacros/wiki/Triggers
Petr Medek
LUAmacros author
LUAmacros author
Re: Assign a keyboard in the start of the script
Ok thank.
However, I notice that the ID is lost in the middle of a large alphanumeric mush, it would be convenient to extract it and display it separately (ID: <ID>)
Another good thing would be a function that lists the devices in a table.
Feature request :
lmc_get_devices() would give a table in the format { { "Name", verbosUUID, ID }, { "Name", verbosUUID, ID }, ... } . This will allow us to perform analysis processing and display the information we are interested in.
(In my project, there is a second script to test and get the ID of the device that will be used as MacroPad)
However, I notice that the ID is lost in the middle of a large alphanumeric mush, it would be convenient to extract it and display it separately (ID: <ID>)
Another good thing would be a function that lists the devices in a table.
Feature request :
lmc_get_devices() would give a table in the format { { "Name", verbosUUID, ID }, { "Name", verbosUUID, ID }, ... } . This will allow us to perform analysis processing and display the information we are interested in.
Code: Select all
local devices = {};
devices = lmc_get_devices();
for i, d = pairs(devices) do
print("Name: " .. d[1]);
print("VerbosUUID: " .. d[2]);
print("ID: " .. d[3]);
end;
Re: Assign a keyboard in the start of the script
That alphanumeric mush is exactly what is returned by Windows, you can take any part of the string that uniquely identifies the keyboard and pass it to lmc_device_set_name.
The feature you requested is already there and you guessed the function name right
, see https://github.com/me2d13/luamacros/issues/19
The feature you requested is already there and you guessed the function name right

Petr Medek
LUAmacros author
LUAmacros author