Skip to content

Commit

Permalink
Added public api to input objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornado-Technology committed Sep 2, 2024
1 parent 29ee8a6 commit 09ee904
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Hypercube.Input/Key.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Hypercube.Input;
using JetBrains.Annotations;

namespace Hypercube.Input;

[PublicAPI]
public enum Key
{
Unknown = -1,
Expand Down
6 changes: 4 additions & 2 deletions Hypercube.Input/KeyModifiers.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace Hypercube.Input;
using JetBrains.Annotations;

[Flags]
namespace Hypercube.Input;

[PublicAPI, Flags]
public enum KeyModifiers
{
None = default,
Expand Down
5 changes: 4 additions & 1 deletion Hypercube.Input/KeyState.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Hypercube.Input;
using JetBrains.Annotations;

namespace Hypercube.Input;

[PublicAPI]
public enum KeyState
{
Released,
Expand Down
6 changes: 4 additions & 2 deletions Hypercube.Input/KeyStateChangedArgs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Hypercube.Input;
using JetBrains.Annotations;

namespace Hypercube.Input;

[PublicAPI]
public class KeyStateChangedArgs
{
public bool Shift => Modifiers.HasFlag(KeyModifiers.Shift);
Expand All @@ -12,7 +15,6 @@ public class KeyStateChangedArgs
public readonly Key Key;
public readonly KeyState State;
public readonly KeyModifiers Modifiers;

public readonly int ScanCode;

public KeyStateChangedArgs(Key key, KeyState state, KeyModifiers modifiers, int scanCode)
Expand Down
5 changes: 4 additions & 1 deletion Hypercube.Input/MouseButton.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Hypercube.Input;
using JetBrains.Annotations;

namespace Hypercube.Input;

[PublicAPI]
public enum MouseButton
{
Left = 0,
Expand Down
5 changes: 4 additions & 1 deletion Hypercube.Input/MouseButtonChangedArgs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Hypercube.Input;
using JetBrains.Annotations;

namespace Hypercube.Input;

[PublicAPI]
public class MouseButtonChangedArgs
{
public bool Shift => Modifiers.HasFlag(KeyModifiers.Shift);
Expand Down

0 comments on commit 09ee904

Please sign in to comment.