summaryrefslogtreecommitdiffhomepage
path: root/examples/text
diff options
context:
space:
mode:
authorRay <[email protected]>2020-12-18 18:58:02 +0100
committerRay <[email protected]>2020-12-18 18:58:02 +0100
commit96542269d0ad8f7be9cfb4f0e9d02df2c45703ff (patch)
treefd64502ec8534fc312f88e04401ac46db7f317af /examples/text
parent893a64712e6702ac14d2001c064b56da0538b1ce (diff)
downloadraylib-96542269d0ad8f7be9cfb4f0e9d02df2c45703ff.tar.gz
raylib-96542269d0ad8f7be9cfb4f0e9d02df2c45703ff.zip
WARNING: GetKeyPressed() <-> GetCharPressed() #1336
Previous GetKeyPressed() method was actually returning unicode codepoints equivalent values instead of the key-code of the pressed key. So, it has been replaced by GetCharPressed(), returning unicode codepoints and GetKeyPressed() now returns key-codes.
Diffstat (limited to 'examples/text')
-rw-r--r--examples/text/text_input_box.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/text/text_input_box.c b/examples/text/text_input_box.c
index 0f35a581..1b35e21d 100644
--- a/examples/text/text_input_box.c
+++ b/examples/text/text_input_box.c
@@ -2,7 +2,7 @@
*
* raylib [text] example - Input Box
*
-* This example has been created using raylib 1.7 (www.raylib.com)
+* This example has been created using raylib 3.5 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2017 Ramon Santamaria (@raysan5)
@@ -46,8 +46,8 @@ int main(void)
// Set the window's cursor to the I-Beam
SetMouseCursor(MOUSE_CURSOR_IBEAM);
- // Get pressed key (character) on the queue
- int key = GetKeyPressed();
+ // Get char pressed (unicode character) on the queue
+ int key = GetCharPressed();
// Check if more characters have been pressed on the same frame
while (key > 0)
@@ -59,7 +59,7 @@ int main(void)
letterCount++;
}
- key = GetKeyPressed(); // Check next character in the queue
+ key = GetCharPressed(); // Check next character in the queue
}
if (IsKeyPressed(KEY_BACKSPACE))