1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-27 04:28:52 -05:00

Allowed characters regardless of modifier keys.

This commit is contained in:
Camilla Berglund 2013-08-19 13:08:35 +02:00
parent 951f02acf3
commit 9c20737b60
4 changed files with 5 additions and 9 deletions

View File

@ -204,6 +204,7 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/).
## Changelog ## Changelog
- Allowed character callback to be triggered regardless of modifier keys
- Bugfix: The `-Wall` flag was not used with Clang and other GCC compatibles - Bugfix: The `-Wall` flag was not used with Clang and other GCC compatibles
- Bugfix: The default for `GLFW_ALPHA_BITS` was set to zero - Bugfix: The default for `GLFW_ALPHA_BITS` was set to zero
- [Win32] Added `_GLFW_USE_DWM_SWAP_INTERVAL` for forcing the swap interval - [Win32] Added `_GLFW_USE_DWM_SWAP_INTERVAL` for forcing the swap interval

View File

@ -566,9 +566,6 @@ static int translateKey(unsigned int key)
const int mods = translateFlags([event modifierFlags]); const int mods = translateFlags([event modifierFlags]);
_glfwInputKey(window, key, [event keyCode], GLFW_PRESS, mods); _glfwInputKey(window, key, [event keyCode], GLFW_PRESS, mods);
if (mods & GLFW_MOD_SUPER)
return;
NSString* characters = [event characters]; NSString* characters = [event characters];
NSUInteger i, length = [characters length]; NSUInteger i, length = [characters length];

View File

@ -480,6 +480,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
} }
case WM_CHAR: case WM_CHAR:
case WM_SYSCHAR:
{ {
_glfwInputChar(window, (unsigned int) wParam); _glfwInputChar(window, (unsigned int) wParam);
return 0; return 0;

View File

@ -513,15 +513,12 @@ static void processEvent(XEvent *event)
{ {
const int key = translateKey(event->xkey.keycode); const int key = translateKey(event->xkey.keycode);
const int mods = translateState(event->xkey.state); const int mods = translateState(event->xkey.state);
const int character = translateChar(&event->xkey);
_glfwInputKey(window, key, event->xkey.keycode, GLFW_PRESS, mods); _glfwInputKey(window, key, event->xkey.keycode, GLFW_PRESS, mods);
if (!(mods & GLFW_MOD_CONTROL) && !(mods & GLFW_MOD_ALT))
{
const int character = translateChar(&event->xkey);
if (character != -1) if (character != -1)
_glfwInputChar(window, character); _glfwInputChar(window, character);
}
break; break;
} }