# Class "Input"

## Functions

### GetActionValue () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/input.md){: .abp .tooltip .badge }

#### float GetActionValue ( int action, int controllerId ) {: .copyable aria-label='Functions' }

Returns the current strength in which a button was pressed. This is 0 OR 1 with a keyboard. With a controller, this can be used to get the strength in which you have moved the analog stick in a direction.

???- example "Example Code" This code prints the current "strength" in which the analog stick was moved to the left.

```lua
    print(Input.GetActionValue(ButtonAction.ACTION_LEFT, 1))
```

### GetButtonValue () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/input.md){: .abp .tooltip .badge }

#### float GetButtonValue ( int button, int controllerId ) {: .copyable aria-label='Functions' }

Use "GetActionValue" instead of this function.

### GetMousePosition () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/input.md){: .abp .tooltip .badge }

#### [Vector](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/Vector/README.md) GetMousePosition ( boolean gameCoords ) {: .copyable aria-label='Functions' }

Returns the current mouse position in game coordinates (true) or render coordinates.

???- example "Example Code" This code renders "Hello World!" at the current mouse position.

```lua
    local mousePos = Isaac.WorldToScreen(Input.GetMousePosition(true))-- transfer game- in screen coordinates
    Isaac.RenderText("Hello World!", mousePos.X, mousePos.Y, 1 ,1 ,1 ,1 )
```

### IsActionPressed () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/input.md){: .abp .tooltip .badge }

#### boolean IsActionPressed ( int action, int controllerId ) {: .copyable aria-label='Functions' }

Returns, if an action-button is pressed or not. An Action-button is any button that got a default function assigned to it. This function will return true, as long the button is held down.

[List of all Action enums](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/enums/ButtonAction/README.md)

???- example "Example Code" This code prints "bomb Button pressed", when any button was pressed that is assigned to the "place bomb" function.

```lua
    if Input.IsActionPressed(ButtonAction.ACTION_BOMB, 0)  then
    print("bomb Button pressed")   
    end
```

### IsActionTriggered () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/input.md){: .abp .tooltip .badge }

#### boolean IsActionTriggered ( int action, int controllerId ) {: .copyable aria-label='Functions' }

Returns, if an action-button was pressed some time before or not. An Action-button is any button that got a default function assigned to it. This functions will only return true, if the button was pressed down. It will no longer return true, after you called this function and try to call it in the next update cycle (for example in the next render cycle).

[List of all Action enums](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/enums/ButtonAction/README.md)

???- example "Example Code" This code prints "bomb Button pressed", when any button was pressed that is assigned to the "place bomb" function.

```lua
    if Input.IsActionTriggered(ButtonAction.ACTION_BOMB, 0)  then
    print("bomb Button pressed")   
    end
```

### IsButtonPressed () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/input.md){: .abp .tooltip .badge }

#### boolean IsButtonPressed ( int button, int controllerId ) {: .copyable aria-label='Functions' }

Returns, if a button is pressed or not. This function will return true, as long the button is held down.

[List of all Action enums](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/enums/ButtonAction/README.md)

???- example "Example Code" This code prints "Enter Button pressed", when the "Enter"-Button was pressed.

```lua
    if Input.IsButtonPressed(Keyboard.KEY_ENTER, 0)  then
    print("Enter Button pressed.")   
    end
```

### IsButtonTriggered () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/input.md){: .abp .tooltip .badge }

#### boolean IsButtonTriggered ( int button, int controllerId ) {: .copyable aria-label='Functions' }

Returns, if a button was pressed some time before or not. This functions will only return true, if the button was pressed down. It will no longer return true, after you called this function and try to call it in the next update cycle (for example in the next render cycle).

[List of all Action enums](https://github.com/wofsauge/IsaacDocs/tree/420a6aaa54ea230461fb26e61297c068492684de/beta/enums/ButtonAction/README.md)

???- example "Example Code" This code prints "Enter Button was pressed", when the "Enter"-Button was pressed.

```lua
    if Input.IsButtonTriggered(Keyboard.KEY_ENTER, 0)  then
    print("Enter Button was pressed.")   
    end
```

### IsMouseBtnPressed () {: aria-label='Functions' }

[ ](/ab_p/beta/docs/input.md){: .abp .tooltip .badge }

#### boolean IsMouseBtnPressed ( int button ) {: .copyable aria-label='Functions' }

Returns, if a mousebutton is pressed or not. Left: 0, Right: 1, mousewheel: 2, back button: 3, forward button: 4

???- example "Example Code" This code prints "Right Click", when the "right"-mousebutton was pressed.

```lua
    if Input.IsMouseBtnPressed(1)  then
    print("Right Click")   
    end
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moddingofisaac.com/ab_p/beta/docs/input.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
