Jump to content

[SOLVED] How to simulate right mouse button being held down?


Recommended Posts

Posted

I feel like you're asking a different question for something else's logic (maybe use item keybind), but it would be relatively difficult. You would need to use some sort of JVM witchery (reflection, AT, etc.) to manually set a value in MouseHelper.

  • Thanks 1
Posted
41 minutes ago, ChampionAsh5357 said:

I feel like you're asking a different question for something else's logic (maybe use item keybind), but it would be relatively difficult. You would need to use some sort of JVM witchery (reflection, AT, etc.) to manually set a value in MouseHelper.

Hi thanks for your fast answer!

I figured it out:

KeyBinding keyCode = Minecraft.getInstance().gameSettings.keyBindUseItem.getKeyBinding();
KeyBinding.setKeyBindState(keyCode.getKey(), true);
KeyBinding.onTick(keyCode.getKey());

 

Just have to figure out how to stop it from holding it down.

  • 1 year later...
Posted

Hi,

Is your RMB still down? XD
If this is implemented in a mod I'd be interested to know. (but this was one of the first hits I found, so maybe I will find a mod in a while)

A workaround for me that works in Vanilla: Press the right mouse button, disconnect (mouse) USB, release right mouse button, reconnect USB.
Minecraft will keep thinking the RMB is down until you click it again.

Regards, Geert

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.