Fix mouse actions not working when caps lock or num lock are engaged

Fixes #3859
This commit is contained in:
Kovid Goyal 2021-07-24 07:06:46 +05:30
parent b9033d721c
commit e7bfb04047
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 7 additions and 4 deletions

View File

@ -60,6 +60,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Allow leading or trailing spaces in :opt:`tab_activity_symbol`
- Fix mouse actions not working when caps lock or num lock are engaged
(:iss:`3859`)
- macOS: Fix automatic detection of bold/italic faces for fonts that
use the family name as the full face name of the regular font not working
(:iss:`3861`)

View File

@ -6,15 +6,14 @@ from typing import Optional, Union
from .conf.utils import KeyAction
from .fast_data_types import (
GLFW_MOD_ALT, GLFW_MOD_CAPS_LOCK, GLFW_MOD_CONTROL, GLFW_MOD_HYPER,
GLFW_MOD_META, GLFW_MOD_NUM_LOCK, GLFW_MOD_SHIFT, GLFW_MOD_SUPER, KeyEvent
GLFW_MOD_ALT, GLFW_MOD_CONTROL, GLFW_MOD_HYPER, GLFW_MOD_META,
GLFW_MOD_SHIFT, GLFW_MOD_SUPER, KeyEvent
)
from .options.utils import KeyMap, SequenceMap, SubSequenceMap
from .types import SingleKey
from .typing import ScreenType
mod_mask = GLFW_MOD_ALT | GLFW_MOD_CONTROL | GLFW_MOD_SHIFT | GLFW_MOD_SUPER | GLFW_MOD_META | GLFW_MOD_HYPER
lock_mask = GLFW_MOD_NUM_LOCK | GLFW_MOD_CAPS_LOCK
def keyboard_mode_name(screen: ScreenType) -> str:

View File

@ -33,7 +33,7 @@ from .fast_data_types import (
set_titlebar_color, set_window_padding, set_window_render_data,
update_window_title, update_window_visibility, viewport_for_window
)
from .keys import keyboard_mode_name
from .keys import keyboard_mode_name, mod_mask
from .notify import NotificationCommand, handle_notification_cmd
from .options.types import Options
from .rgb import to_color
@ -570,6 +570,7 @@ class Window:
get_boss().child_monitor.set_iutf8_winid(self.id, on)
def on_mouse_event(self, event: Dict[str, Any]) -> bool:
event['mods'] = event.get('mods', 0) & mod_mask
ev = MouseEvent(**event)
self.current_mouse_event_button = ev.button
action = get_options().mousemap.get(ev)