Menu

#1123 xubuntu: bépo keyboard layout not recognized

KeePass_2.x
closed
nobody
None
5
2023-10-16
2013-05-31
No

OS: xubuntu 12.04

With French-dvorak keybord layout, bépo, can be switched with:

$ setxkbmap fr bepo

The top line, aka numbers doesn't work until key "8". Shifted or not.

Discussion

  • Dominik Reichl

    Dominik Reichl - 2013-05-31
    • status: open --> closed
     
  • Dominik Reichl

    Dominik Reichl - 2013-05-31

    Interesting; please report it to the 'xdotool' developer here:
    https://github.com/jordansissel/xdotool/issues

    Thanks and best regards,
    Dominik

     
  • Dominik Reichl

    Dominik Reichl - 2013-05-31

    Oh, sorry, I thought you meant that auto-type does not work correctly with this keyboard layout. However, it seems you meant input to KeePass in general. This is unrelated to 'xdotool'; you can close the 'xdotool' ticket.

    Mono is responsible for handling keyboard input to KeePass. Your issue seems to be related to the following Mono bug:
    https://bugzilla.novell.com/show_bug.cgi?id=323983

    Best regards,
    Dominik

     
  • Sylvain Viart

    Sylvain Viart - 2013-05-31

    xdotool's ticket closed.

    2007?
    no key swap for me.

    essentially the 8 top left hand numbered keys producing nothing.

    ² plus 1 to 7

    others keys seem working with the expected bépo layout.

     
  • Sylvain Viart

    Sylvain Viart - 2013-06-01
     
    • Sylvain Viart

      Sylvain Viart - 2013-06-12

      Hi,

      No move at all on the mono's ticket above…
      Are you sure that's the good place?

      I've found: http://www.mono-project.com/Support

      I try to re-post here…

      Regards,
      Sylvain.

       
  • Dominik Reichl

    Dominik Reichl - 2013-06-12

    I'm sure the Mono bugs tracker is the correct place to report this issue, yes.

    Best regards,
    Dominik

     
  • Youbi

    Youbi - 2016-11-24

    Hi,

    I’ve installed Keepass2 a few days ago, and found the same problem when trying to type my master password when using bépo. It seems that there is no problem with Mono: I built a little source code which open a window with an input field, and no problem.

    Keepas2 2.28
    Mono 3.2.8

    Best Regards,

    Youbi

     
  • Clément Baudouin

    Hi there,
    As I indicated in https://github.com/mono/mono/issues/14412, I found a small workaround to get bépo layout working in Keepass2 in Mono.

    I use two keyboard layouts on my system: fr oss, and fr bepo_afnor.
    The trick is to set x to use the azerty layout, then start mono, wait 1 second, then set x to use bépo again, and the field will actually accept bépo input.

    I use this script to launch keepass:

    #! /usr/bin/env bash
    
    cd $HOME/Downloads/KeePass-2.55/ || exit 1
    
    # wayland
    if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
        echo wayland detected
        if [[ $(qdbus org.kde.keyboard /Layouts getLayout) == 0 ]]; then
            echo "detected layout 0 (bépo?)"
            setxkbmap fr,fr oss,bepo_afnor
            qdbus org.kde.keyboard /Layouts setLayout 0
            #keepass2 &
            exec /usr/bin/cli --verify-all ./KeePass.exe &
            sleep 1
            setxkbmap fr,fr bepo_afnor,oss
            exit
        else
            echo "detected layout 1 (azerty?)"
            setxkbmap fr,fr oss,bepo_afnor
            qdbus org.kde.keyboard /Layouts setLayout 0
            exec /usr/bin/cli --verify-all ./KeePass.exe &
            sleep 1
            setxkbmap fr,fr bepo_afnor,oss
            qdbus org.kde.keyboard /Layouts setLayout 1
            exit
        fi
    fi
    
    # x11
    layout=$(setxkbmap -query | grep variant | cut -d ' ' -f5)
    case "$layout" in
        "bepo_afnor,oss")
            echo detected bépo
            setxkbmap fr,fr oss,bepo_afnor
            qdbus org.kde.keyboard /Layouts setLayout 0
            #keepass2 &
            exec /usr/bin/cli --verify-all ./KeePass.exe &
            sleep 1
            setxkbmap fr,fr bepo_afnor,oss
            qdbus org.kde.keyboard /Layouts setLayout 0
            ;;
        *)
            echo detected azerty
            #keepass2 &
            exec /usr/bin/cli --verify-all ./KeePass.exe &
            sleep 2
            setxkbmap fr,fr oss,bepo_afnor
            ;;
    esac
    

    You can adapt it to your needs. Maybe more minimally use:

    setxkbmap fr oss
    keepass2 &
    sleep 1
    setxkbmap fr bepo
    

    I don’t know if something can be done on Keepass or mono’s side to fix this, now that we know that this workaround exists.

     

    Last edit: Clément Baudouin 2023-10-16
  • Clément Baudouin

    Now if we enable KPUInput plugin (Auto-Type on Wayland systems), and that we are using the bépo layout, the auto-type will not detect that and type the wrong characters. As a workaround, I use this scripts to switch back to azerty, do the auto-type, wait for 4 seconds (the time it takes to type approx. 32 characters on my system), and then switch back to bépo layout. I assign this script to a global shortcut. Not ideal, but it might help until we get a better solution.

    #! /usr/bin/env bash
    
    cd $HOME/Downloads/deb/KeePass-2.55/ || exit 1
    
    # wayland
    if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
        echo wayland detected
        if [[ $(qdbus org.kde.keyboard /Layouts getLayout) == 0 ]]; then
            echo "detected layout 0 (bépo?)"
            setxkbmap fr,fr bepo_afnor,oss
            qdbus org.kde.keyboard /Layouts setLayout 1
            #keepass2 &
            mono --verify-all ./KeePass.exe --auto-type
            sleep 1
            while [[ $(wmctrl -l | grep "Auto-Type Entry Selection") != "" ]]; do
                sleep 0.1
            done
            sleep 1
            while [[ $(wmctrl -l | grep "AutoTypeSearch") != "" ]]; do
                sleep 0.1
            done
            sleep 4
            qdbus org.kde.keyboard /Layouts setLayout 0
            exit
        else
            echo "detected layout 1 (azerty?)"
            mono --verify-all ./KeePass.exe --auto-type
            exit
        fi
    fi
    
    # x11
    layout=$(setxkbmap -query | grep variant | cut -d ' ' -f5)
    case "$layout" in
        "bepo_afnor,oss")
            echo detected bépo
            setxkbmap fr,fr oss,bepo_afnor
            qdbus org.kde.keyboard /Layouts setLayout 0
            #keepass2 &
            mono --verify-all ./KeePass.exe --auto-type
            sleep 1
            while [[ $(wmctrl -l | grep "Auto-Type Entry Selection") != "" ]]; do
                sleep 0.1
            done
            sleep 1
            while [[ $(wmctrl -l | grep "AutoTypeSearch") != "" ]]; do
                sleep 0.1
            done
            sleep 4
            setxkbmap fr,fr bepo_afnor,oss
            qdbus org.kde.keyboard /Layouts setLayout 0
        ;;
        *)
            echo detected azerty
            setxkbmap fr,fr oss,bepo_afnor
            qdbus org.kde.keyboard /Layouts setLayout 0
            #keepass2 &
            mono --verify-all ./KeePass.exe --auto-type
            sleep 1
            while [[ $(wmctrl -l | grep "Auto-Type Entry Selection") != "" ]]; do
                sleep 0.1
            done
            sleep 1
            while [[ $(wmctrl -l | grep "AutoTypeSearch") != "" ]]; do
                sleep 0.1
            done
            sleep 4
            setxkbmap fr,fr oss,bepo_afnor
            qdbus org.kde.keyboard /Layouts setLayout 0
        ;;
    esac
    
     

    Last edit: Clément Baudouin 2023-10-16
  • Clément Baudouin

    I noticed something interesting: if I start Keepass while in azerty layout, Keepass will switch my keyboard to the other layout, bépo.

    setxkbmap -query; cli /usr/lib/keepass2/KeePass.exe &; sleep 3; setxkbmap -query
    rules:      evdev
    model:      pc104
    layout:     fr,fr
    variant:    oss,bepo_afnor
    [1] 143223
    
    (cli:143223): Gtk-WARNING **: 12:41:16.727: Unable to locate theme engine in module_path: "adwaita",
    rules:      evdev
    model:      pc104
    layout:     fr,fr
    variant:    bepo_afnor,oss
    

    That’s probably a bug in Keepass as I could not reproduce this behaviour with the mono example that is available at https://github.com/mono/mono/issues/14412

    See https://sourceforge.net/p/keepass/bugs/2273/

     

    Last edit: Clément Baudouin 2023-10-16

Log in to post a comment.