# Keyinput callbacks

**URL:** <https://discourse.glfw.org/t/keyinput-callbacks/225>\
**Category:** support\
**Created:** [June 19, 2012, 1:08pm UTC](https://discourse.glfw.org/t/keyinput-callbacks/225 "2012-06-19T13:08:38Z")\
**Posts on this page:** 9\
**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:** [June 19, 2012, 1:08pm UTC](https://discourse.glfw.org/t/keyinput-callbacks/225/1 "2012-06-19T13:08:38Z")

</div>

**anonymous** wrote on [Tuesday, June 19, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/c5c362fb/#4e73):

Why doesn’t GLFW call callback function when key gets released? It should.

---

<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:** [June 19, 2012, 8:41pm UTC](https://discourse.glfw.org/t/keyinput-callbacks/225/2 "2012-06-19T20:41:09Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, June 19, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/c5c362fb/#6f42):

Many characters require more than one key to generate. Which of them should  
generate the release event?

---

<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:** [June 19, 2012, 8:54pm UTC](https://discourse.glfw.org/t/keyinput-callbacks/225/3 "2012-06-19T20:54:46Z")

</div>

**anonymous** wrote on [Tuesday, June 19, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/c5c362fb/#7220):

Well maybe it should have one level of indirection… so the callback notifies  
for the ‘highlevel’ keys as shift + a = A and sends the release for the A  
then. And for the lower level either only shift or shift and a. The missing  
release callback just makes those callbacks a bit trickier to use. I got my  
ways to fix that, but it still would be nice to have it as default

---

<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:** [June 19, 2012, 8:59pm UTC](https://discourse.glfw.org/t/keyinput-callbacks/225/4 "2012-06-19T20:59:28Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, June 19, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/c5c362fb/#336d):

If you want notifications about key presses, use the key callback. The char  
callback is for text input.

---

<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:** [June 19, 2012, 9:01pm UTC](https://discourse.glfw.org/t/keyinput-callbacks/225/5 "2012-06-19T21:01:21Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, June 19, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/c5c362fb/#0951):

What would you use release notifications for characters for?

---

<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:** [June 19, 2012, 9:33pm UTC](https://discourse.glfw.org/t/keyinput-callbacks/225/6 "2012-06-19T21:33:28Z")

</div>

**anonymous** wrote on [Tuesday, June 19, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/c5c362fb/#0980):

yeah… but im talking about key releases. those 2 callbacks should also notify  
when key gets released, based on their notifying mechanism on key presses.

---

<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:** [June 19, 2012, 9:36pm UTC](https://discourse.glfw.org/t/keyinput-callbacks/225/7 "2012-06-19T21:36:01Z")

</div>

**anonymous** wrote on [Tuesday, June 19, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/c5c362fb/#8d23):

sry didnt notice your last reply. id use release notifications to set the  
state of my internal keys to release, not pressed.

---

<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:** [June 19, 2012, 9:36pm UTC](https://discourse.glfw.org/t/keyinput-callbacks/225/8 "2012-06-19T21:36:09Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, June 19, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/c5c362fb/#0f91):

The key callback does report key releases. If it doesn’t then that’s a bug.  
The char callback doesn’t report release events because I consider that to be  
a broken concept. In that spirit, GLFW 3 does not have an action parameter for  
the char callback.

---

<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:** [June 19, 2012, 9:44pm UTC](https://discourse.glfw.org/t/keyinput-callbacks/225/9 "2012-06-19T21:44:49Z")

</div>

**anonymous** wrote on [Tuesday, June 19, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/c5c362fb/#ee03):

oh i see now. Indeed that is better way to deal with char callback. I remember  
key event having some problems with key releases, dont know if it was due to  
something else in my project. Gotta change the key input to keyevent then 😛
