Skip to content

Commit a8a2c2f

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

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 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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3577,6 +3577,13 @@ bool IsImeOn(void)
35773577
return false;
35783578
}
35793579

3580+
// Set IME status
3581+
void SetImeStatus(bool on)
3582+
{
3583+
if (on) glfwSetInputMode(CORE.Window.handle, GLFW_IME, GLFW_TRUE);
3584+
else glfwSetInputMode(CORE.Window.handle, GLFW_IME, GLFW_FALSE);
3585+
}
3586+
35803587
// Set a custom key to exit program
35813588
// NOTE: default exitKey is ESCAPE
35823589
void SetExitKey(int key)

0 commit comments

Comments
 (0)