Page 1 of 1
how to open multiple .lua with luamacro?
Posted: 03 Feb 2018, 10:02
by afafok
I have 3 keyboards, i plan the 2 is for macro, but i dont know how to open multiple .lua file with luamacro?
Re: how to open multiple .lua with luamacro?
Posted: 05 Feb 2018, 10:52
by admin
Why do you need multiple files?
You can open just one, if it is too big, you can include other files.
Re: how to open multiple .lua with luamacro?
Posted: 05 Feb 2018, 15:09
by afafok
admin wrote: ↑05 Feb 2018, 10:52
Why do you need multiple files?
You can open just one, if it is too big, you can include other files.
How to get separate function with 2 macro keyboard in just 1 file? I dont know how to code those
Re: how to open multiple .lua with luamacro?
Posted: 06 Feb 2018, 09:26
by admin
You have multiple handling functions and multiple lmc_set_handler calls.
See e.g.
https://github.com/me2d13/luamacros/blo ... rc/lmc.lua
Re: how to open multiple .lua with luamacro?
Posted: 06 Feb 2018, 10:43
by afafok
please help me man, first please look at my code here:
https://pastebin.com/GLnZeT0y
my problem is:
lua macro can define both keyboard, but why the Photoshop keyboard keep writing the 'key' in keypressed2.txt, which is the task of Premiere keyboard,so both my keyboard is writing in keypressed2.txt, what i really want is... the Photoshop keyboard writing the 'key' in keypressed.txt, and the Premiere keyboard writing the key in keypressed2.txt...
my question:
whats wrong with my code?
Re: how to open multiple .lua with luamacro?
Posted: 07 Feb 2018, 09:47
by admin
You named both functions sendToAHK so 2nd one replace the first one
Re: how to open multiple .lua with luamacro?
Posted: 08 Feb 2018, 10:30
by afafok
admin wrote: ↑07 Feb 2018, 09:47
You named both functions sendToAHK so 2nd one replace the first one
bro, u are so good bro!!!
Thx for helping me out bro!!!
Re: how to open multiple .lua with luamacro?
Posted: 14 Jun 2020, 05:05
by Tiabo
I am just beging with programming Lua MACRO
but it seems that you might be able to declare the function for the each keyboard. In this case i am intercepting obspad, but one might use a third and forth keyboard, and program it in the same .lua
Code: Select all
lmc_device_set_name('keyboard','2670AE8')
[b]
lmc_device_set_name('obspad','FD00948')[/b]
lmc_print_devices()
[b]
lmc_set_handler('obspad', function(button,direction)
[/b]
if (direction == 1) then return end
......
......
-- zoom 4
elseif (button == 51) then
lmc_send_keys('+{F6}', 50)
lmc_send_keys('^{P}', 50)
end
end
)