HIDmacros > export to LUAmacros

Announcements, questions
Post Reply
divarak
Posts: 12
Joined: 10 Oct 2015, 19:26

HIDmacros > export to LUAmacros

Post by divarak » 10 Oct 2015, 19:43

Hello, im new in the forum and I must say i´m a complete noob in terms of programming/scripting.
I just love HIDmacros, could make a complete set of tools using a second keyboard and a keypad for work faster in a lot of photo retouching/ video editing tools I use... But I am having the problem that HIDmacros disable some keys of regular use (I can´t type a plain simple "@" (AltGr+3) on my spanish keyboard).. I read the notice that HIDmacros will not be supported anymore... So I decide to look at LUAmacros....
Is there a way to export/convert my xml file of HIDmacros in LUAmacros? HIDmacros has a GUI for build the macros... LUAmacros doesn´t.. And as I said, programming isn´t for me :(.

If export the xml isn´t an option.... Someone can point another alternative solution?

Please help!
Thanks in advance.
divarak

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

Re: HIDmacros > export to LUAmacros

Post by admin » 12 Oct 2015, 07:54

No and won't be implemented (at least by myself :-)).
Sorry for bad news but LuaMacros use different scripting language and different way how to handle devices. Also some funcionality is missing.
Technically it would be possible to convert just simple kayboard macros, but there are more important things at my TODO list.
Petr Medek
LUAmacros author

divarak
Posts: 12
Joined: 10 Oct 2015, 19:26

Re: HIDmacros > export to LUAmacros

Post by divarak » 14 Oct 2015, 01:14

Hello again..
I understand you perfectly. I forgot to say... Thanks a lot for all the effort you are putting on this piece of software!!! It is really helping me a lot!
Now I must tell you... Programming isn´t my thing... But I manage to build a script to "recover" all the macros I build before!!! 8-)
Now I want to ask you about 2 things... (If I must make new posts please tell me and will do.)

1- The original problem I had in HIDmacros was that my spanish keyboard doesn´t type some characters when it´s running... I thought it was solved when I build my first script (I could type "@" with AltGr+3), but now I´m facing that I can´t type vowels with accents (usually for "á", i must press "´" and then "a").. I must close LuaMacros when I´m typing... ---- I want to ask if this issue is already on the TODO List.
2- It is possible to filter macros on different windows? Let´s say I want to assign F1 on my second keyboard to do "Ctrl+T" if I am working on notepad++, but I want that the same key F1 work different if I am working on Word... Is this possible?

I also want to share my script... I´d like to ask for opinions... Maybe there is something I wrote wrong...

http://pastebin.com/TKvDQdUn

Again, thanks for your time and effort.

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

Re: HIDmacros > export to LUAmacros

Post by admin » 14 Oct 2015, 08:18

ad 1) no, I will check
ad 2) not now. However it should be quite easy to add a function to return title of active window. Then you could adapt your macro script accordingly. Will also check :-)
Petr Medek
LUAmacros author

divarak
Posts: 12
Joined: 10 Oct 2015, 19:26

Re: HIDmacros > export to LUAmacros

Post by divarak » 02 Dec 2015, 00:02

Hello, it´s me again!! :mrgreen:
First of all, thank you for the new version!!!! The problem about spanish characters is solved!!! Now I can type vowels with accents, tildes, etc...
On the last post of this thread, you mention something about "add a function to return title of active window"....
This function is already implemmented on the latest version?
Is there some place on the documentation, or an example where I can find it / test it?

Again, thanks for all of your effort on Luamacros!! It helped me a lot on my tendonitis.

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

Re: HIDmacros > export to LUAmacros

Post by admin » 02 Dec 2015, 22:29

It was not implemented but I just added such function.
Download the latest version 0.1.0.233 and then you can do something like

Code: Select all

print(lmc_get_window_title())
The function returns active window title. If you put it to some callback function it won't be LuaMacros all the time :-)
Petr Medek
LUAmacros author

divarak
Posts: 12
Joined: 10 Oct 2015, 19:26

Re: HIDmacros > export to LUAmacros

Post by divarak » 11 Dec 2015, 05:29

Well, hello again Petr...
Still trying to get it work...

I´m trying the line you pointed.... But gets me this error:

[LUA] ERROR: Runtime error [string "LuaMacros script"]:11: attempt to call global 'lmc_get_window_title' (a nil value)

What am I doing wrong?

.... By the way... Is there some king of manual I can use to learn lua? I´ve seen something on the web.. but It looks very different to your code and for specific hardware.

Thanks in advance.


here´s part of the script:

//////////////////////////
clear()

lmc.minimizeToTray = true
lmc_minimize()
lmc_device_set_name('LOGITECH', '9CE4B0D')
lmc_device_set_name('THERMALTAKE', '166F0933')
lmc_device_set_name('MOUSE', '27874F15')
lmc_device_set_name('KEYPAD', 'A3AA7F7')
lmc_print_devices()

print(lmc_get_window_title())

-- Definir LOGITECH
lmc_set_handler('logitech',function(button, direction)
if (direction == 1) then return end -- ignore down
if (button == 112) then lmc_send_keys ("^(t)") --ps_TRANSFORM
elseif (button == 121) then lmc_send_keys ("^(r)") --ps_TOGGLE_RULER

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

Re: HIDmacros > export to LUAmacros

Post by admin » 11 Dec 2015, 15:18

Did you download the latest version? Chceck the version in bottom bar to be sure...
Petr Medek
LUAmacros author

divarak
Posts: 12
Joined: 10 Oct 2015, 19:26

Re: HIDmacros > export to LUAmacros

Post by divarak » 13 Dec 2015, 11:28

Yes, I´m sure! The exe says 0.1.0.233
But now something is strange... I downloaded again Luamacros, and overwrite all files where I am running it... Maybe a file wasn´t replaced... now it´s working :oops: ...
I only need now to learn how to assign keboard shortcuts on a key depending on the active window. :mrgreen:

Thank you for your time again Petr! :)

Post Reply