Pine64-Arch
Pine64-Arch copied to clipboard
Onscreen keyboard keeps opening when using usb or bluetooth keyboard
- Device: (PinePhone or PineTab?) Pinephone Pro
- Kernel Version : $(uname -r) 5.17.0-2-danctnix
- UI: phosh
Steps to reproduce
Everytime I use a usb connected via usb adapter or a bluetooth keyboard when I type I keep getting the onscreen keyboard popping-up when I type on the externally connected keyboard.
Expected behavior
Once an external keyboard is activated the on-screen keyboard should be temporarily disabled and should not keep popping up when you type on the external keyboard.
I have tested this on Manjaro ARM phosh on eMMC and there is a toggle to turn off the on-screen keyboard which makes life much easier.
If a similar thing could be implemented in ARCH Linux that would be great especially as the aim is to use this like a computer with a keyboard and mouse attached as I do and eventually a monitor when that aspect is working.
Actual behavior
Everytime I use a usb connected via usb adapter or a bluetooth keyboard when I type I keep getting the onscreen keyboard popping-up when I type on the externally connected keyboard.
Logfiles and additional information
A toggle would be easier of course but if you wanna have a quick solution you could also add an alias or two:
# gsettings
## Keyboard
alias kh='gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled false'
alias ks='gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true'
Ok I have added those into the .bashrc file.
But not sure if it is working as when I tested in SMS, maps with a Bluetooth keyboard present the soft keyboard still keeps popping up until I hide it for that session.
Ok got it working now using kh in the terminal. Thanks for this works a treat!
This appears to be a upstream issue, as the only way for the osk to not show up is to put the phone in docked mode, which is only possible with a mouse plugged in.
I'm using this udev rule solution, it's not perfect but it does the job most of the time:
-
Create /etc/udev/rules.d/00-external-keyboards.rules with the following content:
ACTION=="add", KERNEL=="hidraw*", SUBSYSTEM=="hidraw", RUN+="/usr/bin/su - alarm -c 'export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus && export DISPLAY=:0 && /usr/bin/gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled false'"
ACTION=="remove", KERNEL=="hidraw*", SUBSYSTEM=="hidraw", RUN+="/usr/bin/su - alarm -c 'export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus && export DISPLAY=:0 && /usr/bin/gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true'"
-
To apply it reboot or reload udev rules:
# udevadm control --reload-rules && udevadm trigger