New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lmc_print_devices should give the text it prints (and some other stuff) . #19

Closed
DaBotz opened this Issue Nov 22, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@DaBotz

DaBotz commented Nov 22, 2017

I have started working on a "java Client" to exploit LuaMacros ability to intercept keys ans use it to implement a general "programmable keyboards" controller, with various types of macros and with a comprehensive capability of generating application-dependent macro, manually selected use cases, title-dependent use cases and keeping track of various past versions of it.

I know, it is going to be a hell of work... I posted some of the code I did till now here

https://github.com/DaBotz/JavaMacros

Doing so, I come into a set of very small, but frustrating limitations of LuaMacros, problems in building and modding it on my computer (at first, I had issues with the Hilighter package, then with adding the INet package ) and I realized that it is time for me to update the "automatic GUI creator" class(es) that I use for everything.

(They are not nice, but they generate automatically controls from any object, and one has just to tweak their behaviour by implementing some limited business logic, which beats drawing controls around in WindowBuilder for me).

Business as usual

Anyway, I have found some issues with LuaMacros that I feel have a general relevance also to he rest of the world:

  1. It would be nice that lmc_print_devices didn't just print the devices, but also gave back the text it prints. - _More ideally yet, if there was a lmc_list_devices that gave back an array (ehr, numbered map, if I understand well how Lua works) with the devices detected, people might do stuff with it. Us of now, I have stolen some code from https://github.com/mrsimb/macrorecorder and found my way around it, however functional it still makes for a bit of a mess at start-up, which leads to...

  2. It would be good to have a "clear" function for the print window callable from Lua (to hide the aforementioned mess)

  3. It would be a good thing to have a lmc_remove_handler function, to "detach" a device that is not in use for macros any more - alternatively, a "resetAllHandlers" would be good (I know... if I managed to have it built in my Lazarus, it would take some minutes to add it).

  4. It would be wonderful if LuaMacros had a "hard reset" function, that allowed it to "completely restart", reset its table of system handles and re-load and re-launch the current script.

As of now, my Java "monstrosity" can detect when a new keyboard is plugged to the system, but I am forced to kill & re-launch LM (I hope those days had died with HidMacros) because it does not "see" it.

At first, I had tried to simply have the Lua script doing a "system re-scan", but then I realized that LM shares this old HidMacros limitation... it stores the device handles at start, and does not see "new ones", even when one knows that they must be there.

My thanks (and if I manage to get what I am doing wrong with Lazarus, I hope that I will be able to help) for both HidMacros and LuaMacros.

They really helped me (also, it amaze the people that see me drawing what one can do with them and a couple of 10$ numeric pads... ).

@me2d13

This comment has been minimized.

Show comment
Hide comment
@me2d13

me2d13 Nov 26, 2017

Owner

ad 2: it's already there, just use clear()
ad 1: have it developped, in next release is comming:

dev = lmc_get_devices()
for key,value in pairs(dev) do
  print(key..':')
  for key2,value2 in pairs(value) do print('  '..key2..' = '..value2) end
end

and you get e.g.

0:
  Name = BU0836A Interface C6D765D0:99A8:11E7:8001444553540000
  SystemId = BU0836A Interface C6D765D0:99A8:11E7:8001444553540000
  Type = game
  Handle = 0
1:
  Name = <unassigned>
  SystemId = \\?\HID#VID_046D&PID_C52B&MI_00#7&DC46083&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD}
  Type = keyboard
  Handle = 65632

For the rest... stay tuned, the internal reset is already there when you relaunch the script so I can just link it to command.

Owner

me2d13 commented Nov 26, 2017

ad 2: it's already there, just use clear()
ad 1: have it developped, in next release is comming:

dev = lmc_get_devices()
for key,value in pairs(dev) do
  print(key..':')
  for key2,value2 in pairs(value) do print('  '..key2..' = '..value2) end
end

and you get e.g.

0:
  Name = BU0836A Interface C6D765D0:99A8:11E7:8001444553540000
  SystemId = BU0836A Interface C6D765D0:99A8:11E7:8001444553540000
  Type = game
  Handle = 0
1:
  Name = <unassigned>
  SystemId = \\?\HID#VID_046D&PID_C52B&MI_00#7&DC46083&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD}
  Type = keyboard
  Handle = 65632

For the rest... stay tuned, the internal reset is already there when you relaunch the script so I can just link it to command.

@DaBotz

This comment has been minimized.

Show comment
Hide comment
@DaBotz

DaBotz Dec 3, 2017

Thanks. While I wait for lmc_get_devices() to arrive, I will go on with the rest of the work.

(I am happy already with the Luamacros http server, that I iniztially overlooked... I can get my Java thing to update its LUamacros counterpart directly when a user activates or deactivates [kind-of, waiting for the hard reset my thing just answer to LM "send the keys" instead of "I take charge"] ).

Once the hard reset is there, I may also have M to reset when a new device is attached ( at which point, a window will pop-up to ask if it is a new things, or a migration of an old one to a new port... )

Thanks for your work

DaBotz commented Dec 3, 2017

Thanks. While I wait for lmc_get_devices() to arrive, I will go on with the rest of the work.

(I am happy already with the Luamacros http server, that I iniztially overlooked... I can get my Java thing to update its LUamacros counterpart directly when a user activates or deactivates [kind-of, waiting for the hard reset my thing just answer to LM "send the keys" instead of "I take charge"] ).

Once the hard reset is there, I may also have M to reset when a new device is attached ( at which point, a window will pop-up to ask if it is a new things, or a migration of an old one to a new port... )

Thanks for your work

@me2d13

This comment has been minimized.

Show comment
Hide comment
@me2d13

me2d13 Dec 11, 2017

Owner

Released, see forum post

Owner

me2d13 commented Dec 11, 2017

Released, see forum post

@me2d13 me2d13 closed this Dec 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment