@@ -79,16 +79,32 @@ public Interaction createPointerDown(int button) {
7979 return new PointerPress (this , PointerPress .Direction .DOWN , button );
8080 }
8181
82+ /**
83+ * @deprecated always use the method with the button
84+ */
85+ @ Deprecated
8286 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 );
8492 }
8593
8694 public Interaction createPointerUp (int button ) {
8795 return new PointerPress (this , PointerPress .Direction .UP , button );
8896 }
8997
98+ /**
99+ * @deprecated always use the method with the button
100+ */
101+ @ Deprecated
90102 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 );
92108 }
93109
94110 private static class PointerPress extends Interaction implements Encodable {
@@ -110,9 +126,17 @@ public PointerPress(InputSource source, Direction direction, int button) {
110126 this .eventProperties = new PointerEventProperties ();
111127 }
112128
129+ /**
130+ * @deprecated always use the constructor with the button
131+ */
132+ @ Deprecated
113133 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 ) {
114138 super (source );
115- this .button = 0 ;
139+ this .button = button ;
116140 this .eventProperties = Require .nonNull ("pointer event properties" , eventProperties );
117141 this .direction = Require .nonNull ("Direction of press" , direction );
118142 }
@@ -212,6 +236,8 @@ public enum MouseButton {
212236 LEFT (0 ),
213237 MIDDLE (1 ),
214238 RIGHT (2 ),
239+ BACK (3 ),
240+ FORWARD (4 ),
215241 ;
216242
217243 private final int button ;
0 commit comments