diff --git a/kitty/config_data.py b/kitty/config_data.py index e9cfea8bf..78800d994 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -449,6 +449,8 @@ o('mouse_hide_wait', 3.0, option_type=positive_float, long_text=_(''' Hide mouse cursor after the specified number of seconds of the mouse not being used. Set to zero to disable mouse cursor hiding.''')) +o('mouse_hide_key', True, long_text=_('''TODO''')) + o('focus_follows_mouse', False, long_text=_(''' Set the active window to the window under the mouse when moving the mouse around''')) diff --git a/kitty/keys.c b/kitty/keys.c index 58e0e8781..60017ed5e 100644 --- a/kitty/keys.c +++ b/kitty/keys.c @@ -180,6 +180,7 @@ on_key_input(int key, int scancode, int action, int mods, const char* text, int bool ok_to_send = action == GLFW_PRESS || action == GLFW_REPEAT || screen->modes.mEXTENDED_KEYBOARD; if (ok_to_send) { if (has_text) { + if (OPT(mouse_hide_key)) hide_mouse(global_state.callback_os_window); schedule_write_to_child(w->id, 1, text, strlen(text)); debug("sent text to child\n"); } else { diff --git a/kitty/state.c b/kitty/state.c index 7375e0088..786b0b2da 100644 --- a/kitty/state.c +++ b/kitty/state.c @@ -382,6 +382,7 @@ PYWRAP1(set_options) { S(url_style, PyLong_AsUnsignedLong); S(tab_bar_edge, PyLong_AsLong); S(mouse_hide_wait, PyFloat_AsDouble); + S(mouse_hide_key, PyObject_IsTrue); S(wheel_scroll_multiplier, PyFloat_AsDouble); S(touch_scroll_multiplier, PyFloat_AsDouble); S(open_url_modifiers, convert_mods); diff --git a/kitty/state.h b/kitty/state.h index 182a6ff63..bb3f74395 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -14,7 +14,7 @@ typedef enum { LEFT_EDGE, TOP_EDGE, RIGHT_EDGE, BOTTOM_EDGE } Edge; typedef struct { double visual_bell_duration, cursor_blink_interval, cursor_stop_blinking_after, mouse_hide_wait, click_interval, wheel_scroll_multiplier, touch_scroll_multiplier; - bool enable_audio_bell; + bool mouse_hide_key, enable_audio_bell; CursorShape cursor_shape; unsigned int open_url_modifiers; unsigned int rectangle_select_modifiers;