Pine64-Arch icon indicating copy to clipboard operation
Pine64-Arch copied to clipboard

Onscreen keyboard keeps opening when using usb or bluetooth keyboard

Open jsarkari opened this issue 2 years ago • 4 comments

  • 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

jsarkari avatar Apr 07 '22 14:04 jsarkari

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'

Dan-Sun avatar Apr 09 '22 02:04 Dan-Sun

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.

jsarkari avatar Apr 09 '22 05:04 jsarkari

Ok got it working now using kh in the terminal. Thanks for this works a treat!

jsarkari avatar Apr 09 '22 05:04 jsarkari

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.

Danct12 avatar Apr 13 '22 20:04 Danct12

I'm using this udev rule solution, it's not perfect but it does the job most of the time:

  1. 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'"

  2. To apply it reboot or reload udev rules: # udevadm control --reload-rules && udevadm trigger

pinoverclock avatar Dec 15 '22 21:12 pinoverclock