ime: add move_{up,down} actions

This commit is contained in:
Simon Ser 2022-09-13 09:40:00 +02:00 committed by Joshie
parent 343e286308
commit 3303289afa
2 changed files with 7 additions and 3 deletions

View file

@ -45,7 +45,7 @@
it. it.
</description> </description>
<interface name="gamescope_input_method_manager" version="1"> <interface name="gamescope_input_method_manager" version="2">
<description summary="input method manager"> <description summary="input method manager">
The input method manager allows the client to become the input method on The input method manager allows the client to become the input method on
a chosen seat. a chosen seat.
@ -72,7 +72,7 @@
</request> </request>
</interface> </interface>
<interface name="gamescope_input_method" version="1"> <interface name="gamescope_input_method" version="2">
<description summary="input method"> <description summary="input method">
An input method object allows for clients to compose text. An input method object allows for clients to compose text.
@ -162,6 +162,8 @@
<entry name="delete_right" value="3" summary="delete one unit after the cursor"/> <entry name="delete_right" value="3" summary="delete one unit after the cursor"/>
<entry name="move_left" value="4" summary="move the cursor to the left by one unit"/> <entry name="move_left" value="4" summary="move the cursor to the left by one unit"/>
<entry name="move_right" value="5" summary="move the cursor to the right by one unit"/> <entry name="move_right" value="5" summary="move the cursor to the right by one unit"/>
<entry name="move_up" value="6" since="2" summary="move the cursor up by one unit"/>
<entry name="move_down" value="7" since="2" summary="move the cursor down by one unit"/>
</enum> </enum>
<request name="set_action"> <request name="set_action">

View file

@ -66,7 +66,7 @@ static uint32_t utf8_decode(const char **str_ptr)
return ret; return ret;
} }
#define IME_MANAGER_VERSION 1 #define IME_MANAGER_VERSION 2
/* Some clients assume keycodes are coming from evdev and interpret them. Only /* Some clients assume keycodes are coming from evdev and interpret them. Only
* use keys that would normally produce characters for our emulated events. */ * use keys that would normally produce characters for our emulated events. */
@ -90,6 +90,8 @@ static std::unordered_map<enum gamescope_input_method_action, struct wlserver_in
{ GAMESCOPE_INPUT_METHOD_ACTION_DELETE_RIGHT, { KEY_DELETE, XKB_KEY_Delete } }, { GAMESCOPE_INPUT_METHOD_ACTION_DELETE_RIGHT, { KEY_DELETE, XKB_KEY_Delete } },
{ GAMESCOPE_INPUT_METHOD_ACTION_MOVE_LEFT, { KEY_LEFT, XKB_KEY_Left } }, { GAMESCOPE_INPUT_METHOD_ACTION_MOVE_LEFT, { KEY_LEFT, XKB_KEY_Left } },
{ GAMESCOPE_INPUT_METHOD_ACTION_MOVE_RIGHT, { KEY_RIGHT, XKB_KEY_Right } }, { GAMESCOPE_INPUT_METHOD_ACTION_MOVE_RIGHT, { KEY_RIGHT, XKB_KEY_Right } },
{ GAMESCOPE_INPUT_METHOD_ACTION_MOVE_UP, { KEY_UP, XKB_KEY_Up } },
{ GAMESCOPE_INPUT_METHOD_ACTION_MOVE_DOWN, { KEY_DOWN, XKB_KEY_Down } },
}; };
struct wlserver_input_method { struct wlserver_input_method {