# Controller

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Subclasses: [HumanoidController](https://rapi.sleaze.dev/classes/HumanoidController.md), [SkateboardController](https://rapi.sleaze.dev/classes/SkateboardController.md), [VehicleController](https://rapi.sleaze.dev/classes/VehicleController.md)
- Tags: Not creatable
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/Controller/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/Controller

The base class for controller objects, such as the [`HumanoidController`](https://rapi.sleaze.dev/classes/HumanoidController.md) object.

## Methods

### BindButton

```luau
Controller:BindButton(button: Enum.Button, caption: string)
```

Activates an overriding bind on the specified button.

Parameters:

- `button`: The `Button` to bind.
- `caption`: The text to display for the bound button.

### GetButton

```luau
Controller:GetButton(button: Enum.Button): boolean
```

Returns whether or not Button is being pressed.

Parameters:

- `button`: The `Button` whose pressed state to check.

Returns: Whether the specified button is currently pressed.

### UnbindButton

```luau
Controller:UnbindButton(button: Enum.Button)
```

Removes the bind on button.

Parameters:

- `button`: The `Button` to unbind.

### bindButton

```luau
Controller:bindButton(button: Enum.Button, caption: string)
```

- Tags: Deprecated
- Use instead: [`Controller.BindButton`](https://rapi.sleaze.dev/classes/Controller.md)

**Deprecated:** This function is a deprecated variant of [`Controller:BindButton()`](https://rapi.sleaze.dev/classes/Controller.md) which should be used instead.

### getButton

```luau
Controller:getButton(button: Enum.Button): boolean
```

- Tags: Deprecated
- Use instead: [`Controller.GetButton`](https://rapi.sleaze.dev/classes/Controller.md)

**Deprecated:** This function is a deprecated variant of [`Controller:GetButton()`](https://rapi.sleaze.dev/classes/Controller.md) which should be used instead.

## Events

### ButtonChanged

```luau
Controller.ButtonChanged: RBXScriptSignal<(button: Enum.Button)>
```

Fired when the pressed state of a bound button is changed. This event can be used in conjunction with [`Controller:GetButton()`](https://rapi.sleaze.dev/classes/Controller.md) to see whether a bound button is being pressed down or not.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
