diff options
| author | Po Lu | 2022-03-12 13:02:28 +0800 |
|---|---|---|
| committer | Po Lu | 2022-03-12 13:03:00 +0800 |
| commit | b5ac604b15532db0418f3c2393907daa317f2ca5 (patch) | |
| tree | cee249b5772266d24f41b82ab717234a45b8e5f0 /src | |
| parent | d0ff20f2e64d9247a5e0e26ddfd7e185e51d8c58 (diff) | |
| download | emacs-b5ac604b15532db0418f3c2393907daa317f2ca5.tar.gz emacs-b5ac604b15532db0418f3c2393907daa317f2ca5.zip | |
Fix some issues with input methods that depend on button state
* src/xterm.c (handle_one_xevent): Translate button state before
filtering events.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c index cf79135497c..d8311828116 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -12771,6 +12771,19 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 12771 | xkey.time = xev->time; | 12771 | xkey.time = xev->time; |
| 12772 | xkey.state = ((xev->mods.effective & ~(1 << 13 | 1 << 14)) | 12772 | xkey.state = ((xev->mods.effective & ~(1 << 13 | 1 << 14)) |
| 12773 | | (xev->group.effective << 13)); | 12773 | | (xev->group.effective << 13)); |
| 12774 | |||
| 12775 | /* Some input methods react differently depending on the | ||
| 12776 | buttons that are pressed. */ | ||
| 12777 | if (xev->buttons.mask_len) | ||
| 12778 | { | ||
| 12779 | if (XIMaskIsSet (xev->buttons.mask, 1)) | ||
| 12780 | xkey.state |= Button1Mask; | ||
| 12781 | if (XIMaskIsSet (xev->buttons.mask, 2)) | ||
| 12782 | xkey.state |= Button2Mask; | ||
| 12783 | if (XIMaskIsSet (xev->buttons.mask, 3)) | ||
| 12784 | xkey.state |= Button3Mask; | ||
| 12785 | } | ||
| 12786 | |||
| 12774 | xkey.keycode = xev->detail; | 12787 | xkey.keycode = xev->detail; |
| 12775 | xkey.same_screen = True; | 12788 | xkey.same_screen = True; |
| 12776 | 12789 | ||
| @@ -13126,6 +13139,19 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 13126 | xkey.time = xev->time; | 13139 | xkey.time = xev->time; |
| 13127 | xkey.state = ((xev->mods.effective & ~(1 << 13 | 1 << 14)) | 13140 | xkey.state = ((xev->mods.effective & ~(1 << 13 | 1 << 14)) |
| 13128 | | (xev->group.effective << 13)); | 13141 | | (xev->group.effective << 13)); |
| 13142 | |||
| 13143 | /* Some input methods react differently depending on the | ||
| 13144 | buttons that are pressed. */ | ||
| 13145 | if (xev->buttons.mask_len) | ||
| 13146 | { | ||
| 13147 | if (XIMaskIsSet (xev->buttons.mask, 1)) | ||
| 13148 | xkey.state |= Button1Mask; | ||
| 13149 | if (XIMaskIsSet (xev->buttons.mask, 2)) | ||
| 13150 | xkey.state |= Button2Mask; | ||
| 13151 | if (XIMaskIsSet (xev->buttons.mask, 3)) | ||
| 13152 | xkey.state |= Button3Mask; | ||
| 13153 | } | ||
| 13154 | |||
| 13129 | xkey.keycode = xev->detail; | 13155 | xkey.keycode = xev->detail; |
| 13130 | xkey.same_screen = True; | 13156 | xkey.same_screen = True; |
| 13131 | 13157 | ||