Some inventory commands teleport the mouse on Mac OS X
TellowKrinkle opened this issue ยท 7 comments
The move single item (default ctrl + click), move all of type (default ctrl + shift + click), move forward / back (default w/s + click), drop item (default alt/option + click) and possibly a few more shortcuts teleport the mouse vertically across the center of the minecraft window when you use them. This doesn't happen in windows, only mac (I haven't tested on linux).
I don't think there's much anything I can do about it, I've checked a few times and all it's doing is recording the current location and then re-setting it because there's a minor glitch when trying to suppress mouse events.
Since it's setting it to the same coordinates that LWJGL told us it was at, any mismatch is almost certainly in their code.
Confirmed this is still happening (v1.59-dev-152 on Yosimite 10.10.2).
Of note: it seems to mirror exactly across the middle (200px down from the middle moves the cursor to 200px above the midline after alt-clicking). This sounds like it may even be related to the old rendering upside-down issue.
I don't have a mac to test, and I can't even begin to guess why this would happen -- the mod is only telling Minecraft that events happened at different places, it shouldn't have an effect on the OS.
So, unfortunately, I'll have to leave this until someone with a mac either figures out exactly what's going on.
I tested a bit with the source code and found that commenting out "Mouse.setCursorPosition(ex, ey);" in InvTweaksHandlerShortcuts.java fixes the issue (although that line was obviously there to fix some other issue but this is my first time trying to edit a mod and I don't know how else to fix it). Does that help?
By the way, do you know why eclipse would complain that "The field GuiScreen.buttonList is not visible" and crash minecraft even though compiling the mod and adding it to a normal instance works fine?
Ah, I didn't know that was there.
Does changing the earlier Mouse.getEventX(), getEventY() to just getX and getY change anything? It doesn't look like that's being called from event handlers so those might be off from where the mouse actually is.
For eclipse, I have no idea. eclipsec does strange things, but if the project is set up correctly it should be using the same copy of minecraft files as gradle does.
No, it doesn't work.
If it helps, this issue also happens with NEI's subset menu and first appeared in both in Minecraft 1.6.
Hmm, 1.6 did update LWJGL (and uses a different version on OSX because previous attempts did strange things like causing the game to render upside down).
Might need to see if MC itself does anything different with mouse commands on OSX, but it might just be the function to try to fix the mouse position is just broken in LWJGL.