From 2c07c9b665b9f1f2fee278772955a606b749f65c Mon Sep 17 00:00:00 2001 From: Ilia Demianenko Date: Tue, 22 Aug 2023 09:42:08 -0700 Subject: [PATCH] Bring back the main modifier, get rid of _impl --- src/app/app.h | 1 + src/app/osx_app.m | 1 + src/app/win32_app.c | 1 + src/platform/orca_platform.c | 16 +--------------- src/wasmbind/core_api.json | 2 +- 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/app/app.h b/src/app/app.h index f339d4b..297165a 100644 --- a/src/app/app.h +++ b/src/app/app.h @@ -212,6 +212,7 @@ extern "C" OC_KEYMOD_SHIFT = 0x02, OC_KEYMOD_CTRL = 0x04, OC_KEYMOD_CMD = 0x08, + OC_KEYMOD_MAIN_MODIFIER = 0x16 /* CMD on Mac, CTRL on Win32 */ } oc_keymod_flags; typedef enum diff --git a/src/app/osx_app.m b/src/app/osx_app.m index 0136a4a..068d4ba 100644 --- a/src/app/osx_app.m +++ b/src/app/osx_app.m @@ -215,6 +215,7 @@ static oc_keymod_flags oc_convert_osx_mods(NSUInteger nsFlags) if(nsFlags & NSEventModifierFlagCommand) { mods |= OC_KEYMOD_CMD; + mods |= OC_KEYMOD_MAIN_MODIFIER; } return (mods); } diff --git a/src/app/win32_app.c b/src/app/win32_app.c index 18d5db7..9492784 100644 --- a/src/app/win32_app.c +++ b/src/app/win32_app.c @@ -196,6 +196,7 @@ static oc_keymod_flags oc_get_mod_keys() if(GetKeyState(VK_CONTROL) & 0x8000) { mods |= OC_KEYMOD_CTRL; + mods |= OC_KEYMOD_MAIN_MODIFIER; } if(GetKeyState(VK_MENU) & 0x8000) { diff --git a/src/platform/orca_platform.c b/src/platform/orca_platform.c index 3e46971..989bce0 100644 --- a/src/platform/orca_platform.c +++ b/src/platform/orca_platform.c @@ -1,17 +1,3 @@ #include "platform.h" -oc_host_platform ORCA_IMPORT(oc_get_host_platform_impl)(); - -#ifdef __cplusplus -extern "C" -{ -#endif - - oc_host_platform oc_get_host_platform() - { - return oc_get_host_platform_impl(); - } - -#ifdef __cplusplus -} // extern "C" -#endif \ No newline at end of file +oc_host_platform ORCA_IMPORT(oc_get_host_platform)(); \ No newline at end of file diff --git a/src/wasmbind/core_api.json b/src/wasmbind/core_api.json index be7a6e2..1e4a0ea 100644 --- a/src/wasmbind/core_api.json +++ b/src/wasmbind/core_api.json @@ -59,7 +59,7 @@ ] }, { - "name": "oc_get_host_platform_impl", + "name": "oc_get_host_platform", "cname": "oc_get_host_platform", "ret": {"name": "int", "tag": "i"}, "args": []