domingo, 15 de janeiro de 2012

Wrong keys auto-typed by KeePass/KeePassX in Ubuntu

When not using the United States keyboard layout (such as azerty or qwertz), KeePass and KeePassX type the wrong keys when using the auto-type feature.  E.g. the 'Q' is typed instead of the 'A' when the keyboard layout is azerty.
As far as I found on forums, this is due to a bug in Unity, the user interface used in Ubuntu. Luckily, there is an easy workaround.

Open a terminal window (Ctrl-Alt-T), and run the following command:
setxkbmap <your 2-digit keyboard layout code>
 E.g. for Belgium having an azerty keyboard layout with keyboard code "be", you should run:
setxkbmap be
This command can be run automatically, when any user is logging on to the system.  This is done with a ".desktop" file, similar to the procedure in my post "Automatically start Empathy at login to Ubuntu".

To create this file, follow these steps:

  • Open a terminal window (Ctrl-Alt-T)
  • Create the file "/etc/xdg/autostart/setxkbmap.desktop", by running this command:
    sudo gedit /etc/xdg/autostart/setxkbmap.desktop
  • Copy this text as contents for the file:  (replace "be" with your own keyboard layout)
    [Desktop Entry]
    Version=1.0
    Encoding=UTF-8
    Name=Fix keyboard settings
    Exec=setxkbmap be
    Terminal=false
    Type=Application
  • Save and Close the file.
Log out and log in again (or reboot), and the auto-type feature should work.

Nenhum comentário:

Postar um comentário