Falco Engine 3.9.0.1 (beta)
Input.cs
Go to the documentation of this file.
1using System.Runtime.CompilerServices;
2
3namespace FalcoEngine
4{
5 public class Input
6 {
11 {
12 get
13 {
14 INTERNAL_get_cursor_direction(out Vector2 value);
15 return value;
16 }
17 }
18
22 public static Vector2 cursorPosition
23 {
24 get
25 {
26 INTERNAL_get_cursor_position(out Vector2 value);
27 return value;
28 }
29 }
30
35 {
36 get
37 {
38 INTERNAL_get_cursor_relative_position(out Vector2 value);
39 return value;
40 }
41 }
42
48 public static bool GetKey(ScanCode key)
49 {
50 return INTERNAL_get_key((int)key);
51 }
52
58 public static bool GetKeyDown(ScanCode key)
59 {
60 return INTERNAL_get_key_down((int)key);
61 }
62
68 public static bool GetKeyUp(ScanCode key)
69 {
70 return INTERNAL_get_key_up((int)key);
71 }
72
78 public static bool GetMouseButton(int button)
79 {
80 return INTERNAL_get_mouse_button(button);
81 }
82
88 public static bool GetMouseButtonDown(int button)
89 {
90 return INTERNAL_get_mouse_button_down(button);
91 }
92
98 public static bool GetMouseButtonUp(int button)
99 {
100 return INTERNAL_get_mouse_button_up(button);
101 }
102
107 public static Vector2 GetMouseWheel()
108 {
109 INTERNAL_get_mouse_wheel(out Vector2 value);
110 return value;
111 }
112
113 [MethodImpl(MethodImplOptions.InternalCall)]
114 private static extern void INTERNAL_get_cursor_direction(out Vector2 value);
115
116 [MethodImpl(MethodImplOptions.InternalCall)]
117 private static extern void INTERNAL_get_cursor_position(out Vector2 value);
118
119 [MethodImpl(MethodImplOptions.InternalCall)]
120 private static extern void INTERNAL_get_cursor_relative_position(out Vector2 value);
121
122 [MethodImpl(MethodImplOptions.InternalCall)]
123 private static extern bool INTERNAL_get_key(int key);
124
125 [MethodImpl(MethodImplOptions.InternalCall)]
126 private static extern bool INTERNAL_get_key_down(int key);
127
128 [MethodImpl(MethodImplOptions.InternalCall)]
129 private static extern bool INTERNAL_get_key_up(int key);
130
131 [MethodImpl(MethodImplOptions.InternalCall)]
132 private static extern bool INTERNAL_get_mouse_button(int button);
133
134 [MethodImpl(MethodImplOptions.InternalCall)]
135 private static extern bool INTERNAL_get_mouse_button_down(int button);
136
137 [MethodImpl(MethodImplOptions.InternalCall)]
138 private static extern bool INTERNAL_get_mouse_button_up(int button);
139
140 [MethodImpl(MethodImplOptions.InternalCall)]
141 private static extern void INTERNAL_get_mouse_wheel(out Vector2 value);
142 }
143}
static Vector2 cursorRelativePosition
Get mouse cursor position relative to window (from top left of the window)
Definition: Input.cs:35
static Vector2 cursorPosition
Get mouse cursor global position (from top left of the screen)
Definition: Input.cs:23
static bool GetMouseButtonUp(int button)
Returns true during the frame the user releases the given mouse button
Definition: Input.cs:98
static bool GetKeyDown(ScanCode key)
Returns true during the frame the user starts pressing down the key identified by the key ScanCode en...
Definition: Input.cs:58
static Vector2 GetMouseWheel()
Returns direction in which the mouse wheel was scrolled
Definition: Input.cs:107
static bool GetMouseButtonDown(int button)
Returns true during the frame the user pressed the given mouse button
Definition: Input.cs:88
static bool GetKey(ScanCode key)
Returns true while the user holds down the key identified by the key ScanCode enum parameter
Definition: Input.cs:48
static bool GetMouseButton(int button)
Returns whether the given mouse button is held down
Definition: Input.cs:78
static bool GetKeyUp(ScanCode key)
Returns true during the frame the user releases the key identified by the key ScanCode enum parameter
Definition: Input.cs:68
static Vector2 cursorDirection
Get mouse cursor direction (delta position)
Definition: Input.cs:11