forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNativeInputSystem.cs
More file actions
85 lines (72 loc) · 2.33 KB
/
Copy pathNativeInputSystem.cs
File metadata and controls
85 lines (72 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.Scripting;
namespace UnityEngineInternal.Input
{
public sealed class NativeInputSystem
{
public static NativeUpdateCallback onUpdate;
public static NativeEventCallback onEvents;
public static NativeDeviceDiscoveredCallback onDeviceDiscovered;
internal static extern bool enabled
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
public static extern double zeroEventTime
{
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
get;
}
[RequiredByNativeCode]
internal static void NotifyUpdate(NativeInputUpdateType updateType)
{
NativeUpdateCallback nativeUpdateCallback = NativeInputSystem.onUpdate;
if (nativeUpdateCallback != null)
{
nativeUpdateCallback(updateType);
}
}
[RequiredByNativeCode]
internal static void NotifyEvents(int eventCount, IntPtr eventData)
{
NativeEventCallback nativeEventCallback = NativeInputSystem.onEvents;
if (nativeEventCallback != null)
{
nativeEventCallback(eventCount, eventData);
}
}
[RequiredByNativeCode]
internal static void NotifyDeviceDiscovered(NativeInputDeviceInfo deviceInfo)
{
NativeDeviceDiscoveredCallback nativeDeviceDiscoveredCallback = NativeInputSystem.onDeviceDiscovered;
if (nativeDeviceDiscoveredCallback != null)
{
nativeDeviceDiscoveredCallback(deviceInfo);
}
}
[GeneratedByOldBindingsGenerator, ThreadAndSerializationSafe]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern void SendInput(ref NativeInputEvent inputEvent);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern string GetDeviceConfiguration(int deviceId);
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern string GetControlConfiguration(int deviceId, int controlIndex);
public static void SetPollingFrequency(float hertz)
{
if (hertz < 1f)
{
throw new ArgumentException("Polling frequency cannot be less than 1Hz");
}
NativeInputSystem.SetPollingFrequencyInternal(hertz);
}
[GeneratedByOldBindingsGenerator]
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void SetPollingFrequencyInternal(float hertz);
}
}