Search code examples
keyboardkeyboard-shortcutsx11apldyalog

Dyalog APL hijack Windows Key and do not give it back (Fedora 32/Gnome, Free Licence, Kitty)


When launching Dyalog, it will directly map the Windows Key as the APL Symbol key. However when I leave Dyalog with ⎕OFF, it will not return in the normal state of the keyboard. Most of my WM keybinding involves the Win key and I did not find any other solutions than reboot my computers.

Is it possible to override Dyalog APL Key so it will not automatically transform the Win Key in APL Key?

I was planning to use a setxkbmap command to have the control on that.

Thanks.


Solution

  • If you call dyalog -nokbd then the keyboard setup will be skipped. Of course, you'll then have to handle the keyboarding yourself (see APL Wiki for details).

    Alternatively, you can create a little script which restores your keyboard when APL terminates, as follows:

    OLDLAYOUT=$(setxkbmap -query | sed -n 's/^layout://p')
    OLDVARIANT=$(setxkbmap -query | sed -n 's/^variant://p')
    OLDOPTION=$(setxkbmap -query | sed -n 's/^options://p')
    dyalog
    OLDLAYOUT=$(echo $OLDLAYOUT | sed 's/^$/,/')
    OLDVARIANT=$(echo $OLDVARIANT | sed 's/^$/,/')
    setxkbmap -layout $OLDLAYOUT -variant $OLDVARIANT -option -option $OLDOPTION