1

I've tried remapping a key thats not on my current keyboard but I cant get it to work on Ubuntu 17.04.

I edited the file

/usr/share/X11/xkb/symbols/pc

The key that I im missing on my keyboard is the below key LSGT (to the right of the shift key)

key <LSGT> {    [ less, greater, bar, brokenbar ] };

So I want to replace below section § key (left of numeric 1 key), with the key above. Because I don't ever thing i've used this key

So I run

xev -event keyboard

to get the key info. But I dont see the key number I should use?

KeyPress event, serial 28, synthetic NO, window 0x3400001,
    root 0xdd, subw 0x0, time 18369362, (-451,244), root:(348,296),
    state 0x0, keycode 49 (keysym 0xa7, section), same_screen YES,
    XLookupString gives 2 bytes: (c2 a7) "§"
    XmbLookupString gives 2 bytes: (c2 a7) "§"
    XFilterEvent returns: False

When I was testing this out I had a key just to test with so I took the below key

key <AD12> { [ U0328,  dead_circumflex,  dead_tilde,  dead_caron ] };

And changed that to.

key <AD12> {    [ less, greater, bar, brokenbar ] };

And after this I runned the following command to clear the cache

sudo dpkg-reconfigure xkb-data

After this I signed out and back in again. But the keys stays the same and nothing happends?

What am i doing wrong?

Cadoiz
  • 268
  • 1
  • 9
wspoon
  • 21
  • 3
  • Possible alternative approach to achieve what you want: https://askubuntu.com/questions/843590/key-keycode-49-and-key-keycode-94-are-inverted-on-macbookpro-keyboar – Gunnar Hjalmarsson Jun 04 '17 at 00:40

1 Answers1

1

With some help from Gunnars comment I found the answer.

When I viewed

/etc/default/keyboard

To see my current locale keyboard setting in XKBLAYOUT.

So I got back to.

/usr/share/X11/xkb/symbols/

And changed both pc and my locale file that I found in above XKBLAYOUT setting.

From

key <LSGT>  { [      less,     greater,         bar,    brokenbar ] };

To

key <TLDE>  { [      less,     greater,         bar,    brokenbar ] };

Did a

sudo dpkg-reconfigure xkb-data

Singed out and back in and now its working. And the key is remapped. (Not really sure why I had to change both pc and locale file, I tought pc file would have precedence over the locale file)

wspoon
  • 21
  • 3
  • Great that you figured it out. Actually I think that changing `/etc/default/keyboard` as suggested in the answer to the linked question would have been sufficient, though. – Gunnar Hjalmarsson Jun 04 '17 at 15:47