@@ -237,15 +237,13 @@ void MouseEngine::OnMouseMoveCross(MouseEventArg& e)
237
237
}
238
238
239
239
int stallCount = 0 ;
240
- int maxStallCount = 250 ;
241
240
242
241
void MouseEngine::OnMouseMoveStraight (MouseEventArg& e)
243
242
{
244
243
ResetClip ();
245
244
if (CheckForStopped (e)) return ;
246
245
247
246
int triggerKey = VK_CONTROL;
248
- bool isTriggerKeyPressed = ((GetAsyncKeyState (triggerKey) & 0x8000 ) == 0x8000 );
249
247
const auto pIn = e.Point ;
250
248
251
249
const ZoneLink* zoneOut;
@@ -258,11 +256,23 @@ void MouseEngine::OnMouseMoveStraight(MouseEventArg& e)
258
256
zoneOut = _oldZone->RightZones ->AtPixel (pIn.Y ());
259
257
if (zoneOut->Target )
260
258
{
261
- if (_oldZone->ExitTriggerRight && !isTriggerKeyPressed)
259
+ bool isTriggerKeyPressed = enableCtrlKeyCrossing && ((GetAsyncKeyState (triggerKey) & 0x8000 ) == 0x8000 );
260
+ if (enableControlVertEdgeCrossing && !isTriggerKeyPressed)
262
261
{
263
- NoZoneMatches (e);
264
- return ;
262
+ stallCount++;
263
+ if (stallCount < controlCrossingThreshold) {
264
+ #if defined(_DEBUG)
265
+ std::cout << " count " << stallCount << " \n " ;
266
+ #endif
267
+ NoZoneMatches (e);
268
+ return ;
269
+ }
270
+ else {
271
+ stallCount = 0 ;
272
+ }
265
273
}
274
+ stallCount = 0 ;
275
+ pOut = { zoneOut->ToTargetPixel (pIn.X ()), zoneOut->Target ->PixelsBounds ().Top () };
266
276
267
277
pOut = { zoneOut->Target ->PixelsBounds ().Left (),zoneOut->ToTargetPixel (pIn.Y ()) };
268
278
}
@@ -278,11 +288,23 @@ void MouseEngine::OnMouseMoveStraight(MouseEventArg& e)
278
288
zoneOut = _oldZone->LeftZones ->AtPixel (pIn.Y ());
279
289
if (zoneOut->Target )
280
290
{
281
- if (_oldZone->ExitTriggerLeft && !isTriggerKeyPressed)
291
+ bool isTriggerKeyPressed = enableCtrlKeyCrossing && ((GetAsyncKeyState (triggerKey) & 0x8000 ) == 0x8000 );
292
+ if (enableControlVertEdgeCrossing && !isTriggerKeyPressed)
282
293
{
283
- NoZoneMatches (e);
284
- return ;
294
+ stallCount++;
295
+ if (stallCount < controlCrossingThreshold) {
296
+ #if defined(_DEBUG)
297
+ std::cout << " count " << stallCount << " \n " ;
298
+ #endif
299
+ NoZoneMatches (e);
300
+ return ;
301
+ }
302
+ else {
303
+ stallCount = 0 ;
304
+ }
285
305
}
306
+ stallCount = 0 ;
307
+ pOut = { zoneOut->ToTargetPixel (pIn.X ()), zoneOut->Target ->PixelsBounds ().Top () };
286
308
287
309
pOut = { zoneOut->Target ->PixelsBounds ().Right () - 1 ,zoneOut->ToTargetPixel (pIn.Y ()) };
288
310
}
@@ -298,10 +320,11 @@ void MouseEngine::OnMouseMoveStraight(MouseEventArg& e)
298
320
zoneOut = _oldZone->BottomZones ->AtPixel (pIn.X ());
299
321
if (zoneOut->Target )
300
322
{
301
- if (_oldZone->ExitTriggerBottom && !isTriggerKeyPressed)
323
+ bool isTriggerKeyPressed = enableCtrlKeyCrossing && ((GetAsyncKeyState (triggerKey) & 0x8000 ) == 0x8000 );
324
+ if (enableControlHorzEdgeCrossing && !isTriggerKeyPressed)
302
325
{
303
326
stallCount++;
304
- if (stallCount < maxStallCount ) {
327
+ if (stallCount < controlCrossingThreshold ) {
305
328
#if defined(_DEBUG)
306
329
std::cout << " count " << stallCount << " \n " ;
307
330
#endif
@@ -328,10 +351,11 @@ void MouseEngine::OnMouseMoveStraight(MouseEventArg& e)
328
351
zoneOut = _oldZone->TopZones ->AtPixel (pIn.X ());
329
352
if (zoneOut->Target )
330
353
{
331
- if (_oldZone->ExitTriggerTop && !isTriggerKeyPressed)
354
+ bool isTriggerKeyPressed = enableCtrlKeyCrossing && ((GetAsyncKeyState (triggerKey) & 0x8000 ) == 0x8000 );
355
+ if (enableControlHorzEdgeCrossing && !isTriggerKeyPressed)
332
356
{
333
357
stallCount++;
334
- if (stallCount < maxStallCount ) {
358
+ if (stallCount < controlCrossingThreshold ) {
335
359
#if defined(_DEBUG)
336
360
std::cout << " count " << stallCount << " \n " ;
337
361
#endif
0 commit comments