@@ -90,6 +90,7 @@ -(MPRemoteCommandHandlerStatus)like;
9090 bool require_audio_reinit = false ;
9191 Str clipboard = " " ;
9292 bool enable_paste_popup = false ;
93+ bool tapped = false ;
9394 };
9495 os_context s_context;
9596
@@ -177,8 +178,11 @@ - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(N
177178 pen::os_init_on_screen_keyboard ();
178179
179180 // long press gesture for paste menu
180- UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc ] initWithTarget: self .view_controller action: @selector (handleLongPress: )];
181- [self .mtk_view addGestureRecognizer: longPress];
181+ UILongPressGestureRecognizer *long_press = [[UILongPressGestureRecognizer alloc ] initWithTarget: self .view_controller action: @selector (handleLongPress: )];
182+ [self .mtk_view addGestureRecognizer: long_press];
183+
184+ UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc ] initWithTarget: self .view_controller action: @selector (viewWasTapped: )];
185+ [self .mtk_view addGestureRecognizer: tap];
182186
183187 return YES ;
184188 }
@@ -289,6 +293,7 @@ - (void)drawInMTKView:(nonnull MTKView*)view
289293@implementation pen_view_controller
290294- (void )viewWasTapped : (id )sender
291295{
296+ s_context.tapped = true ;
292297}
293298
294299- (void )viewWasDoubleTapped : (id )sender
@@ -928,4 +933,11 @@ void os_enable_paste_popup(bool enable)
928933 {
929934 s_context.enable_paste_popup = enable;
930935 }
936+
937+ bool os_tapped ()
938+ {
939+ bool res = s_context.tapped ;
940+ s_context.tapped = false ; // consume
941+ return res;
942+ }
931943}
0 commit comments