luamacros - accented characters

Documentation. First post is always kind of manual page, being continuously updated by author. Following posts are discussion about the topic.
Post Reply
KeyCaps
Posts: 2
Joined: 04 Oct 2018, 14:11

luamacros - accented characters

Post by KeyCaps » 04 Oct 2018, 15:49

Hi !
I''ve configured my numpad to run some shortcuts and it works very well (in luamacros and in hidmacros) but now I would like to create a shortcut (in luamacros) for the [CTRL+ SHIFT + ù] combination but i can not figure out how to do it.
I get this error

Code: Select all

[KEY] ERROR: Invalid KeyName
in the console and i don't know which is the corresponding value to this key (ù):

Code: Select all

elseif (button == 97) then
        lmc_send_keys ('^+u')   
I have an italian keyboard...
Thanks for any help :)

luiwingkin
Posts: 14
Joined: 06 Feb 2018, 05:23

Re: luamacros - accented characters

Post by luiwingkin » 05 Oct 2018, 03:11


KeyCaps
Posts: 2
Joined: 04 Oct 2018, 14:11

Re: luamacros - accented characters

Post by KeyCaps » 05 Oct 2018, 07:59

Thanks my friend for your answer.
Unfortunately it doesn't work :(
This is my code:

Code: Select all

elseif (button == 40) then
   lmc_send_keys ('^+%({NUM1}{NUM5}{NUM1})', 50)
I want to use this shortcut [CTRL+SHIFT+ù] in visual studio code to comment a line.

---------------------------------------------------------------------------------------
I have another issue with luamacros (instead everything is fine with hidmacros :shock: ): if i configure a shortcut with my 'chinese' numpad, for example pressing NUM9 (pgup) i get as result that in the Visual Studio code the cursor goes to the top of the page and, at that point, it runs the code in Luamacros. How can i avoid this behavior? I think this is due to the fact that pressing NUM9 i get two numbers, one on key pressed and one on key released...

Code: Select all

clear()
lmc_device_set_name('visualStudioCode','9BEA9')
lmc_print_devices()
lmc_set_handler('visualStudioCode', function(button,direction)
    if (direction == 0) then return end

    -- formatta codice --
    if (button == 36)
    then lmc_send_keys('+%f', 50)
    -- duplica linea --
    elseif (button == 38)
    then lmc_send_keys('^+d', 50)
    -- cancella linea --
    elseif (button == 33)
    then lmc_send_keys('^+k', 50)
Thanks again for your help!

P.S.
There is a little documentation for all the methods (like lmc_send_keys()) ? I want to know what arguments each method takes, for example.

luiwingkin
Posts: 14
Joined: 06 Feb 2018, 05:23

Re: luamacros - accented characters

Post by luiwingkin » 08 Oct 2018, 04:37

Sorry about that I have not with an Italian keyboard so I cannot test.
Maybe you check the keycode directly and send it. The following post has the program in testing your pressed key's code.

viewtopic.php?f=3&t=601

lmc_send_keys("^+"..string.char(65), 50)

The above code sends the "B" actually.

For the Chinese issue, I also experience the same problem, but it seems solved by using the extension of PotentiumRLX.

https://www.youtube.com/channel/UCsWZQr ... ApBITFQ4aQ

Hope they help.

Post Reply