How to detect pure click on mesh?

I’m trying to detect pure click on any mesh. I can move the model freely using the SHIFT+Dragging mouse. But there is an onClick event. So when I’m dragging the model pressing the SHIFT key it is fine but when I release the mouse click but the SHIFT key is still down then mouse click is occurring. But I want to prevent that click when the SHIFT key is pressed. The onClick should work only when I click not with any other Keys. How can I do that? I’m using react three fiber.

you mean like addEventListener mouseup or raycasting

kind of. In react three fiber there is a method named onClick(), I’m using that method to detect click on any mesh. But the problem is when I’m trying to move the model freely using SHIFT+Mouse Drag and then if I release the drag over the model and still the SHIFT key is pressed onClick method is being called. But I want to ignore the click when any key is pressed on the keyboard.

then ignore it on a mouse up event

also that didn’t worked for me

The issue is solved. I checked if the shift key if pressed like this:

//do something