Giter Site home page Giter Site logo

hscroll's Introduction

HScroll Fabric Mod

This is some test code to see if I can work around a long-standing bug related to horizontal scrolling, particularly on Mac which translates Shift+Scroll into a horizontal scroll, which has no effect in Minecraft, but happens whenever you sneak and scroll your inventory slots.

The entire functionality is in MinecraftClientMixin.java which basically swaps out the default scroll handler for a custom one which translates horizontal scrolling into vertical scrolling.

I intend this as a purely temporary fix and proof of concept. One thing that I did not expect is that scrolling on a touchpad or magic mouse actually scrolls the opposite way than you might expect. This is likely due to "Natural Scrolling" on Mac and it's debatable whether the horizontal scroll direction should be the reverse of what it currently is. With a Magic Mouse the Shift+Scroll works exactly as expected, but a left swipe causes your inventory to scroll right. Currently it works perfectly for my needs using a Logitech Mouse.

Install

Using MultiMC - all that's required is to:

  • Download the jar file for your Minecraft version (eg: MC 1.16.4 -> hscroll-1.16.4.00X.jar) from the Releases Page
  • Edit Instance
  • Install Fabric (tested with fabric loader 0.10.6)
  • Add the downloaded jar file to 'Loader Mods'

For developers

In order to build the jar file, run the following commands:

# Set up build environment
gradle wrapper

# If you want the decompiled sources to browse
./gradlew genSources

# Build the jar file
./gradlew build

The build output will be in the build/libs directory.

See gradle.properties for building a specific version.

TODO

  • The mod works as intended for vertical scrolling, with and without Shift, using all mice tested. It does not, however, behave as well for the Magic Mouse or Trackpad which have a horizontal scroll gesture. For these devices, a left swipe will result in the inventory scrolling right. I assume track balls would behave the same, but I don't have one to test. This situation is unavoidable as far as I can tell, since it's not feasible to distinguish between a Left/Right scroll via trackpad from an Up/Down+Shift scroll.

License

MIT

hscroll's People

Contributors

lau1406 avatar andyvanee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.