# GLFW character text input with modifier keys (control, meta, alt)

**URL:** https://discourse.glfw.org/t/glfw-character-text-input-with-modifier-keys-control-meta-alt/1467
**Category:** support
**Created:** [January 3, 2020, 8:36pm UTC](https://discourse.glfw.org/t/glfw-character-text-input-with-modifier-keys-control-meta-alt/1467 "2020-01-03T20:36:34Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)
#### Post date: [January 4, 2020, 11:51am UTC](https://discourse.glfw.org/t/glfw-character-text-input-with-modifier-keys-control-meta-alt/1467/2 "2020-01-04T11:51:12Z")

</div>

Hi,

`glfwSetKeyCallback` and `glfwSetCharCallback` are indeed intended for different purposes.

[glfwSetCharCallback](https://www.glfw.org/docs/latest/input_guide.html#input_char) is for text input, and is the direct text input provided by the operating system as native `UTF-32` codepoints.

[glfwSetKeyCallback](https://www.glfw.org/docs/latest/input_guide.html#input_key) is for physical key presses. The keys are identified by a platform specific scancode and mapped to a US layout virtual key code.

You can get hold of the [Key names](https://www.glfw.org/docs/latest/input_guide.html#input_key_name) for keys and scancodes using `glfwGetKeyName`, which will give an identifiable name (if possible) for a key, such as `Z` for `GLFW_KEY_W` on an AZERTY keyboard.

Typically programs use specific key callbacks to generate program events, such as `CTRL+C` to quit, and char callbacks to input text when in a text input field. If you want to use the `C` rather than virtual `GLFW_KEY_C` key you can call `glfwGetKeyName` to check the key name (it’s possible that some keyboards may not have a C key so it might be useful to have a fallback if you want to support these).

Cheers,

Doug.

---

_[View the full topic](https://discourse.glfw.org/t/glfw-character-text-input-with-modifier-keys-control-meta-alt/1467)._
