> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/flatredball/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/flatredball/api/flatredball/input/windows/windowsinputeventmanager.md).

# WindowsInputEventManager

### Introduction

The WindowsInputEventManager is a class which can be used to read character-based input from the keyboard (as opposed to key-based input, as provided by the [FlatRedBall Keyboard class](https://github.com/flatredball/FlatRedBallDocs/tree/main/documentation/api/flatredball/input/keyboard.md)). Character based input (where character refers to the char type) is useful for games which need to read string input from the keyboard. For example, games may need input for entering a player's name.

### WindowsInputEventManager is Platform-Specific

The WindowsInputEventManager class is currently only available in the FlatRedBall XNA PC projects. Eventually other platforms will have their own platform-specific classes.

### Code Example

Once added, the WindowsInputEventManager can be accessed in any class because it is static . In this example the code to handle input events exists in a Glue screen.

```lang:c#
void CustomInitialize()
{
    WindowsInputEventManager.Initialize(FlatRedBallServices.Game.Window);
    WindowsInputEventManager.CharEntered += HandleCharEntered;
    WindowsInputEventManager.KeyDown += HandleKeyDown;
}

private void HandleKeyDown(object sender, KeyEventArgs e)
{
    // Handle characters entered, like backspace or arrow keys...
}

private void HandleCharEntered(object sender, CharacterEventArgs e)
{
    FlatRedBall.Debugging.Debugger.CommandLineWrite(e.Character);
}

void CustomActivity(bool firstTimeCalled)
{
}

void CustomDestroy()
{
    WindowsInputEventManager.CharEntered -= HandleCharEntered;
    WindowsInputEventManager.KeyDown -= HandleKeyDown;
}

static void CustomLoadStaticContent(string contentManagerName)
{
}
```

![](https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2Fgit-blob-058d1353748cdee1136b0026a6191ada31f5f6db%2F2017-09-img_59b58514dd33d.png?alt=media)

Notice that CustomDestroy unsubscribes from the events subscribed to in CustomInitialize .


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.flatredball.com/flatredball/api/flatredball/input/windows/windowsinputeventmanager.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
