Basic Syntax

How can be this controlled in that simulator? Can HIDmacros be used with this application?
Post Reply
juxus
Posts: 2
Joined: 22 Aug 2019, 00:53

Basic Syntax

Post by juxus » 22 Aug 2019, 01:04

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

emielo
Posts: 8
Joined: 03 Sep 2018, 12:41

Re: Basic Syntax

Post by emielo » 22 Aug 2019, 07:29

----------------------------------------------------
-- 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/)

emielo
Posts: 8
Joined: 03 Sep 2018, 12:41

Re: Basic Syntax

Post by emielo » 22 Aug 2019, 09:32

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

juxus
Posts: 2
Joined: 22 Aug 2019, 00:53

Re: Basic Syntax

Post by juxus » 22 Aug 2019, 10:38

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
Screenshot 2019-08-22 11.34.24.png (36.77 KiB) Viewed 7367 times


skype: Juxus1

emielo
Posts: 8
Joined: 03 Sep 2018, 12:41

Re: Basic Syntax

Post by emielo » 22 Aug 2019, 10:44

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.

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Basic Syntax

Post by admin » 23 Aug 2019, 07:21

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.
Petr Medek
LUAmacros author

Post Reply