# ButtonMap

### Introduction

The ButtonMap on the Xbox360GamePad allows for the Keyboard to simulate input for an Xbox360GamePad. By default this value is null, therefore the Keyboard will not simulate any input. Setting this value to a non-null value will enable keyboard simulation.

### Code Example

The following example sets up a button map for the keyboard:

```
Microsoft.Xna.Framework.Input.KeyboardButtonMap buttonMap = new Microsfot.Xna.Framework.KeyboardButtonMap();

buttonMap.LeftAnalogLeft = Keys.Left;
buttonMap.LeftAnalogRight = Keys.Right;
buttonMap.LeftAnalogUp = Keys.Up;
buttonMap.LeftAnalogDown = Keys.Down;

buttonMap.A = Keys.A;
buttonMap.B = Keys.S;
buttonMap.X = Keys.Q;
buttonMap.Y = Keys.W;

InputManager.Xbox360GamePads[0].ButtonMap = buttonMap;
```


---

# 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.flatredball.com/flatredball/api/flatredball/input/xbox360gamepad/buttonmap.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.
