bevyengine / bevyengine/bevy

Picking: Filter keys in `PickingInteraction`

Open
#15,983 0 comments 0 reactions 0 assignees View on GitHub
A-Picking C-Feature D-Straightforward S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

For managing appearance of UI it is easier to work with state, i.e. `PickingInteraction` than events, i.e. `On::` from `bevy_picking`. The limitation of `PickingInteraction` currently is there is no way to distinguish the button of `Pressed`, thus limiting the usage of this pattern.

## What solution would you like?

I don't think there is a clearcut solution, one or multiple of these can be considered:

1). Add a resource to globally disable keys like RMB from triggering `PickingInteraction`.
2). Add a component that filters which key triggers `PickingInteraction`.
3). Change `PickingInteraction::Pressed` into a `PickingInteraction::Pressed(Set)`.

`3` seems like the best solution but notably complicates the state machine workflow.

## What alternative(s) have you considered?

Keep things as is.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.