p-e-w / shin

A shell in every text input on your system
GNU General Public License v3.0
277 stars 12 forks source link

Meta key (ctrl, alt) stays active after using shin #14

Open dgsiegel opened 8 months ago

dgsiegel commented 8 months ago

I have set ibus engine shin to the keyboard shortcut Ctrl+Space (and also tried with Alt+Space). After executing a command in shin by pressing Enter, it seems like the Ctrl stays stuck and I have to press Ctrl+c to exit this mode and return to normal input. At this point I'm not sure whether this is a shin or ibus problem, as this only started recently.

Some details:

$ lsb_release -a
LSB Version:    n/a
Distributor ID: Fedora
Description:    Fedora Linux 39 (Workstation Edition)
Release:    39
Codename:   n/a

$ gnome-shell --version 2>/dev/null
GNOME Shell 45.3

Update: Setting the keyboard shortcut to Super+Space works just fine.

tmke8 commented 5 months ago

I have observed the same problem. I set the shortcut to Super+x (on GNOME), but it seems that because shin consumes the release event of the Super key, the normal ibus engine thinks it got never released and is still pressed.

I solved it by creating a bash script with:

#!/bin/bash

sleep 1
ibus engine shin

and then using this as the target of the shortcut. This ensures that the release event is processed correctly before shin starts.

A proper fix for this would maybe replay all release events just before shin exits?

tmke8 commented 5 months ago

I have opened PR #15 to solve this. If you can, it would be good if you could try it out @dgsiegel .

dgsiegel commented 5 months ago

I have opened PR #15 to solve this. If you can, it would be good if you could try it out @dgsiegel .

Seems to work fine here as well, thanks!