Do I know where the mouse button clicked is the field?

To create the inventory, I created a single slot and created 16 inventory compartments in an array, and I want to know how many spaces each time I click on that column. I want to know if I need to know by position value or if there is a function that can be written within a mouse event.

Hi! Could you add more detail? Maybe you have sketch image.