How to detect when a mouse button is pressed, but not released?

Place to get help with not working mods / modding interface.
DaradBur
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Mar 28, 2025 12:23 pm
Contact:

How to detect when a mouse button is pressed, but not released?

Post by DaradBur »

Hello,

As stated in the title, I wonder how/if it is possible to detect a key press, in this case a mouse button pressed?
Right now, on_gui_click fires after the mouse button is released.

I'm currently adding a custom inventory in my GUI, and I wanted to implement the Shift+LMB+drag feature.
I tried using on_gui_hover but it didn't help.

In the base game, pressing LMB on an item stack will put it in the cursor stack, without having to release LMB.
Is this an engine-only feature? Or have I missed something in the docs?
Post Reply

Return to “Modding help”