Skip to content

[REQUEST] Officially support British keyboards #83

@jplm824

Description

@jplm824

After about 3 hours of fiddling (I'm on Linux), I've finally managed to get it working. Basically, what I had to do is add the following into my /usr/share/X11/xkb/symbols/gb file (replacing everything, including the whole first block, up to the line partial alphanumeric_keys):

// Keyboard layouts for Great Britain.

default partial alphanumeric_keys
xkb_symbols "basic" {

    // The basic UK layout, also known as the IBM 166 layout,
    // but with the useless brokenbar pushed two levels up.

    // But actually, tweaked to be Workman (see bottom of this definition block):

    include "latin"

    name[Group1]="English (UK, Workman)";

    key <TLDE>	{ [     grave,    notsign,          bar,          bar ]	};
    key <AE02>	{ [         2,   quotedbl,  twosuperior,    oneeighth ]	};
    key <AE03>	{ [         3,   sterling, threesuperior,    sterling ]	};
    key <AE04>	{ [         4,     dollar,     EuroSign,   onequarter ]	};

    key <AC11>	{ [apostrophe,         at, dead_circumflex, dead_caron]	};
    key <BKSL>	{ [numbersign, asciitilde,   dead_grave,   dead_breve ]	};

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

    include "level3(ralt_switch)"

    // JPLM824: 05/08/2024:
    // Make Workman the default:
    include "us(workman)"
   
};

partial alphanumeric_keys
xkb_symbols "workman" {

    // This variant is explicitly named, to facilitate `setxkbmap gb -variant workman` to correspond to `setxkbmap gb -variant qwerty`.

    include "latin"

    name[Group1]="English (UK, Workman)";

    key <TLDE>	{ [     grave,    notsign,          bar,          bar ]	};
    key <AE02>	{ [         2,   quotedbl,  twosuperior,    oneeighth ]	};
    key <AE03>	{ [         3,   sterling, threesuperior,    sterling ]	};
    key <AE04>	{ [         4,     dollar,     EuroSign,   onequarter ]	};

    key <AC11>	{ [apostrophe,         at, dead_circumflex, dead_caron]	};
    key <BKSL>	{ [numbersign, asciitilde,   dead_grave,   dead_breve ]	};

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

    include "level3(ralt_switch)"
   
    // JPLM824: 05/08/2024:
    include "us(workman)"
};

partial alphanumeric_keys
xkb_symbols "qwerty" {

    // The basic UK layout, also known as the IBM 166 layout,
    // but with the useless brokenbar pushed two levels up.

    include "latin"

    name[Group1]="English (UK, Qwerty)";

    key <TLDE>	{ [     grave,    notsign,          bar,          bar ]	};
    key <AE02>	{ [         2,   quotedbl,  twosuperior,    oneeighth ]	};
    key <AE03>	{ [         3,   sterling, threesuperior,    sterling ]	};
    key <AE04>	{ [         4,     dollar,     EuroSign,   onequarter ]	};

    key <AC11>	{ [apostrophe,         at, dead_circumflex, dead_caron]	};
    key <BKSL>	{ [numbersign, asciitilde,   dead_grave,   dead_breve ]	};

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

    include "level3(ralt_switch)"
   
};

This makes UK keyboard workman my default layout, but if I ever have to let someone else type on my machine, all I have to do is toggle back with $ setxkbmap gb -variant qwerty and I can then come back again with either setxkbmap gb -variant workman, or simply, setxkbmap gb`.

What remains missing is to integrate it with the graphical distro installer, and the graphical keyboard layout selectors of the various graphical OS configuration utilities.

I'm also not sure if it could be further streamlined/deduplicated by, for example, recursive includes, or whether that could wreck any of the other variants going on there.

Originally posted by @jplm824 in #68 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions