• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Is there any way to track clicking on an item in the inventory without abilities?

It is quite tricky, even with the new reforged natives. There are ways to do it, but they each have their own downsides:
  1. The most intuitive idea is to try to use the reforged frame events to detect when you click the inventory buttons. However, I couldn't get those to work for those frames specifically (could be because only certain types of frames support certain types of events). So another idea I had was to use the frame natives to create frame(s) above each inventory slot and detect when they are clicked, similar to this async MouseXY system. However, the frame has to be above the others in order to receive the frame events correctly--and once you do that, the item tooltips will no longer work. So this strategy isn't going to be too great here. 🤔
  2. Reforged also added mouse natives, EVENT_PLAYER_MOUSE_DOWN and BlzGetTriggerPlayerMouseX()/BlzGetTriggerPlayerMouseY(). However, those return coordinates in world space. If you want to get that value in screen space, you'll have to use something like this: Fast World2Screen Transform (Synced/Async) But I haven't personally tested it for areas over the UI. The issue is--you still have to figure out manually which item is being clicked on based on the screen-space coordinates and which unit is currently being focused (which is its own tricky problem).
  3. A simpler method is to register the EVENT_PLAYER_MOUSE_DOWN event and then read the text shown in the tooltip frame. You could then try to read the item name to try to figure out which item is being hovered on, if any. Essentially, you'd be scraping your own UI. 😅 But this would require you to have your item names stored somewhere statically that you can check against.
All these methods ultimately depend on asynchronous state (e.g. frame/mouse state), so you'll need to be careful with it to avoid desyncs (i.e. you'll want to use BlzSendSyncData if you need to do something meaningful with the event for all players).

So ultimately, I'd still recommend using item abilities if possible, unless you want to invest quite a lot into detecting that click.
 
Top