Change weston virtual keyboard appearance and layout

Hello,

I am trying to change the keyboard layout and appearance on a graphical application running on:

  • Torizoncore 6.3.0
  • Verdin iMX8M Plus

Basically, I have the following weston “backend” as a service in my docker-compose file:

  weston:
    container_name: "weston-backend"
    cap_add:
      - CAP_SYS_TTY_CONFIG
    device_cgroup_rules:
      - 'c 4:0 rmw'
      - 'c 4:7 rmw'
      - 'c 13:* rmw'
      - 'c 199:* rmw'
      - 'c 226:* rmw'
    environment:
      - ACCEPT_FSL_EULA=1
    image: torizon/weston-vivante:2
    network_mode: host
    scale: 1
    command: weston-launch --tty=/dev/tty7 --user=torizon
    healthcheck:
      test: ["CMD", "test", "-S", "/tmp/.X11-unix/X0"]
      interval: 5s
      timeout: 4s
      retries: 6
      start_period: 10s
    volumes:
      - source: /tmp
        target: /tmp
        type: bind
      - source: /dev
        target: /dev
        type: bind
      - source: /run/udev
        target: /run/udev
        type: bind

And, I have another service which is a graphical application using weston. It is a flutter-elinux application:

FROM --platform=linux/arm64/v8 torizon/weston-vivante:3 AS runtime

RUN mkdir -p /app/gui

RUN apt-get -y update && apt-get install -y \
	alsa-utils \
	libasound2 \
	psmisc \
	procps pciutils \
	libgstreamer1.0-0 \
	gstreamer1.0-plugins-base \
	gstreamer1.0-plugins-good \
	gstreamer1.0-plugins-bad \
	gstreamer1.0-plugins-ugly \
	gstreamer1.0-libav \
	gstreamer1.0-tools \
	gstreamer1.0-x \
	gstreamer1.0-alsa \
	gstreamer1.0-gl \
	gstreamer1.0-gtk3 \
	gstreamer1.0-pulseaudio \
	v4l-utils \
	locales

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
	locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

# Get the flutter bundle built in the build environment
ADD bundle /app/gui/bundle

# The .so libraries (notably libflutter_engine.so) must be in the library path
# to properly execute the flutter_app. Some plugin (like the elinux video_player plugin)
# also generate a .so library, and NEED to be in the library path.
ADD bundle/lib /lib/

WORKDIR /app/gui/bundle/
ENV PATH="/app/gui:${PATH}"

ENTRYPOINT ["./my_gui_client"]
CMD ["-f", "-k", "-b", "../bundle/"]

On the gui-client, if I want to use a text field I get the following virtual keyboard:

If I enter the weston container and launch weston-editor I also get the same keyboard. But, I would like to change the appearance and layout of the keyboard. How can I do that ?

Thank you for the help.

Hello @mnano ,
I don’t know if you can change the appearance of the Weston keyboard.
For the layout you should set the appropriate keymap_layout value in thhe [keyboard] section in weston.ini
For example:

# on screen keyboard input method
[input-method]
path=/usr/lib/weston/weston-keyboard

[keyboard]
keymap_rules=evdev
keymap_layout=us,de
keymap_variant=colemak,
keymap_options=grp:shifts_toggle
keymap_options=caps:ctrl_modifier,shift:both_capslock_cancel
repeat-rate=30
repeat-delay=300

Best regards,
Josep

Thank you for your information.

I have a few questions/remarks regarding this:

  • Where should the updated weston.ini be? I know that there is on in /etc/xdg/weston/ but if you create a .config folder in the $HOME folder and have a weston.ini there → that .ini will be used won’t it?
  • In extension to this question, both the backend and the gui services use a weston image. This means that both have a weston.ini. Should both be changed? Only one? If so which one?
  • I tried to change things in the weston service and checking the keyboard with weston-editor (after restarting the docker container). But nothing I did ever had any impact, except changing the path to weston-keyboard (in which case I had an expected compositor: executing '/usr/wrongpath/weston-keyboard' failed: No such file or directory error while doing docker logs weston-backend --follow

Hello @mnano ,

According to our documentation

the Weston container will use the /etc/xdg/weston/weston.ini file. If you want to use another file, you will have to follow the appropriate instructions here:

I think there is a misunderstanding here.
Your second Docker image ( the GUI )is based on a Weston image, but it does not execute Weston, because you specified a different entry point.

which things did you change?

Best regards
Josep

Thank you for the information.

I changed the weston.ini file. I tried what you indicated and like I said, outside of changing the path to a wrong one, nothing had any impact (layout, variant, model)

No matter, we will just code our own custom virtual keyboard since we use flutter (including layouts).