Page 1 of 1

Pick block by middle clicking (on_middleclick)

PostPosted: Fri Jan 16, 2015 13:29
by Kenney
Use the middle mouse button (scrollwheel) on a block to pick it. If creative (this should be modded) it should always pick the block and place it in inventory and wield it, to quickly select a block that has been placed in the world.

In survival it would seek in your inventory if you have that block, and select/wield it.

Re: Pick block by middle clicking

PostPosted: Fri Jan 16, 2015 15:39
by TriBlade9
Kenney wrote:Use the middle mouse button (scrollwheel) on a block to pick it. If creative (this should be modded) it should always pick the block and place it in inventory and wield it, to quickly select a block that has been placed in the world.

In surival it would seek in your inventory if you have that block, and select/wield it.

+1.
Perhaps make a GitHub issue? I don't suspect it would be too complicated. (If we could send keypresses through Lua it could be done with a mod)

Re: Pick block by middle clicking

PostPosted: Fri Jan 16, 2015 16:18
by Evergreen
I think the best way to go about doing this is by adding a lua function which would look something like on_middleclick(), since different subgames have different ways of handling creative mode.

Re: Pick block by middle clicking

PostPosted: Fri Jan 16, 2015 16:30
by Kenney
Good point idea, on_middleclick() would be better.

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Fri Jan 16, 2015 19:16
by addi
not shure if this would be a good idea. I playing sometimes on my Laptop, and the touchpad does not have midleclick.
if this gets added, I hope its configurable, to get the old controls back.

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Fri Jan 16, 2015 19:26
by Kenney
addi wrote:if this gets added, I hope its configurable, to get the old controls back.

There are no old controls for this, so you won't be missing out if you don't have a middle mouse button available.

Re: Pick block by middle clicking

PostPosted: Fri Jan 16, 2015 21:47
by afflatus
Evergreen wrote:I think the best way to go about doing this is by adding a lua function which would look something like on_middleclick(), since different subgames have different ways of handling creative mode.


+ 1 with the proviso that there must be a key combo alternative, for players that can't use middleclick.

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Fri Jan 16, 2015 23:41
by ExeterDad
addi wrote:not shure if this would be a good idea. I playing sometimes on my Laptop, and the touchpad does not have midleclick.
if this gets added, I hope its configurable, to get the old controls back.

None of my laptops have middle mouse buttons. But they all emulate middle click when clicking left and right at the same time. Not sure if drivers are OS specific as our laptops (and desktops) are Linux and I pretty much haven't touched Windows since XP came out.

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Sat Jan 17, 2015 01:57
by afflatus
A lot of Windows users don't realise that the scroll wheel is also a mouse button even if they have one.

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Wed Jan 21, 2015 14:40
by Kalabasa
Or instead of middle click, use a key (like P for pick). Similar to color picking in OpenSpades/AoS

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Wed Jan 21, 2015 23:02
by TriBlade9
Kalabasa wrote:Or instead of middle click, use a key (like P for pick). Similar to color picking in OpenSpades/AoS

Oh, that's how it works in OpenSpades. Thanks for the info, I was wondering.

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Wed Jan 28, 2015 01:07
by SneakySNGamer
This should be added, I don't know why it wasn't added in the original Minetest.

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Wed Jan 28, 2015 18:36
by Krock
I'm not sure what it should do.
Should the middle click "dig" a node or just highlight it?

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Wed Jan 28, 2015 23:50
by Evergreen
Krock wrote:I'm not sure what it should do.
Should the middle click "dig" a node or just highlight it?

The point of middle click is to pick a node when in creative. For instance, if you middle click a dirt block you get a dirt block.

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Sun May 31, 2015 19:34
by Sokomine
Plese don't forget about facedir. Picking the block type is just one part of it. Many blocks need to be aligned in one way or another. Using the screwdriver for each one drives you crazy. Therefore, I've written my replacer mod some time ago. It does not only pick "color", but also orientation. Instead of middle clicking, it's SHIFT+RIGHTCLICK. After that, it's as if you'd wield the block (only that you can't see the stored blocktype) - except that it gets placed with the stored facedir. And you don't have to dig the old block first - it replaces it immediately.
Don't get me wrong on that - using the middle mouse button to select a node is a nice idea. But if you've got people on your server who love to build something more complex than an ugly cobble box, you really ought to have the replacer mod installed. Maybe I ought to try to get it added to minetest_game.

Re: Pick block by middle clicking (on_middleclick)

PostPosted: Sun May 31, 2015 20:44
by prestidigitator
Krock wrote:I'm not sure what it should do.
Should the middle click "dig" a node or just highlight it?

It's an eyedropper tool.

I like it. In non-creative, it would have to somehow move stuff from elsewhere in inventory to the hotbar, or change to a hotbar slot that has the item. I suggest simply finding the item in inventory and swapping that slot with whatever is in the currently active hotbar slot.