Page 1 of 1
Basic Syntax
Posted: 22 Aug 2019, 01:04
by juxus
Hi Guys,
im sorry for this basic question BUT since i'm not o coder please help me. I need a complete syntax with beginning and end that would turn let's say a button from my second extra NumPad to an F1 button.
something like
if (button == 107) then lmc_send_keys ('(F1)')
end if
yes but this of course does not work.
also i would like to use something like 3+7 on my numpad as Alt-Tab
thank you obiwan you're our last hope
Re: Basic Syntax
Posted: 22 Aug 2019, 07:29
by emielo
----------------------------------------------------
-- assign logical name to macro keyboard
lmc_assign_keyboard('MACROS');
-- define callback for whole device
lmc_set_handler('MACROS',function(button, direction)
if (direction == 1) then return end -- ignore down
----------------------------------------------------
if (button == 107) then -- Numpad 1
lmc_send_keys ("{F1}")
----------------------------------------------------
else print('Not yet assigned: ' .. button)
end
end)
----------------------------------------------------
(source: https://2ndkeyboard.webnode.nl/uitleg-luamacros/)
Re: Basic Syntax
Posted: 22 Aug 2019, 09:32
by emielo
For Alt-Tab you can just use 1 key.
if (button == 107) then -- Numpad 1
lmc_send_keys ("%&")
see also: https://github.com/me2d13/luamacros/wiki/List-of-Keys
Re: Basic Syntax
Posted: 22 Aug 2019, 10:38
by juxus
Thank you very much,I know this is still wrong but i really don't get it. I need a example with all the names i need to replace. Would you mind helping me over Skype? I need to set up my secondary numpad for my 3d aplication.
- Screenshot 2019-08-22 11.34.24.png (36.77 KiB) Viewed 7369 times
skype: Juxus1
Re: Basic Syntax
Posted: 22 Aug 2019, 10:44
by emielo
I'm sorry, I think you need help from someone else (admin ?)
I'm working in a newer version of HID macros: Luamacros.
I thought it was working the sameā¦ but I think I was wrong.
Re: Basic Syntax
Posted: 23 Aug 2019, 07:21
by admin
The screenshot you have provided is from hidmacros with luamacros code (which will not work of course).
Scripting in hidmacros:
http://hidmacros.eu/scripting.php
Scripting in luamacros:
http://hidmacros.eu/forum/viewforum.php?f=12
But without scripting knowledge you can't use luamacros.