File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 33
33
34
34
static const int kDefaultWindowFramebuffer = 0 ;
35
35
36
+ // Android KeyEvent constants from https://developer.android.com/reference/android/view/KeyEvent
37
+ static const int kAndroidMetaStateShift = 1 << 0 ;
38
+ static const int kAndroidMetaStateAlt = 1 << 1 ;
39
+ static const int kAndroidMetaStateCtrl = 1 << 12 ;
40
+ static const int kAndroidMetaStateMeta = 1 << 16 ;
41
+
36
42
#pragma mark - Private interface declaration.
37
43
38
44
/* *
@@ -376,6 +382,12 @@ - (void)dispatchKeyEvent:(NSEvent *)event ofType:(NSString *)type {
376
382
@" keymap" : @" android" ,
377
383
@" type" : type,
378
384
@" keyCode" : @(event.keyCode ),
385
+ @" metaState" : @(
386
+ ((event.modifierFlags & NSEventModifierFlagShift) ? kAndroidMetaStateShift : 0 ) |
387
+ ((event.modifierFlags & NSEventModifierFlagOption) ? kAndroidMetaStateAlt : 0 ) |
388
+ ((event.modifierFlags & NSEventModifierFlagControl) ? kAndroidMetaStateCtrl : 0 ) |
389
+ ((event.modifierFlags & NSEventModifierFlagCommand) ? kAndroidMetaStateMeta : 0 )
390
+ )
379
391
}];
380
392
}
381
393
You can’t perform that action at this time.
0 commit comments