Skip to content

Commit 8912449

Browse files
committed
chore
1 parent ae8897a commit 8912449

2 files changed

Lines changed: 10 additions & 26 deletions

File tree

Assets/Plugins/MajdataPlay/Platform/iOS/NativeKeyboard.cs

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,26 @@
44
namespace MajdataPlay.Platform.iOS;
55
public static class NativeKeyboard
66
{
7-
const string IOSLibraryName = "__Internal";
87
#if UNITY_EDITOR_OSX
9-
const string MacEditorLibraryName = "NativeKeyboard";
8+
const string LibraryName = "NativeKeyboard";
9+
#else
10+
const string LibraryName = "__Internal";
1011
#endif
1112

12-
#if UNITY_IOS && !UNITY_EDITOR
13-
[DllImport(IOSLibraryName, EntryPoint = "Init")]
13+
[DllImport(LibraryName, EntryPoint = "Init")]
1414
static extern ErrorCode InitInternal();
1515

16-
[DllImport(IOSLibraryName, EntryPoint = "GetKeyboardHandle")]
16+
[DllImport(LibraryName, EntryPoint = "GetKeyboardHandle")]
1717
static extern nint GetKeyboardHandleInternal();
1818

19-
[DllImport(IOSLibraryName, EntryPoint = "IsPressed")]
19+
[DllImport(LibraryName, EntryPoint = "IsPressed")]
2020
static extern ErrorCode IsPressedInternal(uint keyCode, out byte isPressedOut);
2121

22-
[DllImport(IOSLibraryName, EntryPoint = "IsPressedWithHandle")]
22+
[DllImport(LibraryName, EntryPoint = "IsPressedWithHandle")]
2323
static extern ErrorCode IsPressedWithHandleInternal(nint keyboardHandle, uint keyCode, out byte isPressedOut);
2424

25-
[DllImport(IOSLibraryName, EntryPoint = "Free")]
25+
[DllImport(LibraryName, EntryPoint = "Free")]
2626
static extern ErrorCode FreeInternal();
27-
#elif UNITY_EDITOR_OSX
28-
[DllImport(MacEditorLibraryName, EntryPoint = "Init")]
29-
static extern ErrorCode InitInternal();
30-
31-
[DllImport(MacEditorLibraryName, EntryPoint = "GetKeyboardHandle")]
32-
static extern nint GetKeyboardHandleInternal();
33-
34-
[DllImport(MacEditorLibraryName, EntryPoint = "IsPressed")]
35-
static extern ErrorCode IsPressedInternal(uint keyCode, out byte isPressedOut);
36-
37-
[DllImport(MacEditorLibraryName, EntryPoint = "IsPressedWithHandle")]
38-
static extern ErrorCode IsPressedWithHandleInternal(nint keyboardHandle, uint keyCode, out byte isPressedOut);
39-
40-
[DllImport(MacEditorLibraryName, EntryPoint = "Free")]
41-
static extern ErrorCode FreeInternal();
42-
#endif
4327

4428
public static ErrorCode Init()
4529
{

Assets/Scripts/IO/InputManager/InputManager.KeyboardHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
#if UNITY_STANDALONE_WIN
33
using MajdataPlay.Platform.Win32;
4-
#elif UNITY_IOS || UNITY_EDITOR
4+
#elif UNITY_IOS || UNITY_EDITOR_OSX
55
using MajdataPlay.Platform.iOS;
66
#endif
77
using UnityEngine.InputSystem;
@@ -77,7 +77,7 @@ public static UnityEngine.InputSystem.Key ToUnityKeyCode(KeyCode keyCode)
7777
_ => throw new ArgumentOutOfRangeException(nameof(keyCode)),
7878
};
7979
}
80-
#if UNITY_IOS || UNITY_EDITOR
80+
#if UNITY_IOS || UNITY_EDITOR_OSX
8181
public static GCKeyCode ToiOSGCKeyCode(KeyCode keyCode)
8282
{
8383
return keyCode switch

0 commit comments

Comments
 (0)