Page 1 of 1

MouseDoubleClick is not working in Noesis

Posted: 16 Jun 2025, 20:09
by WSTM
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.

Re: MouseDoubleClick is not working in Noesis

Posted: 17 Jun 2025, 20:55
by sfernandez
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?

Re: MouseDoubleClick is not working in Noesis

Posted: 18 Jun 2025, 22:12
by WSTM
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.

Re: MouseDoubleClick is not working in Noesis

Posted: 19 Jun 2025, 11:45
by jsantos
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?