Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent fault - key not recognised #389

Open
berwynhoyt opened this issue Dec 5, 2023 · 5 comments
Open

Intermittent fault - key not recognised #389

berwynhoyt opened this issue Dec 5, 2023 · 5 comments

Comments

@berwynhoyt
Copy link
Contributor

This is an intermittent fault and seems to change between working and not working based on restarting xremap. Half* the time it works after restarting xremap; the other half* it doesn't.

(When I say "half the time" I mean that it gets into good states and bad states of minutes each. It always seems to take a restart to correct the problem, but there long periods where multiple restarts leave it in the same state (whether broken or correct), then suddenly the state will change to the other: I know not why.)

Below I show an example of it not working.

I have an app-specific key definition as follows:

  - name: Make Zoho Mail keys more compatible with Gmail
    application:
      only: zoho mail - desktop
    remap:
      C-w: C-Backslash  # close tab
      C-Shift-8: C-dot  # bullets
      C-Shift-7: C-slash  # numbering
      C-q: Alt-F4  # Quit app
      C-rightbrace: C-m
      C-leftbrace: C-Shift-m

The output of RUST_LOG=debug shows that it recognises the app just fine, but it doesn't do anything with the key sequence:

[2023-12-05T00:04:55Z DEBUG xremap::event_handler] => 1: KEY_LEFTCTRL
[2023-12-05T00:04:55Z DEBUG xremap::action_dispatcher] 1: KEY_LEFTCTRL
[2023-12-05T00:04:55Z DEBUG xremap::event_handler] => 1: KEY_LEFTSHIFT
[2023-12-05T00:04:55Z DEBUG xremap::action_dispatcher] 1: KEY_LEFTSHIFT
[2023-12-05T00:04:55Z DEBUG xremap::event_handler] => 1: KEY_8
application: zoho mail - desktop.Zoho Mail - Desktop
[2023-12-05T00:04:55Z DEBUG xremap::action_dispatcher] 1: KEY_8
[2023-12-05T00:04:55Z DEBUG xremap::event_handler] => 0: KEY_8
[2023-12-05T00:04:55Z DEBUG xremap::action_dispatcher] 0: KEY_8
[2023-12-05T00:04:55Z DEBUG xremap::event_handler] => 0: KEY_LEFTSHIFT
[2023-12-05T00:04:55Z DEBUG xremap::action_dispatcher] 0: KEY_LEFTSHIFT
[2023-12-05T00:04:55Z DEBUG xremap::event_handler] => 0: KEY_LEFTCTRL
[2023-12-05T00:04:55Z DEBUG xremap::action_dispatcher] 0: KEY_LEFTCTRL

So it recognises the app just fine, but some restarts (like the above) it doesn't match the key sequence.

All other app-specific key sequences defined in the same file (attached) work all the time.
wordstar.yml.zip

@k0kubun
Copy link
Contributor

k0kubun commented Dec 5, 2023

Is there any difference in RUST_LOG=debug output between the working state and the non-working state? Is the printed application name zoho mail - desktop.Zoho Mail - Desktop in both cases?

The logic to match the application name is, when you don't have . in your application filter:

  • When the current application name contains .: Use the name after .
  • When the current application name does not contain .: Use the whole application name

So in this case, only: Zoho Mail - Desktop (or only: zoho mail - desktop.Zoho Mail - Desktop) would work, but only: zoho mail - desktop wouldn't. That's what I would try fixing first.

@berwynhoyt
Copy link
Contributor Author

  1. Yes, the log I gave you is the non-working state. The working version is as follows:
[2023-12-05T22:13:23Z DEBUG xremap::event_handler] => 1: KEY_LEFTCTRL
[2023-12-05T22:13:23Z DEBUG xremap::action_dispatcher] 1: KEY_LEFTCTRL
[2023-12-05T22:13:23Z DEBUG xremap::event_handler] => 1: KEY_LEFTSHIFT
[2023-12-05T22:13:23Z DEBUG xremap::action_dispatcher] 1: KEY_LEFTSHIFT
[2023-12-05T22:13:23Z DEBUG xremap::event_handler] => 1: KEY_8
application: zoho mail - desktop.Zoho Mail - Desktop
[2023-12-05T22:13:23Z DEBUG xremap::action_dispatcher] 0: KEY_LEFTSHIFT
[2023-12-05T22:13:23Z DEBUG xremap::action_dispatcher] 1: KEY_DOT
[2023-12-05T22:13:23Z DEBUG xremap::action_dispatcher] 0: KEY_DOT
[2023-12-05T22:13:23Z DEBUG xremap::action_dispatcher] 1: KEY_LEFTSHIFT
[2023-12-05T22:13:23Z DEBUG xremap::event_handler] => 0: KEY_8
[2023-12-05T22:13:23Z DEBUG xremap::action_dispatcher] 0: KEY_8
[2023-12-05T22:13:23Z DEBUG xremap::event_handler] => 0: KEY_LEFTSHIFT
[2023-12-05T22:13:23Z DEBUG xremap::action_dispatcher] 0: KEY_LEFTSHIFT
[2023-12-05T22:13:23Z DEBUG xremap::event_handler] => 0: KEY_LEFTCTRL
[2023-12-05T22:13:23Z DEBUG xremap::action_dispatcher] 0: KEY_LEFTCTRL
  1. Actually, "Zoho Mail - Desktop" is my default. The lower case version was just something I tried -- and hadn't changed back when I pasted into the report above. Yes, the problem happens with "Zoho Mail - Desktop".

@k0kubun
Copy link
Contributor

k0kubun commented Dec 6, 2023

That's interesting. Can you build https://github.com/k0kubun/xremap/tree/debug-application, run it with RUST_LOG=debug, and report the output in both cases?

@berwynhoyt
Copy link
Contributor Author

berwynhoyt commented Dec 6, 2023 via email

@berwynhoyt
Copy link
Contributor Author

For some reason I can no longer reproduce the problem (either with my original xremap 0.7.10 or with your debug-application branch 0.8.12). So I have set up your debug xremap 0.8.12 to run in my systemd with RUST_LOG=debug so that when it does recur I'll have a log of it. Until then, this issue can hibernate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants