Skip to content

Commit

Permalink
Add API: SetImeStatus
Browse files Browse the repository at this point in the history
This is for GLFW3: glfwSetInputMode (mode: GLFW_IME)
  • Loading branch information
daipom committed Nov 25, 2022
1 parent b2c7a1b commit 14018b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/raylib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,7 @@ RLAPI void SetPreeditCallback(PreeditCallback callback); // Set a callback
RLAPI void SetPreeditWindowPosition(int x, int y); // Set a preedit window postion XY
RLAPI void GetPreeditWindowPosition(int *x, int *y); // Get a preedit window postion XY
RLAPI bool IsImeOn(void); // Check if IME is ON
RLAPI void SetImeStatus(bool on); // Set IME status

// Input-related functions: gamepads
RLAPI bool IsGamepadAvailable(int gamepad); // Check if a gamepad is available
Expand Down
7 changes: 7 additions & 0 deletions src/rcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -3571,6 +3571,13 @@ bool IsImeOn(void)
return false;
}

// Set IME status
void SetImeStatus(bool on)
{
if (on) glfwSetInputMode(CORE.Window.handle, GLFW_IME, GLFW_TRUE);
else glfwSetInputMode(CORE.Window.handle, GLFW_IME, GLFW_FALSE);
}

// Set a custom key to exit program
// NOTE: default exitKey is ESCAPE
void SetExitKey(int key)
Expand Down

0 comments on commit 14018b1

Please sign in to comment.