mojira.dev

Andrew VanEe

Assigned

No issues.

Reported

No issues.

Comments

@Mike Shultz

I'm not generally one to be concerned with the pattern of using curl | bash but this one is problematic for a number of reasons:

  1. Do I trust the url? (this one is an unknown link shortener without an initial https connection, so definitely no)

  2. Do I trust the author? (random comment on the internet, sorry no)

  3. Is it likely that it has been audited by 3rd parties that know what it's doing? (it's on a minecraft forum, probably not)

  4. Is it doing anything that might be considered suspicious? (in this case, nothing obvious, but a random minecraft launcher and java executable unzipped from the internet could do some pretty nasty stuff)

I don't have any suggestions on how to fix these issues, I just want to flag it as a concern for those who happily paste commands into their terminal.

I can confirm, this is essentially how LWJGL2 handled mouse events on Mac: If there was no Y-axis scroll, it used the X-axis scroll instead.

https://github.com/LWJGL/lwjgl/blob/1f81b30f66191ca69d13dce490630703a4c4eac3/src/java/org/lwjgl/opengl/MacOSXNativeMouse.java#L219

 

// if no vertical wheel events, then map the horizontal wheel event to it
if (dy == 0) dy = dx;

After some more testing, I think I understand the situation a bit better. Shift+Scroll is not an issue with the Apple trackpad or the Magic Mouse. I don't know if things have changed at some point, but these devices seem to disable the Shift+Scroll gesture since they have native horizontal scrolling (which Minecraft ignores).

The devices that DO have this issue are 3rd party mice (I tested on two different Logitech M-Series) which don't have horizontal scrolling. The reason I (and likely others) don't use the Magic Mouse or trackpad for gaming is the "squishy/unpredictable" scrolling. Just out of curiosity, I tested this in Terarria as well and (after unbinding Shift from Auto-Select) Scroll+Shift doesn't work there either. I guess it's just bad luck that Shift+Scroll is a fairly common gesture in Minecraft but rarely encountered in other games?

You're totally right - I didn't think to check the Magic Mouse behaviour in 1.12 and earlier. I've just tested it with MC1.12.2/LWJGL2.9.0 and it does have the same reverse scroll quirk with a magic mouse.

@@unknown , this is pretty much what my little fabric mod - it checks if there is yoffset and uses that if it is greater than the xoffset:

https://github.com/andyvanee/hscroll/blob/master/src/main/java/net/fabricmc/andyvanee/mixin/MinecraftClientMixin.java#L38-L43

And you're right, my code is overriding the Minecraft call to GLFW.glfwSetScrollCallback.

Unfortunately this creates a reverse scroll on Trackpads and Magic Mouse, which have "actual" horizontal scroll gestures. I have meant to dive into the code to figure out what has changed in the underlying libraries between 1.12 and 1.13, but haven't had the time. https://github.com/andyvanee/hscroll#todo

I've updated my mod which fixes this horizontal scrolling issue - I don't really play enough to justify updating it for each release, but I did want to check out the nether updates 🙂 

Keep an eye on this page for updates:

https://github.com/andyvanee/hscroll/releases

The only requirements are Fabric Loader version 0.8.8+build.202 and the hscroll-1.16.1.001.jar file.

Sorry, i don't know how to make it any simpler than the posted instruction

  • Create a fresh instance in MultiMC with MC 1.14.4

  • Install Fabric using the Install Fabric Button

  • Add the Jar file into the 'Loader Mods' folder

To be clear, I don't consider this to be a good long term solution or something I plan to support, it's only for development testing of the behavior.

Thanks,

For anyone interested, I've built a little Fabric mod to try a solution to this this issue. It's not a great solution since it just swaps out the Minecraft scroll handler for a custom one, but it works for my needs at the moment.

https://github.com/andyvanee/hscroll

Note that this mod supports ANY device with horizontal scroll capability, not just the Mac-specific Shift+Scroll case. It also applies the effect to menus and anything else with scrolling, which I have not found to be a problem at all.

One thing I didn't expect is that Shift+scroll goes the opposite direction than you would expect compared with a horizontal swipe (which I don't use, but I expect there are some trackball and touchpad users out there). This is why I added horizontalScrollSensitivity which could be positive or negative to reverse the direction of horizontal scroll.

I'm happy to accept pull requests from anyone with interest... I just picked up Fabric this evening so there's likely better ways to do this. Once the behavior is worked out, I'm sure it would be easy to merge if there is interest.

@pokechu22 Compiling GLFW and running the events example was no trouble at all, but you're right, it's probably not super useful information.

Here is a scroll up then down without shift.

000001c3 to 1 at 82.323: Scroll: 0.000 -0.100
000001c4 to 1 at 82.927: Scroll: 0.000 0.100

And here is a scroll up then down with shift pressed.

0000028a to 1 at 549.864: Key 0x0154 Scancode 0x0038 (LEFT SHIFT) (with shift) was pressed
0000028b to 1 at 550.479: Scroll: -1.000 0.000
0000028c to 1 at 551.257: Scroll: 1.000 0.000

Which is pretty much exactly as you suggested. While I had it running, I thought I'd double check the control click behaviour, and again it's not new information but I thought I'd confirm that the behaviour is not native but emulated as you said:

000000dd to 1 at 379.080: Mouse button 0 (left) (with no mods) was pressed
000000de to 1 at 379.214: Mouse button 0 (left) (with no mods) was released
000000df to 1 at 380.400: Key 0x0155 Scancode 0x003b (LEFT CONTROL) (with control) was pressed
000000e0 to 1 at 380.759: Mouse button 0 (left) (with control) was pressed
000000e1 to 1 at 380.923: Mouse button 0 (left) (with control) was released

Hey @Pokechu22 , as I mentioned in a previous comment, I'd be happy to do some testing if you need it. I don't have too much experience with Java and LWJGL, but I have a Mac and Minecraft and would love to see this issue sorted out.

https://bugs.mojang.com/browse/MC-121772?focusedCommentId=526354&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-526354

It sounds like you're on the right track though with the implementation differences between LWJGL 2 and 3. Personally, I don't think it's an issue to apply the fix across the board - I have not found any interfaces in Minecraft that utilize horizontal scroll and it's a pretty obscure control even for experienced Mac users.

Thanks!

Hey all, I just wanted to keep this thread alive since I really don't want to see another major release with a significant bug on Mac slip through.

I play a fair bit of Skyblock style maps where you are constantly holding shift - and being unable to hold shift and scroll through your inventory at the same time is very inconvenient.

I have found a workaround by setting up a separate keyboard profile for Minecraft using Karabiner-Elements. I just re-map Left Shift to Number Lock, and then configure Minecraft to use Number Lock as the sneak key. It's not a great solution as it requires some reasonably technical third-party software but it does work.

I am a web developer with limited Java experience, but I'd be happy to provide feedback, QA or anything like that if it's helpful. I know the convention on Mac is that Shift+Scroll is horizontal scroll but since horizontal scroll currently has no effect in Minecraft, I expect adding it to the default behaviour would be fine, though it may need testing/feedback from trackball users as well (not sure how common they are, but I know they exist!).

If there is a good reason to not turn it on by default, perhaps a control configuration something like Horizontal Scroll Inventory would be possible? Thanks for the great game, and the great work 🙂