Enable the Virtual Keyboard on Weston

Hi Toradex Community,

I would like to enable the virtual keyboard on weston.

I run an avalonia MVVM application with weston (commontorizon/weston-imx8:4-rc).

I ’ am using TorizonCore.6.7.0
Verdin iMX8M Plus as SoM

To add the [input-method] section in the weston.ini file

  1. Where I can find the weston.ini file
  2. What will be the path of the weston-keyboard
    Is the path /usr/lib/aarch64-linux-gnu/weston-keyboard because I could not find this path!

Best regards,

Ahmed49

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


:handshake:

Hi, Ahmed49

To enable the virtual keyboard on Weston, you need to modify the weston.ini file and ensure the correct path for the weston-keyboard is set. Here are the steps to achieve this:

  1. Finding the weston.ini file:

    • The weston.ini file is typically located in the Weston container. If you are using the Torizon Weston container, you can bind mount your custom weston.ini file when running the container. For example:
      docker run -d --rm -v /path/to/your/weston.ini:/etc/xdg/weston/weston.ini torizon/weston
      
  2. Setting the path for weston-keyboard:

    • The path for the weston-keyboard binary can vary. In the Torizon Weston container, it is usually located at /usr/lib/aarch64-linux-gnu/weston-keyboard. However, if you cannot find it there, you might need to install the necessary packages or check the container’s file system for the correct path.

Here is an example of how to configure the weston.ini file to enable the virtual keyboard:

[input-method]
path=/usr/lib/aarch64-linux-gnu/weston-keyboard

Ensure that the path specified in the weston.ini file matches the actual location of the weston-keyboard binary in your container.

Best regards,
Toradex AI Assistant

Greetings @Ahmed49,

Where I can find the weston.ini file

The weston.ini file is in the Weston container. For ways to modify/configure this file please read: Working with Weston on Torizon OS | Toradex Developer Center

What will be the path of the weston-keyboard
Is the path /usr/lib/aarch64-linux-gnu/weston-keyboard because I could not find this path!

That is the correct path for the keyboard. But, again it is inside the weston container filesystem. You are probably looking outside of the container.

I did a quick test and the weston-keyboard seems to work fine. Keep in mind though the weston-keyobard is a simple virtual keyboard that is only designed to work with other weston related applications like weston-editor. It probably will not work with graphical applications from other frameworks like Avalonia.

Best Regards,
Jeremias

@jeremias.tx
Thank you for the reply,

Yes, it works fine with weston-keyboard and the weston-editor. But I need the virtual keyboard for my Avalonia application.

Any help?

Best regards,
Ahmed49

Well for the most part that’s why most graphical frameworks need to create a virtual keyboard for their own needs. There’s a demo Avalonia app here from one of our developers: wince-alternative-demos/avaloniaDemo at main · microhobby/wince-alternative-demos · GitHub

This demo has an integrated virtual keyboard in utils/OnBoardKeyboard.cs. Maybe you can use this as a reference for your application. Keep in mind this will only work for Avalonia GTK based applications, not framebuffer.

Best Regards,
Jeremias

Hi @jeremias.tx ,

After I have run the avalonia application including the Utils folder from the wince-alternative-demos/avaloniaDemo Github Repository on the SoM, I got this error message (Failed to open connection to “session” message bus: /usr/bin/dbus-launch terminated abnormally without any error message
) when I get focus in TextBox

Do I need to install dbus on the Torizon OS?
If yes ? so I need to install dbus as recipe in the yocto image and build the Torizon Images from the Yocto project?

Any Help?
Best regards,
Ahmed49

You may need to give your container access to the host OS DBUS via /var/run/dbus.

Best Regards,
Jeremias

Hi @jeremias.tx ,

this is not enough, i need the created org.onboard.Onboard dbus service! called in the TextBox class .

Best regards,
Ahmed49

Well yeah this particular onscreen keyboard program was meant just for this avalonia demo application. For it to be used more generically it probably needs some adaption and integration work.

Best Regards,
Jeremias