From cacb1e82224c9d27bc41e7a47cac4c6c3d42bb62 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Mon, 23 May 2022 23:19:52 +0900 Subject: [PATCH] Doc: Improve contents about status API - Remove contents about glfwSet/GetIMEStatus since they don't exist now - Add contents about glfwSet/GetInputMode using GLFW_IME --- docs/input.dox | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/docs/input.dox b/docs/input.dox index 6bfa5e08..e05223b5 100644 --- a/docs/input.dox +++ b/docs/input.dox @@ -290,14 +290,16 @@ glfwGetPreeditCursorPos(window, &x, &y, &h); @endcode Sometimes IME task is interrupted by user or application. There are several functions -to support these situation. You can receive notification about IME status change(on/off) -by using the following functions: +to support these situation. + +You can receive notification about IME status change(on/off) by using the following +function: @code glfwSetIMEStatusCallback(window, imestatus_callback); @endcode -imestatus_callback has simple signature like this: +The callback has a simple signature like this: @code void imestatus_callback(GLFWwindow* window) @@ -305,16 +307,26 @@ void imestatus_callback(GLFWwindow* window) } @endcode -You can implement the code that resets or commits the preedit text when IME status -is changed and the preedit text is not empty. - -When the focus is gone from a text box, you can use the following functions to reset -IME status: +@anchor GLFW_IME +You can get the current IME status by the following function: @code -void glfwResetPreeditText(GLFWwindow* window); -void glfwSetIMEStatus(GLFWwindow* window, int active); -int glfwGetIMEStatus(GLFWwindow* window); +glfwGetInputMode(window, GLFW_IME); +@endcode + +If you get GLFW_TRUE, it means the IME is on, and GLFW_FALSE means the IME is off. + +You can also change the IME status by the following function: + +@code +glfwSetInputMode(window, GLFW_IME, GLFW_TRUE); +glfwSetInputMode(window, GLFW_IME, GLFW_FALSE); +@endcode + +You can use the following function to clear the preedit text. + +@code +glfwResetPreeditText(window); @endcode @subsection input_key_name Key names