Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 475
Document Input.Common#19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
6a2274ac29a5408b3f7ebcfad5e7f56e516cb74225bebc935c5fbda59e203b04f7bf3ad1174b258939297cfb9aa038e5fff132b5c50a42bc46a6eb34ad63a8273786ef5236022aa3232e9b89a60bd92d955556b7File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -8,15 +8,55 @@ | ||
| namespace Silk.NET.Input.Common | ||
| { | ||
| /// <summary> | ||
| /// Represents a gamepad/controller with a set amount of thumbsticks, buttons, and triggers. | ||
| /// </summary> | ||
| public interface IGamepad : IInputDevice | ||
| { | ||
| /// <summary> | ||
| /// A list of all available buttons. | ||
| /// </summary> | ||
| IReadOnlyCollection<Button> Buttons { get; } | ||
| /// <summary> | ||
| /// A list of all available thumbsticks. | ||
| /// </summary> | ||
| IReadOnlyCollection<Thumbstick> Thumbsticks { get; } | ||
| /// <summary> | ||
| /// A list of all available triggers. | ||
| /// </summary> | ||
| IReadOnlyCollection<Trigger> Triggers { get; } | ||
| /// <summary> | ||
| /// The deadzone for this gamepad. | ||
| /// </summary> | ||
| Deadzone Deadzone { get; set; } | ||
| /// <summary> | ||
| /// Called when a button is pressed. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// This event is only called when the button is first pressed, and not every frame where the button is still pressed. | ||
| /// </remarks> | ||
| event Action<IGamepad, Button> ButtonDown; | ||
| /// <summary> | ||
| /// Called when a button is released. | ||
| /// </summary> | ||
devvoid marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| /// <remarks> | ||
| /// This event is only called when the button is first released, and not every frame where the button is still released. | ||
| /// </remarks> | ||
| event Action<IGamepad, Button> ButtonUp; | ||
| /// <summary> | ||
| /// Called when a thumbstick is moved. | ||
| /// </summary> | ||
| event Action<IGamepad, Thumbstick> ThumbstickMoved; | ||
| event Action<IGamepad, Thumbstick> TriggerMoved; | ||
| /// <summary> | ||
| /// Called when a trigger is moved. | ||
| /// </summary> | ||
| event Action<IGamepad, Trigger> TriggerMoved; | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -7,9 +7,30 @@ | ||
| namespace Silk.NET.Input.Common | ||
| { | ||
| /// <summary> | ||
| /// An interface representing an input platform. | ||
| /// </summary> | ||
| public interface IInputPlatform | ||
| { | ||
| /// <summary> | ||
| /// If this platform is applicable to this window. | ||
| /// </summary> | ||
| /// <param name="window">The window to check.</param> | ||
| /// <returns>Whether or not this platform is applicable.</returns> | ||
devvoid marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| /// <remarks> | ||
| /// Generally, each Input package will also have a matching Windowing package, | ||
| /// and the Input package will reference the Windowing package. IsApplicable works | ||
| /// by checking that the given window is an instance created by the Windowing | ||
| /// package the Input package references. For example, GlfwInputPlatform will only | ||
| /// be applicable for a GlfwWindow. | ||
| /// </remarks> | ||
| bool IsApplicable(IWindow window); | ||
| /// <summary> | ||
| /// Get an input context for this window. | ||
| /// </summary> | ||
| /// <param name="window">The window to get a context for.</param> | ||
| /// <returns>The context.</returns> | ||
| IInputContext GetInput(IWindow window); | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.