WSTM
Topic Author
Posts: 4
Joined: 10 Jan 2025, 01:12

MouseDoubleClick is not working in Noesis

16 Jun 2025, 20:09

Hello there, could I get some help on troubleshooting why MouseDoubleClick is not working, here are some context:

I created an inventory grid with slots in it, the slot (item) has a few interactions:

Hover, Click - Different visual states, and they are handled via Visual State Manger
Drag to move the item - it's a custom function we created to allow players to drag item to a different spot in the inventory. But this function listens to MouseLeftButtonDown / MouseLeftButtonUp

We need to create a different way to equip an item from the inventory grid, we thought double clicking is the most natural way to do that.
<b:EventTrigger EventName="MouseDoubleClick">
                    <b:InvokeCommandAction
                        Command="{Binding DataContext.EquipItem, ElementName=InventoryRoot}"
                        CommandParameter="{Binding}">
                    </b:InvokeCommandAction>
                </b:EventTrigger>
This is where it stops working, If the event is MouseDoubleClick, it wont do anything, but if I do MouseEnter, the command will work, so I know the command and the binding are correct, it's just the double click is not being listened.
 
User avatar
sfernandez
Site Admin
Posts: 3272
Joined: 22 Dec 2011, 19:20

Re: MouseDoubleClick is not working in Noesis

17 Jun 2025, 20:55

Hello, the DoubleClick event is defined by the Control class, so you'll have to set the EventTrigger in a Control-like element, for example:
<ContentControl>
  <b:Interaction.Triggers>
    <b:EventTrigger EventName="MouseDoubleClick">
      <b:InvokeCommandAction .../>
    </b:EventTrigger>
  </b:Interaction.Triggers>
  <Grid>...</Grid>
</ContentControl>
Could you try that?
 
WSTM
Topic Author
Posts: 4
Joined: 10 Jan 2025, 01:12

Re: MouseDoubleClick is not working in Noesis

18 Jun 2025, 22:12

Thanks for looking into this. I added a ContentControl to the listboxitem template, and wrapped everything within it. Unfortunately, MouseDoubleClick is still not firing, but MouseEnter works with this setup as well.
 
User avatar
jsantos
Site Admin
Posts: 4407
Joined: 20 Jan 2012, 17:18
Contact:

Re: MouseDoubleClick is not working in Noesis

19 Jun 2025, 11:45

Is your integration properly injecting Double Click events to the View?
    /// Notifies that a mouse button was double clicked. Origin is in the upper-left corner.
    /// When a double click happens the following sequence of events are expected:
    ///  - MouseButtonDown (first click)
    ///  - MouseButtonUp
    ///  - MouseDoubleClick (second click)
    ///  - MouseButtonUp
    /// See https://docs.microsoft.com/en-us/windows/win32/learnwin32/mouse-clicks#double-clicks
    /// Returns true if event was handled
    virtual bool MouseDoubleClick(int x, int y, MouseButton button) = 0;
Could you please verify this with the person in charge of the integration?

Who is online

Users browsing this forum: Ahrefs [Bot], nightlight309, Semrush [Bot] and 5 guests