Sending events by program

Started by clovis99, October 02, 2016, 21:21:24

Previous topic - Next topic

clovis99

Hello,
I want to send mouse and keyboard events programmatically in a mod  for Minecraft. I have try to use java.AWT.Robot but result seems to be unpredictable (I am on Mac OS 10.10.5 and I have heard Robot has problem on it). How can I achieve that?
Excuse me if my question is stupid but I am newbie in LWJGL and Minecraft modding.
Thanks.

abcdef

Have you asked this on the minecraft forums? Minecraft uses LWJGL but how they use it is with them and not the LWJGL team. If there is a bug they will come here but you should ask them directly first. If your question is really LWJGL based then post some example LWJGL code showing where you are having issues. Sounds like your question is not LWJGL based though as you are talking about java.awt.Robot

clovis99

Thanks for your answer.
I have try to ask Minecraft forge forum with not much success.
May I reformulate my question:
Is it possible, using LWJGL, to simulate physical mouse click and keyboard key down? Or perhaps to place such event in the event queue?

abcdef

I don't believe its possible with LWJGL, LWJGL 3 uses GLFW for all its mouse  / keyboard / controller handling so you can look at GLFW to see if it supports it. I don't know if minecraft uses LWJGL3 though, if it uses LWJGL 2 then the mouse / keyboard handling uses custom code which is basically platform specific and again, from my knowledge, it doesn't have any capabilities to input events manually. There is probably a reason why minecraft mods require you to use java.awt.Robots because its the only generic way of actually doing it but as you say even that has its own problems.

Looks like you are stuck unfortunately. :(