@@ -79,16 +79,32 @@ public Interaction createPointerDown(int button) {
79
79
return new PointerPress (this , PointerPress .Direction .DOWN , button );
80
80
}
81
81
82
+ /**
83
+ * @deprecated always use the method with the button
84
+ */
85
+ @ Deprecated
82
86
public Interaction createPointerDown (PointerEventProperties eventProperties ) {
83
- return new PointerPress (this , PointerPress .Direction .DOWN , eventProperties );
87
+ return createPointerDown (0 , eventProperties );
88
+ }
89
+
90
+ public Interaction createPointerDown (int button , PointerEventProperties eventProperties ) {
91
+ return new PointerPress (this , PointerPress .Direction .DOWN , button , eventProperties );
84
92
}
85
93
86
94
public Interaction createPointerUp (int button ) {
87
95
return new PointerPress (this , PointerPress .Direction .UP , button );
88
96
}
89
97
98
+ /**
99
+ * @deprecated always use the method with the button
100
+ */
101
+ @ Deprecated
90
102
public Interaction createPointerUp (PointerEventProperties eventProperties ) {
91
- return new PointerPress (this , PointerPress .Direction .UP , eventProperties );
103
+ return createPointerUp (0 , eventProperties );
104
+ }
105
+
106
+ public Interaction createPointerUp (int button , PointerEventProperties eventProperties ) {
107
+ return new PointerPress (this , PointerPress .Direction .UP , button , eventProperties );
92
108
}
93
109
94
110
private static class PointerPress extends Interaction implements Encodable {
@@ -110,9 +126,17 @@ public PointerPress(InputSource source, Direction direction, int button) {
110
126
this .eventProperties = new PointerEventProperties ();
111
127
}
112
128
129
+ /**
130
+ * @deprecated always use the constructor with the button
131
+ */
132
+ @ Deprecated
113
133
public PointerPress (InputSource source , Direction direction , PointerEventProperties eventProperties ) {
134
+ this (source , direction , 0 , eventProperties );
135
+ }
136
+
137
+ public PointerPress (InputSource source , Direction direction , int button , PointerEventProperties eventProperties ) {
114
138
super (source );
115
- this .button = 0 ;
139
+ this .button = button ;
116
140
this .eventProperties = Require .nonNull ("pointer event properties" , eventProperties );
117
141
this .direction = Require .nonNull ("Direction of press" , direction );
118
142
}
@@ -212,6 +236,8 @@ public enum MouseButton {
212
236
LEFT (0 ),
213
237
MIDDLE (1 ),
214
238
RIGHT (2 ),
239
+ BACK (3 ),
240
+ FORWARD (4 ),
215
241
;
216
242
217
243
private final int button ;
0 commit comments