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

Add IME support #991

Merged
merged 1 commit into from
Oct 15, 2022
Merged

Add IME support #991

merged 1 commit into from
Oct 15, 2022

Conversation

Guldoman
Copy link
Member

This PR extends the work done in #767 and uses the new SDL_TEXTEDITING_EXT event available from SDL version 2.0.22.
On linux this depends on libsdl-org/SDL#5617.

Video.del.17-05-2022.21.32.31.mp4

@jgmdev
Copy link
Member

jgmdev commented Oct 15, 2022

This PR has gotten a long time to cook on, tested on MacOSX (by my self), Windows (with some defects do to SDL implementation as reported by Guldo on discord) and Linux on desktop environments that support it. Lets merge it so users that have a real need for this can test it and in return we get back some real feedback. we can always do new point base releases to fix stuff that may come up and not catch by us.

@jgmdev jgmdev merged commit 5c2c957 into lite-xl:master Oct 15, 2022
@jmiskovic
Copy link

I wanted to test this but I cannot trigger the IME entry. Original PR mentioned "ctrl+shif+u" and "ctrl+." and it didn't work on XFCE Linux. Where are these shortcuts specified? Do I need something additional installed?

@Guldoman
Copy link
Member Author

Original PR mentioned "ctrl+shif+u" and "ctrl+." and it didn't work on XFCE Linux. Where are these shortcuts specified? Do I need something additional installed?

Those shortcuts are likely implemented by IBus, so you might need to install it if you want to test those.
(AFAIK GTK applications have a fallback in case IBus is missing, so those shortcuts may work in GTK apps.)

IMEs are usually more for entering text in languages that need composition (like Japanese), so you'd need to install an Input Method Framework (like fcitx5, IBus or SCIM), then an actual IME compatible with that framework. See the Arch Linux wiki article.

You might also need to install fonts compatible with said language, for example NotoSansJP, and add it to a fontgroup in Lite XL to be able to actually see what you're writing.

local code_font = renderer.font.load(DATADIR .. "/fonts/JetBrainsMono-Regular.ttf", 15 * SCALE)
local jp_font = renderer.font.load(USERDIR .. "/fonts/NotoSansJP-Regular.otf", 15 * SCALE)
style.code_font = renderer.font.group({code_font, jp_font})

Let me know if you need more precise instructions.

takase1121 pushed a commit to takase1121/lite-xl that referenced this pull request Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants