@@ -105,7 +105,9 @@ void setState(MouseState newState, boolean synthesized) {
105
105
MonocleView oldView = (MonocleView ) oldWindow .getView ();
106
106
if (oldView != null ) {
107
107
// send exit event
108
- int modifiers = state .getModifiers (); // TODO: include key modifiers
108
+ KeyState keyState = new KeyState ();
109
+ KeyInput .getInstance ().getState (keyState );
110
+ int modifiers = state .getModifiers () | keyState .getModifiers ();
109
111
int button = state .getButton ();
110
112
boolean isPopupTrigger = false ; // TODO
111
113
int oldX = state .getX ();
@@ -145,7 +147,9 @@ void setState(MouseState newState, boolean synthesized) {
145
147
int relY = y - window .getY ();
146
148
// send enter event
147
149
if (oldWindow != window && view != null ) {
148
- int modifiers = state .getModifiers (); // TODO: include key modifiers
150
+ KeyState keyState = new KeyState ();
151
+ KeyInput .getInstance ().getState (keyState );
152
+ int modifiers = state .getModifiers () | keyState .getModifiers ();
149
153
int button = state .getButton ();
150
154
boolean isPopupTrigger = false ; // TODO
151
155
postMouseEvent (view , MouseEvent .ENTER , button ,
@@ -156,7 +160,9 @@ void setState(MouseState newState, boolean synthesized) {
156
160
if (oldWindow != window | newAbsoluteLocation ) {
157
161
boolean isDrag = !state .getButtonsPressed ().isEmpty ();
158
162
int eventType = isDrag ? MouseEvent .DRAG : MouseEvent .MOVE ;
159
- int modifiers = state .getModifiers (); // TODO: include key modifiers
163
+ KeyState keyState = new KeyState ();
164
+ KeyInput .getInstance ().getState (keyState );
165
+ int modifiers = state .getModifiers () | keyState .getModifiers ();
160
166
int button = state .getButton ();
161
167
boolean isPopupTrigger = false ; // TODO
162
168
postMouseEvent (view , eventType , button ,
@@ -172,11 +178,14 @@ void setState(MouseState newState, boolean synthesized) {
172
178
for (int i = 0 ; i < buttons .size (); i ++) {
173
179
int button = buttons .get (i );
174
180
pressState .pressButton (button );
181
+ KeyState keyState = new KeyState ();
182
+ KeyInput .getInstance ().getState (keyState );
183
+ int modifiers = pressState .getModifiers () | keyState .getModifiers ();
175
184
// send press event
176
185
boolean isPopupTrigger = false ; // TODO
177
186
postMouseEvent (view , MouseEvent .DOWN , button ,
178
187
relX , relY , x , y ,
179
- pressState . getModifiers () , isPopupTrigger ,
188
+ modifiers , isPopupTrigger ,
180
189
synthesized );
181
190
}
182
191
}
@@ -190,11 +199,14 @@ void setState(MouseState newState, boolean synthesized) {
190
199
for (int i = 0 ; i < buttons .size (); i ++) {
191
200
int button = buttons .get (i );
192
201
releaseState .releaseButton (button );
202
+ KeyState keyState = new KeyState ();
203
+ KeyInput .getInstance ().getState (keyState );
204
+ int modifiers = releaseState .getModifiers () | keyState .getModifiers ();
193
205
// send release event
194
206
boolean isPopupTrigger = false ; // TODO
195
207
postMouseEvent (view , MouseEvent .UP , button ,
196
208
relX , relY , x , y ,
197
- releaseState . getModifiers () , isPopupTrigger ,
209
+ modifiers , isPopupTrigger ,
198
210
synthesized );
199
211
}
200
212
}
@@ -208,7 +220,9 @@ void setState(MouseState newState, boolean synthesized) {
208
220
default : dY = 0.0 ; break ;
209
221
}
210
222
if (dY != 0.0 ) {
211
- int modifiers = newState .getModifiers ();
223
+ KeyState keyState = new KeyState ();
224
+ KeyInput .getInstance ().getState (keyState );
225
+ int modifiers = newState .getModifiers () | keyState .getModifiers ();
212
226
RunnableProcessor .runLater (() -> {
213
227
view .notifyScroll (relX , relY , x , y , 0.0 , dY ,
214
228
modifiers , 1 , 0 , 0 , 0 , 1.0 , 1.0 );
0 commit comments