Skip to content

Items: right click functions are not run if left click is held down (but it works if it's the opposite) #13581

@Zughy

Description

@Zughy
Minetest version
5.7.0, 5.8.0, 5.8.0-dev
Summary

Actions on on_secondary_use and on_place are not run if you're holding down the left mouse button. However, you can run on_use even if you're holding down the right button.

I expect actions to run no matter what keys I'm currently holding down. In my use case, I have a weapon that it's supposed to fire a charged attack when LMB is released and that uses the gunsight with RMB. However, if I'm charging the shot, I can't zoom in/out, which is frustrating.

Steps to reproduce
minetest.register_node("test:node", {
    description = "Test node",
    tiles = {"server_favorite.png"},
    inventory_image = "server_favorite.png",
    groups = {cracky = 3},
    
    on_use = function(itemstack, user, pointed_thing)
    	minetest.chat_send_all("On use")
    end,
    
    on_secondary_use = function(itemstack, user, pointed_thing)
    	minetest.chat_send_all("On secondary use")
    end,
    
    on_place = function(itemstack, user, pointed_thing)
    	minetest.chat_send_all("On place")
    end
})

click around


Possibly related: #13553

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions