Skip to content

Commit 14018b1

Browse files
committed
Add API: SetImeStatus
This is for GLFW3: glfwSetInputMode (mode: GLFW_IME)
1 parent b2c7a1b commit 14018b1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/raylib.h

Lines changed: 1 addition & 0 deletions
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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3571,6 +3571,13 @@ bool IsImeOn(void)
35713571
return false;
35723572
}
35733573

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

0 commit comments

Comments
 (0)