-
-
Notifications
You must be signed in to change notification settings - Fork 427
/
Copy pathIInputContext.cs
80 lines (70 loc) · 2.74 KB
/
IInputContext.cs
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
namespace Silk.NET.Input
{
/// <summary>
/// An interface representing the input context.
/// </summary>
public interface IInputContext : IDisposable
{
/// <summary>
/// A handle to the underlying input context.
/// </summary>
nint Handle { get; }
/// <summary>
/// A list of all available gamepads.
/// </summary>
IReadOnlyList<IGamepad> Gamepads { get; }
/// <summary>
/// A list of all available joysticks.
/// </summary>
IReadOnlyList<IJoystick> Joysticks { get; }
/// <summary>
/// A list of all available keyboards.
/// <remarks>
/// On some backends, this list may only contain 1 item. This is most likely because the underlying API doesn't
/// support multiple keyboards.
/// </remarks>
/// </summary>
IReadOnlyList<IKeyboard> Keyboards { get; }
/// <summary>
/// A list of all available mice.
/// </summary>
/// <remarks>
/// On some backends, this list may only contain 1 item. This is most likely because the underlying API doesn't
/// support multiple mice.
/// </remarks>
IReadOnlyList<IMouse> Mice { get; }
/// <summary>
/// A list of all available touch devices.
/// </summary>
/// <remarks>
/// On some backends, this list may only contain 1 item. This is most likely because the underlying API doesn't
/// support multiple touch devices.
/// On some backends, this list might be empty. This is most likely because the underlying API doesn't
/// support touch devices.
/// </remarks>
IReadOnlyList<ITouchDevice> TouchDevices { get; }
/// <summary>
/// The primary touch device if any.
/// </summary>
/// <remarks>
/// On some backends this might just be an educated guess. Or might be null even though there are touch devices.
/// </remarks>
ITouchDevice? PrimaryTouchDevice { get; }
/// <summary>
/// A list of all other available input devices.
/// </summary>
/// <remarks>
/// On some backends, this list might be empty. This is most likely because the underlying API doesn't
/// support other devices.
/// </remarks>
IReadOnlyList<IInputDevice> OtherDevices { get; }
/// <summary>
/// Called when the connection status of a device changes.
/// </summary>
event Action<IInputDevice, bool>? ConnectionChanged;
}
}