Skip to content

Commit

Permalink
engine: Ignore Super modifier key
Browse files Browse the repository at this point in the history
Super-l is a shortcut key to launch a lock screen in GNOME desktop
session and now it can be sent to the engine prior to the window
manager.
  • Loading branch information
fujiwarat committed Mar 12, 2024
1 parent ce18661 commit 9ae92d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions engine/python2/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <[email protected]>
# Copyright (c) 2010-2023 Takao Fujiwara <[email protected]>
# Copyright (c) 2010-2024 Takao Fujiwara <[email protected]>
# Copyright (c) 2007-2018 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -1976,7 +1976,9 @@ def __process_key_event_internal2(self, keyval, keycode, state):
state & hex_mod_mask == hex_mod_mask:
return True

if state & (IBus.ModifierType.CONTROL_MASK | IBus.ModifierType.MOD1_MASK):
if state & (IBus.ModifierType.CONTROL_MASK | \
IBus.ModifierType.MOD1_MASK | \
IBus.ModifierType.MOD4_MASK):
return False

if (IBus.KEY_exclam <= keyval <= IBus.KEY_asciitilde or
Expand Down
6 changes: 4 additions & 2 deletions engine/python3/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <[email protected]>
# Copyright (c) 2010-2023 Takao Fujiwara <[email protected]>
# Copyright (c) 2010-2024 Takao Fujiwara <[email protected]>
# Copyright (c) 2007-2018 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -1971,7 +1971,9 @@ def __process_key_event_internal2(self, keyval, keycode, state):
state & hex_mod_mask == hex_mod_mask:
return True

if state & (IBus.ModifierType.CONTROL_MASK | IBus.ModifierType.MOD1_MASK):
if state & (IBus.ModifierType.CONTROL_MASK | \
IBus.ModifierType.MOD1_MASK | \
IBus.ModifierType.MOD4_MASK):
return False

if (IBus.KEY_exclam <= keyval <= IBus.KEY_asciitilde or
Expand Down

0 comments on commit 9ae92d7

Please sign in to comment.