> For the complete documentation index, see [llms.txt](https://cmonkeys.gitbook.io/cinput-reference-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cmonkeys.gitbook.io/cinput-reference-manual/using-cinput/changing-inputs-from-the-defaults/the-onkeychanged-event.md).

# The OnKeyChanged Event

cInput calls an event whenever either the [`ChangeKey()`](/cinput-reference-manual/script-reference/methods/changekey.md) function which waits for player input, or the [`ResetInputs()`](/cinput-reference-manual/script-reference/methods/resetinputs.md) function is called. Note that it will still be called in cases where the keys stay the same (such as from canceling a [`ChangeKey()`](/cinput-reference-manual/script-reference/methods/changekey.md) action). An example for why you might want to use the OnKeyChanged event would be to run a function to update the text labels in a custom UI.

Here's some code showing one such example:

## What's an Event?

If events are completely new to you, you may find [Unity's training video on Events](http://unity3d.com/learn/tutorials/modules/intermediate/scripting/events?playlist=17117) helpful.
