Bluetooth keyboard, the layout and the layout choice not transferring to the Android layer

I have a Bluetooth hardware keyboard (Akko 3068B Plus to be precise) which I use with my Xperia 10 II running Sailfish OS. I have an issue with my choice of layout for the hardware keyboard not transferring to the Android layer.

I have set the language of my hardware keyboard to Finnish on the Sailfish Setting - Text Input, and when I use the keyboard on native Sailfish apps, Sailfish OS reads the input correctly as coming from a Finnish layout keyboard.

But when on Android apps, the input from keyboard is read as coming from an English layout hardware keyboard.

When I open the general Android Setting through Terminal, the System - Languages and Input - Physical Keyboard says “allen_wayland_keyboard”, and when I click that open, it does allow me to choose my keyboard layout(s). But whatever layout I choose has no practical meaning, as the input language that Android apps read from my keyboard will still be English.

Anyone with experience with Bluetooth keyboards, any hints on whether I get to change the Bluetooth keyboard input language for Android apps too?

On a further note, using CTRL + Space to quick-change the hardware keyboard layout for Sailfish apps does not seem to work properly. Even if I have activated two layouts from the Settings for hardware keyboard, pressing CTRL + Space will only activate and re-activate the same layout that I chose to be the active one in the Settings.

Also on the Android Settings it is noted that CTRL + Space does quick-change the layout for hardware keyboard, but I assume this isn’t and shouldn’t be working when using the Android layer under the Sailfish OS (?). Or is CTRL+Space being in use for both Sailfish proper and Android layer messing up things so that it doesn’t work on neither?

Fixed the missing “not” in your title.

Same here.

Worth noting is that you have to enable more layouts, but even so it still didn’t work

I guess that depends a bit on how the keyboard events are to be transferred.
But presumably Android will not be able to tell the difference between how the SFOS keyboard works, and an external one, in which case it wouldn’t do anything anyway.

2 Likes

I have the same unfortunately, but with built-in F(x)tec Pro1’s keyboard. What is even worse, physical layout is unshifted QWERTZ and normal QWERTY layout is shifted - that means, W = Q, E = W in Android apps.

There are few workarounds, but not actual fixes.

  1. Use Key Mapper from F-Droid with Shizuku from GitHub.
    This allows to manually remap each key, which was working cool to “unshift” my layout, but I couldn’t make “local” keys like Polish ł to work. In short, you need to install Key Mapper from F-Droid, Shizuku from GitHub. Run Shizuku, then Terminal and type:
appsupport-attach /system/bin/sh
sh /storage/emulated/0/Android/data/moe.shizuku.privileged.api/start.sh

Then run Key Mapper and configure your key mappings. You need to re-run above two commands after each reboot, though.

  1. Use External Keyboard Helper
    This is very tricky, as EKH doesn’t work anymore on Sailfish above 4.0.1. People say that updating from 4.0.1 to each next stop release, until you reach 4.5.0.xx works and EKH will work. EKH allows you to fully customize keyboard layout to your needs.
    I did not test this way.

  2. Manually edit default keyboard layout of Android
    This is hardest. Unpack system.img of AlienDalvik, edit default keyboard layout (somewhere in /system/usr/keylayouts if I remember correctly) and repack system.img and replace it. It’s tricky and often modyfing it incorrectly breaks AAS - it’s hard to edit it properly and keep it working. I never achieved it with Pro1, but I know it’s possible.

Unfortunately, with such hard, tricky and unstable ways only, I ended up using Waydroid, in which changing hardware keyboard layouts normally, in Settings work (I use my modified build of FinQwerty). But this is not fair if you bought license. You should have it available out-of-the-box (changing layouts I mean).

Good luck!

P.S. Wrote fully using F(x)tec Pro1 =)

2 Likes

Thank you, probably for the better. I kind of had the idea to ask how exactly the Bluetooth keyboard input finds its way to the Android layer, so I omitted the “no” from title for that, but then I didn’t actually word that question of mine.

So, how exactly does the input from a Bluetooth keyboard connected to a Sailfish OS device transfer to the Android apps? Does Sailfish OS and bluez5 or some other Sailfish OS process have a say on it; does the hardware keyboard input come to the Android layer from Sailfish OS proper similarly as it does(?) from the virtual onscreen maliit keyboard, or does Android layer/Alien Dalvik connect directly to the bluetooth peripheral and bypass every setting Sailfish OS might have on the way?

I mean, is there a Sailfish OS process that reads the input from the Bluetooth keyboard in English and passes it to Alien Dalvik before translating it to the chosen language of the user? Where exactly does alien_dalvik_keyboard do its thing, and what that thing is?

Now, upon asking this, I find someone has before asked about the same thing:

I guess this might be still true?

HID 1.0 (Human Interface Device Profile): Allows use of HIDs with Jolla, for example keyboards and mice. SailfishOS supports the American keypad layout only.

Thank you for these suggestions. Solution 1 looks like doable, I have to look into it some better time. Solutions 2 ja 3 look like I would break everything if I tried them. :smile:

I don’t know. But the settings in the Android runtime sure looks the same no matter what, so i can only assume there is just one pipe in with different things feeding it.

That’s the theory.

Definitely not; see countless complaint threads about “Bluetooth support” for the Android runtime.

No, as you have noted your native language works fine now.
(The quoted help article in the TJC question was for SFOS as a whole, not just Android apps)

2 Likes

Ah, right. I failed to notice that as the question itself was about Alien Dalvik, and the linked/quoted Zendesk article has been since removed.

This probably is the current information, they have dropped the mention that “SailfishOS supports the American keypad layout only” from the HID 1.0 portion:

Bluetooth

BlueZ is the base library for all Bluetooth-related features.

Currently, Sailfish OS provides the following profiles:

  • Audio Gateway for Headset Profile (HSP) and Handsfree Profile (HFP) for making calls via Bluetooth headsets
  • Advanced Audio Distribution Profile (A2DP) for playback of multimedia audio over a Bluetooth connection
  • SyncML client & server (SyncML) for synchronization of contact data
  • OBEX Object Push (OPP) for file exchange services
  • Phone Book Access Profile (PBAP) for exchanging phonebook data with a car kit
  • AVCTP 1.3 (Audio/Video Control Transport Protocol), AVDTP 1.2 (Audio/Video Distribution Transport Protocol) and AVRCP 1.3 (Audio/Video Remote Control Profile). Allows using your Sailfish device as a rudimentary remote control to other Bluetooth devices: “play, stop, pause” etc. commands to devices.
  • HID 1.0 (Human Interface Device Profile). Allows use of HIDs with a Sailfish device, for example keyboards and mice.

The Sailfish OS adaptation of BlueZ is available at GitHub - sailfishos/bluez: This is the legacy Bluez 4 package. Bluez5 has its own repo.. Generally, Sailfish app developers will find it easier to use libbluez-qt instead, as that provides a Qt-based API and QML module for accessing BlueZ functionality.

Bluetooth audio distribution is managed through PulseAudio.

Curious that HID 1.0 apparently works in various languages in Sailfish OS proper but only in English under Alien Dalvik.

Just a notion which may be handy to someone:

you can get the dead letters from a bluetooth keeb with ALT+ combos, ie. ALT+U is ¨ and ALT=I is ˆ. It’s far from perfect but there’s the Ü, Ä and Ö for you when you desperately need them.

edit: I’m totally weirded out what exactly is the keyboard layout that gets used for Android apps when typing with a Bluetooth keyboard. When testing out, these (and only these) ALT combos give a symbol on screen, some of them in dead key fashion:

ALT+(the key left from 1) `
ALT+e ´
ALT+u ¨
ALT+i ^
ALT+s ß
ALT+c ç
ALT+n ~

ALT+SHIFT+(the key left from 1) ˜
ALT+SHIFT+c Ç

These seem to very closely correspond to certain Mac OS X layouts, but limited only to the above characters. I wonder: have the people making Bluez5 or some file used by it have activated shortcuts for specific common non-English characters based on the OS X layout?

Options-keyboard