mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 14:45:46 +00:00
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:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user