File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ protected override void OnAttachedTo(VisualElement bindable, AView platformView)
4444 viewGroup = platformView . GetParentOfType < ViewGroup > ( ) ;
4545
4646 platformView . Touch += OnTouch ;
47+ platformView . KeyPress += OnKeyPressed ;
4748 UpdateClickHandler ( ) ;
4849 accessibilityManager = platformView . Context ? . GetSystemService ( Context . AccessibilityService ) as AccessibilityManager ;
4950
@@ -89,6 +90,7 @@ protected override void OnDetachedFrom(VisualElement bindable, AView platformVie
8990 {
9091 view . Touch -= OnTouch ;
9192 view . Click -= OnClick ;
93+ view . KeyPress -= OnKeyPressed ;
9294 }
9395
9496 Element = null ;
@@ -117,6 +119,15 @@ void UpdateClickHandler()
117119 }
118120 }
119121
122+ void OnKeyPressed ( object ? sender , AView . KeyEventArgs e )
123+ {
124+ if ( e . KeyCode == Keycode . Space && e . Event ? . Action == KeyEventActions . Up )
125+ {
126+ IsCanceled = false ;
127+ HandleTouchEnded ( TouchStatus . Completed ) ;
128+ }
129+ }
130+
120131 void OnClick ( object ? sender , EventArgs args )
121132 {
122133 if ( ! IsEnabled )
You can’t perform that action at this time.
0 commit comments