Skip to content

Fix keymap not correctly loading for the Ei backend#2158

Merged
p12tic merged 2 commits intoinput-leap:masterfrom
BMagnu:fix_ei_keymap
Jan 21, 2025
Merged

Fix keymap not correctly loading for the Ei backend#2158
p12tic merged 2 commits intoinput-leap:masterfrom
BMagnu:fix_ei_keymap

Conversation

@BMagnu
Copy link
Copy Markdown
Contributor

@BMagnu BMagnu commented Jan 20, 2025

On some systems, the keymap file provided by Ei required to create the XKB context is not properly seeked to the start.
This will cause reading the file to fail (or, more accurately, just cause 0 bytes to be read), causing the keymap to just default to a US-keymap.
This PR fixes this, causing the correct keymap to be loaded.

Contributor Checklist:

  • This change affects end users and I have created a file in the doc/newsfragments directory (and made sure to read the README.md in that directory)
  • This change does not affect end users

@sithlord48
Copy link
Copy Markdown
Contributor

sithlord48 commented Jan 20, 2025

Would this apply to deskflow also ? If so would you be would to make a patch.

I have changed my layout to "fr" when i type locally i am getting the french keys but when i run the app it still sees English as the layout, and the client will print the "en" layout keys. What method are you using to change the layout ? (this is with deskflow but the code here is basically the same )

@BMagnu
Copy link
Copy Markdown
Contributor Author

BMagnu commented Jan 21, 2025

Yes, it appears that deskflow needs the same patch. I will create that momentarily.
As for me, I simply have just one non-QWERTY keyboard layout set on my system.
But since the keymap file was not seeked, the read got 0 bytes, causing the LOG_NOTE("Failed to create XKB context: %s", strerror(errno)); to fire, which also left the keymap state uninitialized which ends up defaulting to US keymaps.
To see if this applies to you as well, you can probably check the log and see if you also run into the failure to create the XKB context.

@p12tic p12tic merged commit 4d49be0 into input-leap:master Jan 21, 2025
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

Successfully merging this pull request may close these issues.

3 participants