Skip to content

Commit 90175cb

Browse files
committed
Add API: SetImeStatus
This is for GLFW3: glfwSetInputMode (mode: GLFW_IME)
1 parent 9acdded commit 90175cb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/raylib.h

+1
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,7 @@ RLAPI void SetPreeditCallback(PreeditCallback callback); // Set a callback
11131113
RLAPI void SetPreeditCursorRectangle(int x, int y, int w, int h); // Set the preedit cursor area that is used to decide the position of the candidate window
11141114
RLAPI void GetPreeditCursorRectangle(int *x, int *y, int *w, int *h); // Get the preedit cursor area
11151115
RLAPI bool IsImeOn(void); // Check if IME is ON
1116+
RLAPI void SetImeStatus(bool on); // Set IME status
11161117

11171118
// Input-related functions: gamepads
11181119
RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available

src/rcore.c

+7
Original file line numberDiff line numberDiff line change
@@ -3574,6 +3574,13 @@ bool IsImeOn(void)
35743574
return false;
35753575
}
35763576

3577+
// Set IME status
3578+
void SetImeStatus(bool on)
3579+
{
3580+
if (on) glfwSetInputMode(CORE.Window.handle, GLFW_IME, GLFW_TRUE);
3581+
else glfwSetInputMode(CORE.Window.handle, GLFW_IME, GLFW_FALSE);
3582+
}
3583+
35773584
// Set a custom key to exit program
35783585
// NOTE: default exitKey is ESCAPE
35793586
void SetExitKey(int key)

0 commit comments

Comments
 (0)