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)
44
44
viewGroup = platformView . GetParentOfType < ViewGroup > ( ) ;
45
45
46
46
platformView . Touch += OnTouch ;
47
+ platformView . KeyPress += OnKeyPressed ;
47
48
UpdateClickHandler ( ) ;
48
49
accessibilityManager = platformView . Context ? . GetSystemService ( Context . AccessibilityService ) as AccessibilityManager ;
49
50
@@ -89,6 +90,7 @@ protected override void OnDetachedFrom(VisualElement bindable, AView platformVie
89
90
{
90
91
view . Touch -= OnTouch ;
91
92
view . Click -= OnClick ;
93
+ view . KeyPress -= OnKeyPressed ;
92
94
}
93
95
94
96
Element = null ;
@@ -117,6 +119,15 @@ void UpdateClickHandler()
117
119
}
118
120
}
119
121
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
+
120
131
void OnClick ( object ? sender , EventArgs args )
121
132
{
122
133
if ( ! IsEnabled )
You can’t perform that action at this time.
0 commit comments