glfwSetCharCallback problem

anonymous wrote on Thursday, March 08, 2012:

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.

elmindreda wrote on Thursday, March 08, 2012:

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.

anonymous wrote on Thursday, March 08, 2012:

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.

elmindreda wrote on Friday, March 09, 2012:

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

anonymous wrote on Sunday, March 11, 2012:

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

elmindreda wrote on Sunday, March 11, 2012:

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

elmindreda wrote on Sunday, March 11, 2012:

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

anonymous wrote on Wednesday, March 14, 2012:

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