Skip to content

Click on mouse-button-press (button-down) #8180

@emilk

Description

@emilk

egui currently register clicks when the mouse button is released (button-up). Having the clicks register on press instead would make egui feel a lot more responsive.

EDIT: let's make this globally configurable in Style

Clicks vs drags

If the area under the pointer responds to both click AND drags, we cannot immediately know if a mouse press is going to turn into a click or a drag. This means we cannot do click-on-press in these situations. Only when the surface under the pointer responds ONLY to clicks can be do this.

To ensure most surfaces are either click XOR drag we should fix two things:

  • Disable drag-to-scroll on non-touch-screens
  • Disable drag-to-move for egui::Window on non-touch-screens

Drag-to-abort

With click-on-press you cannot abort a click midway. This is arguably a slight disadvantage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    eguistylevisuals and theming

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions