RedBearAK / toshy

Keymapper config to make Linux work like a 'Tosh!
https://toshy.app
GNU General Public License v3.0
226 stars 15 forks source link

[BUG] CMD + Click not working/consistent #277

Open ckive opened 2 months ago

ckive commented 2 months ago
Bare metal.
Linux distro name: pop
Distro version: 22.04
Distro variant: notfound
X11/Xorg or Wayland: x11
Desktop environment(s): gnome
DE version(s): 42

Keyboard type (IBM, Chromebook, Windows, Apple): Windows (Lenovo Legion)
Keyboard device name (try 'toshy-devices'): ITE Tech. Inc. ITE Device(8910) Keyboard

Problem observed:

Cmd (alt) click does not work for example opening a link in new tab. A pattern I found is that I have to hold the alt key for a bit, then move the cursor a bit (not too fast) and then clicking gets me the desired command click open in new tab type of response.

(log stuff below)


dany@legion:~$ toshy-services-log Showing systemd journal messages for Toshy services (since last boot): May 02 12:14:40 legion systemd[2117]: Starting Toshy KDE D-Bus Service... May 02 12:14:44 legion systemd[2117]: toshy-kde-dbus.service: Control process exited, code=exited, status=1/FAILURE May 02 12:14:44 legion systemd[2117]: toshy-kde-dbus.service: Failed with result 'exit-code'. May 02 12:14:44 legion systemd[2117]: Failed to start Toshy KDE D-Bus Service. May 02 12:14:44 legion systemd[2117]: Starting Toshy Config Service... May 02 12:14:44 legion systemd[2117]: Started Toshy Session Monitor. May 02 12:14:44 legion systemd[2117]: Started Toshy Config Service. May 02 12:14:47 legion gnome-shell[3022]: Failed to set RT scheduler: Operation not permitted May 02 12:14:49 legion systemd[2117]: toshy-kde-dbus.service: Scheduled restart job, restart counter is at 1. May 02 12:14:49 legion systemd[2117]: Stopped Toshy KDE D-Bus Service. May 02 12:14:49 legion systemd[2117]: Starting Toshy KDE D-Bus Service... May 02 12:14:49 legion systemd[2117]: Started Toshy KDE D-Bus Service. May 02 12:14:50 legion gnome-shell[3040]: Failed to set RT scheduler: Operation not permitted May 02 12:14:50 legion gnome-shell[3041]: Failed to set RT scheduler: Operation not permitted dany@legion:~$ toshy-services-status Current status of Toshy systemd services... -------------------------------------------------------------------------------- ○ toshy-kde-dbus.service - Toshy KDE D-Bus Service Loaded: loaded (/home/dany/.config/systemd/user/toshy-kde-dbus.service; enabled; vendor preset: enabled) Active: inactive (dead) since Thu 2024-05-02 12:14:52 CDT; 1 day 1h ago Process: 3031 ExecStartPre=/bin/bash -c if [ -z "$XDG_SESSION_TYPE" ]; then sleep 3; exit 1; fi (code=exited, status=0/SUCCESS) Process: 3032 ExecStart=/bin/bash -c env TERM=xterm $HOME/.config/toshy/scripts/bin/toshy-kde-dbus-service.sh (code=exited, status=0/SUCCESS) Main PID: 3032 (code=exited, status=0/SUCCESS) CPU: 201ms May 02 12:14:49 legion systemd[2117]: Starting Toshy KDE D-Bus Service... May 02 12:14:49 legion systemd[2117]: Started Toshy KDE D-Bus Service. May 02 12:14:50 legion gnome-shell[3040]: Failed to set RT scheduler: …ted May 02 12:14:50 legion gnome-shell[3041]: Failed to set RT scheduler: …ted Hint: Some lines were ellipsized, use -l to show in full. -------------------------------------------------------------------------------- ● toshy-session-monitor.service - Toshy Session Monitor Loaded: loaded (/home/dany/.config/systemd/user/toshy-session-monitor.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2024-05-02 12:14:44 CDT; 1 day 1h ago Main PID: 2574 (bash) Tasks: 2 (limit: 17452) Memory: 2.4M CPU: 2min 40.653s CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/toshy-session-monitor.service ├─ 2574 bash /home/dany/.config/toshy/scripts/toshy-service… └─132793 sleep 2 May 02 12:14:44 legion systemd[2117]: Started Toshy Session Monitor. -------------------------------------------------------------------------------- ● toshy-config.service - Toshy Config Service Loaded: loaded (/home/dany/.config/systemd/user/toshy-config.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2024-05-02 12:14:44 CDT; 1 day 1h ago Process: 2573 ExecStartPre=/bin/bash -c env TERM=xterm $HOME/.config/toshy/scripts/toshy-service-config-execstartpre.sh (code=exited, status=0/SUCCESS) Main PID: 2577 (bash) Tasks: 5 (limit: 17452) Memory: 25.1M CPU: 1min 29.416s CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/toshy-config.service ├─2577 bash /home/dany/.config/toshy/scripts/toshy-service-c… └─2975 /home/dany/.config/toshy/.venv/bin/python /home/dany/… May 02 12:14:44 legion systemd[2117]: Starting Toshy Config Service... May 02 12:14:44 legion systemd[2117]: Started Toshy Config Service. May 02 12:14:47 legion gnome-shell[3022]: Failed to set RT scheduler: …ted Hint: Some lines were ellipsized, use -l to show in full. -------------------------------------------------------------------------------- Use 'toshy-services-disable' to disable Toshy services autostart at login. Use 'toshy-services-enable' to (re)enable Toshy services autostart at login. Use 'toshy-systemd-remove' to uninstall/remove Toshy services. Use 'toshy-systemd-setup' to install/reinstall Toshy services. dany@legion:~$ toshy-config-verbose-start Stopping Toshy systemd services... Toshy systemd services stopped. non-network local connections being added to access control list keyszer v0.7.1 (DD) CONFIG: /home/dany/.config/toshy/toshy_config.py (DD) THROTTLES: Pre-key: 12ms, Post-key: 18ms (DD) No Synergy log folder found. No log observer will be engaged. (CG) Current settings: ------------------------------------------- calling_module = 'toshy_config.py' db_file_path = '/home/dany/.config/toshy/toshy_user_preferences.sqlite' ------------------------------------------- gui_dark_theme = True ------------------------------------------- override_kbtype = 'Auto-Adapt' ------------------------------------------- optspec_layout = 'US' ------------------------------------------- forced_numpad = True media_arrows_fix = False multi_lang = False Caps2Cmd = False Caps2Esc_Cmd = False Enter2Ent_Cmd = False ST3_in_VSCode = False ------------------------------------------- ** (process:10179): WARNING **: 13:38:31.411: Failed to set RT scheduler: Operation not permitted (CG) Toshy config sees this environment: DISTRO_NAME = 'pop' DISTRO_VER = '22.04' SESSION_TYPE = 'x11' DESKTOP_ENV = 'gnome' DE_MAJ_VER = '42' (DD) ENVIRON: Session type: 'x11', Desktop env: 'None' (DD) Zenity command path: '/usr/bin/zenity' (--) WATCH: Watching for new devices to hot-plug. (--) Autodetecting all keyboards (--device not specified) (+K) Grabbing 'ITE Tech. Inc. ITE Device(8910) Keyboard' (/dev/input/event6) (+K) Successfully grabbed 'ITE Tech. Inc. ITE Device(8910) Keyboard' (/dev/input/event6) (+K) Grabbing 'AT Translated Set 2 keyboard' (/dev/input/event2) (+K) Successfully grabbed 'AT Translated Set 2 keyboard' (/dev/input/event2) (--) Ready to process input. (II) in LEFT_ALT (press) (DD) KBTYPE: 'Windows' | Default type for dev: 'ITE Tech. Inc. ITE Device(8910) Keyboard' (DD) MODMAP: LEFT_ALT => RIGHT_CTRL [Cond modmap - GUI - Win kbd] (DD) on_key RIGHT_CTRL press (DD) suspending keys: [RCtrl] (II) in TAB (press) (DD) on_key TAB press (DD) KBTYPE: 'Windows' | (CACHED) Default type for dev: 'ITE Tech. Inc. ITE Device(8910) Keyboard' (DD) WM_CLASS: 'Google-chrome' | WM_NAME: 'New Issue · RedBearAK/toshy - Google Chrome' (DD) DEVICE: 'ITE Tech. Inc. ITE Device(8910) Keyboard' | CAPS_LOCK: 'False' | NUM_LOCK: 'False' (DD) ACTIVE KEYMAPS: 'OptSpecialChars - US', 'User hardware keys', 'Chrome Browsers Overrides', 'General Web Browsers', 'Wordwise - not vscode', 'Cmd+Dot not in … terminals', 'GenGUI overrides: not Chromebook', 'GenGUI overrides: … Pop!_OS', 'GenGUI overrides: pre-GNOME 45 fix', 'GenGUI overrides: GNOME', 'General GUI', 'Diagnostics' (DD) COMBO: RCtrl-TAB => [._is_Enter_F2 at 0x743030318550>, , Alt-TAB] in KMAP: 'General GUI' (DD) spent modifiers [] (DD) resuspending keys (DD) suspending keys: [RCtrl] (DD) _is_Enter_F2: combo_list = [None] (DD) _is_Enter_F2: _enter_is_F2 = True (DD) resuspending keys (DD) suspending keys: [RCtrl] (DD) BIND: {: } (OO) press LEFT_ALT 1714761513.9979122 (OO) press TAB 1714761514.0107017 (OO) release TAB 1714761514.0108118 (II) in TAB (release) (DD) on_key TAB release (II) in LEFT_ALT (release) (DD) on_key RIGHT_CTRL release (DD) lift of BIND RIGHT_CTRL => LEFT_ALT (OO) release LEFT_ALT 1714761514.051761
RedBearAK commented 2 months ago

@ckive

Good job with the thorough report. I was going to point to the FAQ entry about Mod+click issues caused by the "suspend" timeout, and that may still help with this problem, so check it out:

https://github.com/RedBearAK/toshy/wiki/FAQ-(Frequently-Asked-Questions)#modclicking-blocked-by-keymapper-suspend-timeout

Your observation about having to hold the modifier key (Alt, which becomes RIGHT_CTRL and acts as the virtualized "Command" key) is correct. Read the whole FAQ entry and the one after it regarding the issues with certain apps that will occur after reducing the suspend timeout value.

But this thing about the "RT scheduler" is not an error I've ever seen before, even when I was testing on Pop!_OS. Never seen that in dozens of distros when looking at the services log output.

 May 02 12:14:50 legion gnome-shell[3040]: Failed to set RT scheduler: Operation not permitted

I'll have to google that when I have the time. Do you have a custom real-time kernel installed or anything like that?

The bit about having to move the cursor slightly is not something I've ever noticed/observed. Maybe that has something to do with the "RT scheduler", if it's not an illusion. The primary cause of the Mod+click being blocked has always been the suspend timeout causing the app not to "see" the modifier key press at the moment the click happens, unless you hold the key down beyond the length of the suspend timeout (1 second).

It shouldn't make any real difference, but I notice you're using a version of Toshy from before the migration from keyszer to my xwaykeyz fork. If you haven't done any customizations of the config file outside the specially marked editable "slices", it should be safe to download a new zip file and reinstall Toshy, without risk of losing those customizations. But I would wait on that until after you try changing the suspend timeout according to the FAQ.

Let me know how it goes.

SukkaW commented 1 month ago

I am facing the same behavior, and I believe this relates to the suspends.

Edit ~/.config/toshy/toshy_config.py and change the suspends to 0.1 works for me.

zachfeldman commented 4 weeks ago

I had the same problem and @SukkaW 's solution fixed it for me!