mirror of
https://github.com/glfw/glfw.git
synced 2025-06-14 19:52:14 +00:00
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
This commit is contained in:
parent
7e4de68614
commit
cacb1e8222
@ -290,14 +290,16 @@ glfwGetPreeditCursorPos(window, &x, &y, &h);
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
Sometimes IME task is interrupted by user or application. There are several functions
|
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)
|
to support these situation.
|
||||||
by using the following functions:
|
|
||||||
|
You can receive notification about IME status change(on/off) by using the following
|
||||||
|
function:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
glfwSetIMEStatusCallback(window, imestatus_callback);
|
glfwSetIMEStatusCallback(window, imestatus_callback);
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
imestatus_callback has simple signature like this:
|
The callback has a simple signature like this:
|
||||||
|
|
||||||
@code
|
@code
|
||||||
void imestatus_callback(GLFWwindow* window)
|
void imestatus_callback(GLFWwindow* window)
|
||||||
@ -305,16 +307,26 @@ void imestatus_callback(GLFWwindow* window)
|
|||||||
}
|
}
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
You can implement the code that resets or commits the preedit text when IME status
|
@anchor GLFW_IME
|
||||||
is changed and the preedit text is not empty.
|
You can get the current IME status by the following function:
|
||||||
|
|
||||||
When the focus is gone from a text box, you can use the following functions to reset
|
|
||||||
IME status:
|
|
||||||
|
|
||||||
@code
|
@code
|
||||||
void glfwResetPreeditText(GLFWwindow* window);
|
glfwGetInputMode(window, GLFW_IME);
|
||||||
void glfwSetIMEStatus(GLFWwindow* window, int active);
|
@endcode
|
||||||
int glfwGetIMEStatus(GLFWwindow* window);
|
|
||||||
|
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
|
@endcode
|
||||||
|
|
||||||
@subsection input_key_name Key names
|
@subsection input_key_name Key names
|
||||||
|
Loading…
Reference in New Issue
Block a user