forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputModule.bindings.cs
More file actions
47 lines (36 loc) · 1.69 KB
/
Copy pathInputModule.bindings.cs
File metadata and controls
47 lines (36 loc) · 1.69 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
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngineInternal;
using Unity.Collections.LowLevel.Unsafe;
namespace UnityEngineInternal.Input
{
[NativeHeader("Modules/Input/Private/InputModuleBindings.h")]
[NativeHeader("Modules/Input/Private/InputInternal.h")]
internal partial class NativeInputSystem
{
internal static extern bool hasDeviceDiscoveredCallback { set; }
public static extern double currentTime { get; }
public static extern double currentTimeOffsetToRealtimeSinceStartup { get; }
[FreeFunction("AllocateInputDeviceId")]
public static extern int AllocateDeviceId();
// C# doesn't allow taking the address of a value type because of pinning requirements for the heap.
// And our bindings generator doesn't support overloading. So ugly code following here...
public static unsafe void QueueInputEvent<TInputEvent>(ref TInputEvent inputEvent)
where TInputEvent : struct
{
QueueInputEvent((IntPtr)UnsafeUtility.AddressOf<TInputEvent>(ref inputEvent));
}
public static extern void QueueInputEvent(IntPtr inputEvent);
public static extern long IOCTL(int deviceId, int code, IntPtr data, int sizeInBytes);
public static extern void SetPollingFrequency(float hertz);
public static extern void Update(NativeInputUpdateType updateType);
[Obsolete("This is not needed any longer.")]
public static void SetUpdateMask(NativeInputUpdateType mask)
{
}
}
}