# glfwSetCharCallback problem

**URL:** <https://discourse.glfw.org/t/glfwsetcharcallback-problem/241>\
**Category:** support\
**Created:** [March 8, 2012, 12:43pm UTC](https://discourse.glfw.org/t/glfwsetcharcallback-problem/241 "2012-03-08T12:43:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [March 8, 2012, 12:43pm UTC](https://discourse.glfw.org/t/glfwsetcharcallback-problem/241/1 "2012-03-08T12:43:47Z")

</div>

**anonymous** wrote on [Thursday, March 08, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/cf72e720/#462a):

Hi everyone,

I have a problem with glfwSetCharCallback, it notify GLFW\_PESS but not  
GLFW\_RELEASE.  
I need both notifications, how to deal with it?

Sorry for my english,

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [March 8, 2012, 12:52pm UTC](https://discourse.glfw.org/t/glfwsetcharcallback-problem/241/2 "2012-03-08T12:52:47Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Thursday, March 08, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/cf72e720/#3b4a):

This was disabled in GLFW 2.7 in preparation for its removal in 3.0. The idea  
of “Unicode character up” has no clear meaning, as several keys can be  
involved in producing a given character. If what you want is notification of  
when a key is released, use the key callback.

However, if you are _certain_ that you want to use this in my opinion broken  
feature, you can re-enable it by looking in the file lib/window.c at line 217.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [March 8, 2012, 7:10pm UTC](https://discourse.glfw.org/t/glfwsetcharcallback-problem/241/3 "2012-03-08T19:10:49Z")

</div>

**anonymous** wrote on [Thursday, March 08, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/cf72e720/#9c53):

But with the key callback then for example, when the user press ‘w’ i recive  
like ‘W’ (capital letter) and not like ‘w’, without shift or bloq. mayus  
activated.  
There is a tutorial or something explaining that? In the deocumentation it  
missing something.

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [March 9, 2012, 11:51am UTC](https://discourse.glfw.org/t/glfwsetcharcallback-problem/241/4 "2012-03-09T11:51:57Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Friday, March 09, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/cf72e720/#63bf):

Are you trying to implement text input or something like game controls?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [March 11, 2012, 2:59pm UTC](https://discourse.glfw.org/t/glfwsetcharcallback-problem/241/5 "2012-03-11T14:59:44Z")

</div>

**anonymous** wrote on [Sunday, March 11, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/cf72e720/#b82a):

I need for both cases. For UI text input and for game controls.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [March 11, 2012, 3:02pm UTC](https://discourse.glfw.org/t/glfwsetcharcallback-problem/241/6 "2012-03-11T15:02:39Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, March 11, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/cf72e720/#b459):

In that case you should use the char callback for text input and the key  
callback for game controls.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [March 11, 2012, 3:03pm UTC](https://discourse.glfw.org/t/glfwsetcharcallback-problem/241/7 "2012-03-11T15:03:27Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, March 11, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/cf72e720/#6219):

The callbacks are not mutually exclusive and many keys will trigger both  
callbacks.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [March 14, 2012, 12:13pm UTC](https://discourse.glfw.org/t/glfwsetcharcallback-problem/241/8 "2012-03-14T12:13:39Z")

</div>

**anonymous** wrote on [Wednesday, March 14, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/cf72e720/#2ec5):

I will do what you are saying, thanks for your time.
