> For the complete documentation index, see [llms.txt](https://vc-docs.gitbook.io/engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vc-docs.gitbook.io/engine/home/doxygen_synced/classes/class_input.md).

# Input

**Usage:** `api.Input.GetKeyDown(key)`

## Public Functions

|                        | Name                                                                                                                                                                                                                                                                                         |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UnityEngine.GameObject | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_input.md#function-hovermouse"><strong>HoverMouse</strong></a>()<br>Raycasts from the main camera through the current mouse position and returns the first gameobject hit within range.</p> |
| bool                   | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_input.md#function-getmousebuttondown"><strong>GetMouseButtonDown</strong></a>(int key)<br>Returns true during the frame the specified mouse button was pressed.</p>                        |
| bool                   | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_input.md#function-getmousebuttonup"><strong>GetMouseButtonUp</strong></a>(int key)<br>Returns true during the frame the specified mouse button was released.</p>                           |
| bool                   | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_input.md#function-getmousebutton"><strong>GetMouseButton</strong></a>(int key)<br>Returns true while the specified mouse button is held down.</p>                                          |
| bool                   | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_input.md#function-getkeydown"><strong>GetKeyDown</strong></a>(KeyCode key)<br>Returns true during the frame the specified keyboard key was pressed.</p>                                    |
| bool                   | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_input.md#function-getkeyup"><strong>GetKeyUp</strong></a>(KeyCode key)<br>Returns true during the frame the specified keyboard key was released.</p>                                       |

## Public Properties

|                     | Name                                                                                                                                                                                                                                                                                                       |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UnityEngine.Vector3 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_input.md#property-mouseposition"><strong>mousePosition</strong></a><br>Current mouse position in screen coordinates (pixels). Origin is the bottom-left of the screen.</p>                               |
| float               | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_input.md#property-mousescrolldelta"><strong>mouseScrollDelta</strong></a><br>Vertical scroll delta of the mouse wheel for the current frame. Positive values scroll up, negative values scroll down.</p> |

## Public Functions Documentation

### function HoverMouse

```csharp
static UnityEngine.GameObject HoverMouse()
```

Raycasts from the main camera through the current mouse position and returns the first gameobject hit within range.

**Return**: The gameobject under the mouse cursor, or `null` if nothing was hit.

### function GetMouseButtonDown

```csharp
static bool GetMouseButtonDown(
    int key
)
```

Returns true during the frame the specified mouse button was pressed.

**Parameters**:

* **key** Mouse button index (0 = left, 1 = right, 2 = middle).

**Return**: True if the button was pressed this frame, otherwise false.

### function GetMouseButtonUp

```csharp
static bool GetMouseButtonUp(
    int key
)
```

Returns true during the frame the specified mouse button was released.

**Parameters**:

* **key** Mouse button index (0 = left, 1 = right, 2 = middle).

**Return**: True if the button was released this frame, otherwise false.

### function GetMouseButton

```csharp
static bool GetMouseButton(
    int key
)
```

Returns true while the specified mouse button is held down.

**Parameters**:

* **key** Mouse button index (0 = left, 1 = right, 2 = middle).

**Return**: True if the button is currently held, otherwise false.

### function GetKeyDown

```csharp
static bool GetKeyDown(
    KeyCode key
)
```

Returns true during the frame the specified keyboard key was pressed.

**Parameters**:

* **key** The unity keycode of the key to check.

**Return**: True if the key was pressed this frame, otherwise false.

### function GetKeyUp

```csharp
static bool GetKeyUp(
    KeyCode key
)
```

Returns true during the frame the specified keyboard key was released.

**Parameters**:

* **key** The unity keycode of the key to check.

**Return**: True if the key was released this frame, otherwise false.

## Public Property Documentation

### property mousePosition

```csharp
static UnityEngine.Vector3 mousePosition;
```

Current mouse position in screen coordinates (pixels). Origin is the bottom-left of the screen.

### property mouseScrollDelta

```csharp
static float mouseScrollDelta;
```

Vertical scroll delta of the mouse wheel for the current frame. Positive values scroll up, negative values scroll down.

***

Updated on 2026-07-22 at 12:00:00 +0800
