1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Added Extra1 & Extra2 pointer buttons (#1603)

Extra1 is usually extra back button on most mice & Extra2 is usually extra forward button.
This commit is contained in:
sy1ntexx
2022-05-11 23:44:00 +03:00
committed by GitHub
parent 9624de6c41
commit d850b47f9e
5 changed files with 17 additions and 1 deletions

View File

@@ -254,10 +254,14 @@ pub enum PointerButton {
Secondary = 1,
/// The tertiary mouse button is usually the middle mouse button (e.g. clicking the scroll wheel).
Middle = 2,
/// The first extra mouse button on some mice. In web typically corresponds to the Browser back button.
Extra1 = 3,
/// The second extra mouse button on some mice. In web typically corresponds to the Browser forward button.
Extra2 = 4,
}
/// Number of pointer buttons supported by egui, i.e. the number of possible states of [`PointerButton`].
pub const NUM_POINTER_BUTTONS: usize = 3;
pub const NUM_POINTER_BUTTONS: usize = 5;
/// State of the modifier keys. These must be fed to egui.
///

View File

@@ -557,16 +557,22 @@ impl Response {
self.clicked[0] || other.clicked[0],
self.clicked[1] || other.clicked[1],
self.clicked[2] || other.clicked[2],
self.clicked[3] || other.clicked[3],
self.clicked[4] || other.clicked[4],
],
double_clicked: [
self.double_clicked[0] || other.double_clicked[0],
self.double_clicked[1] || other.double_clicked[1],
self.double_clicked[2] || other.double_clicked[2],
self.double_clicked[3] || other.double_clicked[3],
self.double_clicked[4] || other.double_clicked[4],
],
triple_clicked: [
self.triple_clicked[0] || other.triple_clicked[0],
self.triple_clicked[1] || other.triple_clicked[1],
self.triple_clicked[2] || other.triple_clicked[2],
self.triple_clicked[3] || other.triple_clicked[3],
self.triple_clicked[4] || other.triple_clicked[4],
],
dragged: self.dragged || other.dragged,
drag_released: self.drag_released || other.drag_released,