Added character with modifiers callback.

The undefined behaviour changed with #40 has been reverted, making the
character-only callback again behave like a system text field.  This
behavior has now been documentated.

Fixes #203.
Fixes #305.
This commit is contained in:
Camilla Berglund
2014-06-12 23:04:20 +02:00
parent 9b6c14b7ae
commit 96b12ee504
9 changed files with 133 additions and 38 deletions
+3 -1
View File
@@ -605,13 +605,15 @@ static int translateKey(unsigned int key)
{
const int key = translateKey([event keyCode]);
const int mods = translateFlags([event modifierFlags]);
_glfwInputKey(window, key, [event keyCode], GLFW_PRESS, mods);
NSString* characters = [event characters];
NSUInteger i, length = [characters length];
const int plain = !(mods & GLFW_MOD_SUPER);
for (i = 0; i < length; i++)
_glfwInputChar(window, [characters characterAtIndex:i]);
_glfwInputChar(window, [characters characterAtIndex:i], mods, plain);
}
- (void)flagsChanged:(NSEvent *)event