Mouse Tweaks

Mouse Tweaks

284M Downloads

[Suggestion] New tweak: Drag item to another slot

AlisonHuang777 opened this issue ยท 8 comments

commented

Suppose I want to move an item from slot A to slot B.
Currently, I can do the following:

  1. Click the item located in slot A
  2. Move the cursor to where the slot B is
  3. Click again to drop the item

And the new tweak works like this:

  1. Click the item at slot A and then hold the button
  2. Move the cursor to slot B
  3. Release button to drop the item

So basically I can drag the item to another slot with this new tweak.
This can be useful when I want to move many items to some specific slots.

commented

I see what you mean. Do any existing mods do this to use as a reference for the button to use? I think it makes sense if this was some modifier (i.e. if you hold Alt then dragging works like this), but not sure.

commented

I think we actually don't need to press any additional keys to activate the dragging behavior. It'll work like this:
Firstly, you press down RMB (or LMB) on an item to pick it up, and then, when you release the button:

  • If the cursor is still on the slot where you originally picked up the item, this is identified as a "click" action, and you simply make the item attach to the cursor;
  • If, instead, the cursor has moved to a new slot, then this is identified as a "drag" action, putting down the item (which is previously attached to the cursor until the button is released) to that slot.
commented

That is a good idea, however I think there's a conflict with one of the existing LMB drag mechanics where it will add more items into the stack on the mouse when dragging with LMB held.

commented

Maybe we can make this feature to be part of the RMB tweaks instead?
And make the existing tweak for RMB to be activated only if it's a "click" action, e.g. you need to make the item to attach to the cursor first, and then you can do the distribution.

commented

Well, you still want the vanilla "right click to take half" to keep working though.

commented

How about using middle mouse button? Currently there is no behavior for middle clicking a item in survival mode.
And using this tweak won't be a issue in creative mode, as you can use the "click" action to activate the vanilla behavior (which is duping item). Maybe an additional config option can be introduced to decide whether to dupe the item when the dragging behavior is activated. (So if it's activated, you just leave the original item in its slot while dragging a copy of it to a new slot.)
Furthermore, if there are other mod that take use of MMB, (e.g. AE2 autocrafting,) just bind it to "click" action as well.

commented

Possible. If it was a modifier like Alt, then you could use it with both LMB and RMB though (if you need to take a half-stack and drop it somewhere).

commented

Then it can be made like using the modifier key, which is default to be MMB. And while using that, you don't need to additionally press LMB to drag the entire stack, but still need to click RMB to take half of the stack.