3

I've used xmodmap to remap keys for bluetooth keyboard in Ubuntu 14.04:

xmodmap ~/.Xmodmap

remove mod1 = Alt_L
remove mod1 = Alt_R
keycode 180 = Alt_L
keycode 225 = Alt_R
add mod1 = Alt_L
add mod1 = Alt_R

But mappings reset next time bluetooth keyboard connects.

How to make mappings permanent or reenable them on connecting device?

Update:

I've found that going to tty and back to Xsession also breaks xmodmap settings, this line prevents breaking in tty case:

gsettings set org.gnome.settings-daemon.plugins.keyboard active false

but it's not an option since it breaks switching language layouts, while icon still shows language correctly. Reconnecting keyboard also resets xmodmap settings.

1 Answer 1

2

I solved it by modifying keyboard layout.

First I checked what symbols were used in current layouts with

$setxkbmap -print -v 10

Then modified /usr/share/X11/xkb/symbols/inet lines

    key <I180> {[XF86HomePage]};
    key <I225> {[XF86Search]};

to lines borrowed from /usr/share/X11/xkb/symbols/altwin

    key <I180> {[Alt_L, Meta_L]}; // was XF86HomePage
    key <I225> {[Alt_R,Meta_R]}; // was XF86Search
    modifier_map Mod1 {<I180>, <I225>}; // removes sticky fake alt problem

and used command

$sudo dpkg-reconfigure xkb-data

which deleted compiled keyboard layouts from /var/lib/xkb/ . same as

$sudo rm /var/lib/xkb/*.xkm

and caused them to recompile on next switch.

PS: I've found links from slm's answer helpful https://unix.stackexchange.com/questions/101410/where-do-find-information-about-xkb-symbols-i-e-dead-acute-kp-1-delete-down

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .