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

text_input can't accept chinese input #1801

Open
2 tasks done
ys928 opened this issue Apr 20, 2023 · 9 comments
Open
2 tasks done

text_input can't accept chinese input #1801

ys928 opened this issue Apr 20, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@ys928
Copy link

ys928 commented Apr 20, 2023

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

the text_input Can display Chinese,but when app run,I can't change to input chinese

config:

[dependencies]
iced ='0.9.0'
iced_lazy= '0.6.0'
iced_native ='0.10.0'

and the main code:

    App::run(
        Settings{
            window:window::Settings{
                size:(800,600),
                ..Default::default()
            },
            default_font:Some(include_bytes!("STXINGKA.TTF")),  //设置中文的.ttf字体
            ..Default::default()
        })


      text_input("请输入",&self.inpur_txt)
          .id(text_input::Id::new("1-input"))
          .on_input(Message::EditInput)
          .on_submit(Message::EditCmt)
          .width(180)
          .size(25)
      ,

What is the expected behavior?

when I Press shift key, I should Switch to Chinese input,but it didn‘t

when I use other app,it's normal, such as vscode

Version

master

Operative System

Windows

Do you have any log output?

No response

@ys928 ys928 added the bug Something isn't working label Apr 20, 2023
@ys928
Copy link
Author

ys928 commented Apr 20, 2023

In fact, the example todos cannot switch the input method to Chinese either in my computer

@jinliming2
Copy link

#1474

@ys928
Copy link
Author

ys928 commented Apr 21, 2023

emm , I hava tested the example : https://github.com/t18b219k/iced_text_input_sample/

yeal,that's work well,but it's version seem too old.

in 0.9.0 version, the text_input can't work well,I don't know how to fix it

@myan9527
Copy link

myan9527 commented Jul 20, 2023

emm , I hava tested the example : https://github.com/t18b219k/iced_text_input_sample/

yeal,that's work well,but it's version seem too old.

in 0.9.0 version, the text_input can't work well,I don't know how to fix it

Change method main:

Todos::run(Settings {
    default_font: Some(include_bytes!("../assets/font/STSong.ttf")),
)}

Add this line works well for me.
Tips: the STSong.ttf can be downloaded from elsewhere.

@rongjv
Copy link

rongjv commented Nov 23, 2023

@ys928 你这个问题解决了吗,我也遇到这个问题,UI可以显示中文,text_input可以粘贴中文,但是无法切换中文输入法,无法直接输入中文

@tingfeng-key
Copy link

@rongjv 你用这个PR试试 #1858

@rongjv
Copy link

rongjv commented Nov 23, 2023

@rongjv 你用这个PR试试 #1858

你好,感谢,我还想问下,PR是什么意思,还有怎么单独使用某个PR,我是vscode上,iced在toml的依赖里设置后,所有模块都是它自己下载的

@rongjv
Copy link

rongjv commented Nov 23, 2023

@rongjv 你用这个PR试试 #1858

谢谢,我已经试过了,的确可行,不过稍微有点小问题,就是鼠标在文本框点击后,有时候输入法还是会丢失,需要再点击文本框一次,输入法又回来了。但还是谢谢你的回答

@C-Entropy
Copy link

C-Entropy commented Feb 6, 2025

#2777 add input method support(confirm windows11+weasel, arch+(x)wayland+fcitx5-rime).

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

No branches or pull requests

6 participants