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

Keys don't work under Wayland, key bindings aren't consistent and keep reverting under X11 #16

Closed
tyisafk opened this issue Jun 9, 2024 · 6 comments · Fixed by #17
Closed
Labels
bug Something isn't working

Comments

@tyisafk
Copy link

tyisafk commented Jun 9, 2024

Build launches under Wayland natively which is preferred, but none of the hotkeys work.

When forcing it to run under X11 using the environment variable GDK_BACKEND=x11, keybindings work but will not save properly. I've also tried editing the yml config file within ~/.local/share/livesplitone but the changes don't work and they keep resetting to a mix of default and what I personally set.

@AlexKnauth AlexKnauth added the bug Something isn't working label Jun 9, 2024
@AlexKnauth
Copy link
Owner

This issue might be related, I'm not sure: LiveSplit/livesplit-core#581

Are you running it as sudo or no?

  • If no, is any of the auto-splitting working? Where I am on Mac it needs sudo to have permission to read the Game's memory, I'm not sure whether it would need the same on your Linux or not.
  • If yes, the /home/<name>/.local/share/livesplitone/config.yml path might be wrong: after opening anything or changing settings while running it as sudo, the config file might be at /root/.local/share/livesplitone/config.yml instead.

If you're sometimes running it as sudo and sometimes running it normally outside that, would that explain the mix of default and what you set?

@tyisafk
Copy link
Author

tyisafk commented Jun 9, 2024

I'm not using autosplitters and I hadn't used sudo, but after trying I can confirm that it was because my user was not in the input group, so I added myself to it as suggested and I can control it now even under wayland.

Although the hotkeys not saving properly still remains. I've attached a video that shows this happening from a brand new config file as if it had been loaded for the first time.

2024-06-09.19-46-42.mp4

@AlexKnauth
Copy link
Owner

Thanks for that video. I was able to reproduce this on Windows, so it's not just a Linux problem.

@AlexKnauth
Copy link
Owner

AlexKnauth commented Jun 10, 2024

In config.rs, there's a function configure_hotkeys which has a comment on it saying

// TODO: Just directly construct the HotkeySystem from the config.

In livesplit-core's hotkey_system.rs, there's another function set_hotkey which has a comment saying

// FIXME: We do not check whether the hotkey is already in use

When configure_hotkeys goes to tell the HotkeySystem to change from the default config to the one you set, it does so ONE key at a time, without clearing the default ones.

It sets the split key to Numpad0, and reset to Numpad7 just fine. But when it goes to set the undo key to Numpad4, there's a conflict between that and the default key binding Numpad4 to "Previous Comparison". Interestingly it still sets that one in the config, even as it signals a "failure" to stop the rest of the keys from being changed from the default, "one at a time".

@AlexKnauth
Copy link
Owner

The latest release should fix the key bindings issue:
https://github.com/AlexKnauth/livesplit-one-druid/releases/latest

@AlexKnauth
Copy link
Owner

AlexKnauth commented Oct 28, 2024

Related livesplit-core issue: LiveSplit/livesplit-core#815

Related LiveSplitOne issue: LiveSplit/LiveSplitOne#987

I see 2 possible solutions. Either fix set_config so that it doesn't do this bad-merging thing, or avoid calling set_config in LiveSplitOne entirely: create the hotkey system with the correct hotkey config from the start.

Note that this livesplit-one-druid issue was resolved the 2nd way: avoid calling set_config and instead construct the hotkey system with the correct hotkey config via HotkeySystem::with_config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants