Skip to content

Commit 5a576c7

Browse files
committed
Add API: SetImeStatus
This is for GLFW3: glfwSetInputMode (mode: GLFW_IME)
1 parent 578276a commit 5a576c7

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 SetPreeditWindowPosition(int x, int y); // Set a preedit window postion XY
11141114
RLAPI void GetPreeditWindowPosition(int *x, int *y); // Get a preedit window postion XY
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
@@ -3573,6 +3573,13 @@ bool IsImeOn(void)
35733573
return false;
35743574
}
35753575

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

0 commit comments

Comments
 (0)