@@ -26,24 +26,21 @@ internal sealed class InputManager
2626 // Make sure to change both files if you update this !
2727 private enum EVENTS
2828 {
29- MOUSE_MOVE = 0 ,
30- MOUSE_LEFT_DOWN = 1 ,
31- MOUSE_LEFT_UP = 2 ,
32- MOUSE_RIGHT_DOWN = 3 ,
33- MOUSE_RIGHT_UP = 4 ,
34- MOUSE_ENTER = 5 ,
35- MOUSE_LEAVE = 6 ,
29+ POINTER_MOVE = 0 ,
30+ POINTER_LEFT_DOWN = 1 ,
31+ POINTER_LEFT_UP = 2 ,
32+ POINTER_RIGHT_DOWN = 3 ,
33+ POINTER_RIGHT_UP = 4 ,
34+ POINTER_ENTER = 5 ,
35+ POINTER_LEAVE = 6 ,
3636 WHEEL = 7 ,
3737 KEYDOWN = 8 ,
3838 KEYUP = 9 ,
3939 KEYPRESS = 10 ,
40- TOUCH_START = 11 ,
41- TOUCH_END = 12 ,
42- TOUCH_MOVE = 13 ,
43- FOCUS_MANAGED = 14 ,
44- FOCUS_UNMANAGED = 15 ,
45- WINDOW_FOCUS = 16 ,
46- WINDOW_BLUR = 17 ,
40+ FOCUS_MANAGED = 11 ,
41+ FOCUS_UNMANAGED = 12 ,
42+ WINDOW_FOCUS = 13 ,
43+ WINDOW_BLUR = 14 ,
4744 }
4845
4946 private enum MouseButton
@@ -179,7 +176,7 @@ internal bool CaptureMouse(UIElement uie)
179176 Pointer . Captured = uie ;
180177
181178 string sDiv = OpenSilver . Interop . GetVariableStringForJS ( uie . OuterDiv ) ;
182- OpenSilver . Interop . ExecuteJavaScriptVoid ( $ "document.inputManager.captureMouse ({ sDiv } ); ") ;
179+ OpenSilver . Interop . ExecuteJavaScriptVoid ( $ "document.inputManager.capturePointer ({ sDiv } )") ;
183180
184181 return true ;
185182 }
@@ -192,7 +189,7 @@ internal void ReleaseMouseCapture(UIElement uie)
192189 if ( Pointer . Captured == uie )
193190 {
194191 Pointer . Captured = null ;
195- OpenSilver . Interop . ExecuteJavaScriptVoid ( $ "document.inputManager.releaseMouseCapture(); ") ;
192+ OpenSilver . Interop . ExecuteJavaScriptVoid ( $ "document.inputManager.releasePointerCapture() ") ;
196193
197194 RaiseUserInitiatedEvent ( uie , new MouseEventArgs
198195 {
@@ -326,16 +323,16 @@ private void ProcessEvent(EVENTS eventType, object jsEventArg)
326323 {
327324 switch ( eventType )
328325 {
329- case EVENTS . MOUSE_LEFT_DOWN :
326+ case EVENTS . POINTER_LEFT_DOWN :
330327 _mouseLeftDown = true ;
331328 RefreshClickCount ( null , MouseButton . Left , Environment . TickCount , new Point ( ) ) ;
332329 break ;
333330
334- case EVENTS . MOUSE_RIGHT_DOWN :
331+ case EVENTS . POINTER_RIGHT_DOWN :
335332 RefreshClickCount ( null , MouseButton . Right , Environment . TickCount , new Point ( ) ) ;
336333 break ;
337334
338- case EVENTS . MOUSE_LEFT_UP :
335+ case EVENTS . POINTER_LEFT_UP :
339336 _mouseLeftDown = false ;
340337 ReleaseMouseCapture ( ) ;
341338 break ;
@@ -425,35 +422,33 @@ private void DispatchEvent(UIElement uie, EVENTS eventType, object jsEventArg)
425422 {
426423 switch ( eventType )
427424 {
428- case EVENTS . MOUSE_MOVE :
429- case EVENTS . TOUCH_MOVE :
425+ case EVENTS . POINTER_MOVE :
430426 ProcessOnMouseMove ( uie , jsEventArg ) ;
431427 break ;
432428
433- case EVENTS . MOUSE_LEFT_DOWN :
434- case EVENTS . TOUCH_START :
429+ case EVENTS . POINTER_LEFT_DOWN :
435430 _mouseLeftDown = true ;
436431 ProcessOnMouseLeftButtonDown ( uie , jsEventArg ) ;
437432 break ;
438433
439- case EVENTS . MOUSE_LEFT_UP :
434+ case EVENTS . POINTER_LEFT_UP :
440435 _mouseLeftDown = false ;
441436 ProcessOnMouseLeftButtonUp ( uie , jsEventArg ) ;
442437 break ;
443438
444- case EVENTS . MOUSE_RIGHT_DOWN :
439+ case EVENTS . POINTER_RIGHT_DOWN :
445440 ProcessOnMouseRightButtonDown ( uie , jsEventArg ) ;
446441 break ;
447442
448- case EVENTS . MOUSE_RIGHT_UP :
443+ case EVENTS . POINTER_RIGHT_UP :
449444 ProcessOnMouseRightButtonUp ( uie , jsEventArg ) ;
450445 break ;
451446
452- case EVENTS . MOUSE_ENTER :
447+ case EVENTS . POINTER_ENTER :
453448 ProcessOnMouseEnter ( uie , jsEventArg ) ;
454449 break ;
455450
456- case EVENTS . MOUSE_LEAVE :
451+ case EVENTS . POINTER_LEAVE :
457452 ProcessOnMouseLeave ( uie , jsEventArg ) ;
458453 break ;
459454
@@ -473,10 +468,6 @@ private void DispatchEvent(UIElement uie, EVENTS eventType, object jsEventArg)
473468 ProcessOnKeyPress ( uie , jsEventArg ) ;
474469 break ;
475470
476- case EVENTS . TOUCH_END :
477- ProcessOnTouchEndEvent ( uie , jsEventArg ) ;
478- break ;
479-
480471 case EVENTS . FOCUS_UNMANAGED :
481472 ProcessOnFocusUnmanaged ( uie , jsEventArg ) ;
482473 break ;
@@ -765,22 +756,6 @@ private void ProcessPointerEvent(UIElement uie, object jsEventArg, RoutedEvent r
765756 RaiseUserInitiatedEvent ( uie , e ) ;
766757 }
767758
768- private void ProcessOnTouchEndEvent (
769- UIElement uie ,
770- object jsEventArg )
771- {
772- var e = new MouseButtonEventArgs ( )
773- {
774- RoutedEvent = UIElement . MouseLeftButtonUpEvent ,
775- OriginalSource = uie ,
776- UIEventArg = jsEventArg ,
777- } ;
778-
779- e . FillEventArgs ( uie , jsEventArg ) ;
780-
781- RaiseUserInitiatedEvent ( uie , e ) ;
782- }
783-
784759 private bool ProcessMouseButtonEvent (
785760 UIElement uie ,
786761 object jsEventArg ,
0 commit comments