Skip to content

How to disable right mouse button selection in the MultiSelect? #9015

Closed

Description

@KRC2000

Version/Branch of Dear ImGui:

Version 1.XX, Branch: XXX (master/docking/etc.)

Back-ends:

imgui_impl_XXX.cpp + imgui_impl_XXX.cpp

Compiler, OS:

Linux

Full config/build information:

No response

Details:

My Issue/Question:

As I understand, by default, right mouse button clicks generate ImGuiSelectionRequests. How do I prevent this? I only want to select with LMB.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

Activity

  1. PathogenDavid commented on Oct 20, 2025

    @PathogenDavid
    Contributor

    Always selecting on right-click isn't directly configurable (you can use ImGuiMultiSelectFlags_NoAutoSelect but that has other side-effects you probably don't want.)

    My understanding from Omar's comment here is that it's done intentionally so that items get selected when you open their context menu (which is consistent with how other user interfaces behave.)

    It'd be helpful to know why you want to disable the functionality.

  2. KRC2000 commented on Oct 20, 2025

    @KRC2000
    Author

    @PathogenDavid thank you for the answer.

    I wanted to reset selection with right click, just like Escape key does. I am making a level editor for the game, there is a list of entities, you select them to perform some actions and then you want to deselect them. Pretty much only way to deselect is pressing Ecs. But I thought it would be nice to deselect with RMB, some editors/games do this and I always liked it.

    Your explanation makes sense, I understand now why RMB selects by default. This is not critical issue for me, so I will either try to find workaround to have this, or just accept and move on.

  3. ocornut commented on Oct 20, 2025

    @ocornut
    Owner

    I see no harm adding a flag to disable this, and I would comment on the general-purpose default behavior too.

  4. ocornut commented on Oct 20, 2025

    @ocornut
    Owner

    Added ImGuiMultiSelectFlags_NoSelectOnRightClick in 63bfad4. Let me know if that works for you.

  5. KRC2000 commented on Oct 21, 2025

    @KRC2000
    Author

    Wow, thank you, nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址