This is happening because the '13v2 keyboard produces a scancode of 0x56 for that particular key. Every other keyboard on the planet since the dawn of the pc/at at least (well, the 3 I’ve
looked at anyway ;)) produces a scancode of 0x2B.
On Fedora 26 with English (US) keyboard configured this is mapped to key number 86, and yields the < and > characters.
The scancode is, so far as I know, a property of the keyboard design and is fixed. So you need to change the key number that scancode 0x56 maps to.
From a virtual console (not the gui!) login as root and type the command:
setkeycodes 56 43
You should now find that the key produces pipe and backslash as it should, both in virtual console and in xorg/MATE/whatever and in wayland/gnome in the case of PureOS.
To make this change permanent, type:
systemctl status rc-local
You should see something like this, which is from Fedora:
rc-local.service - /etc/rc.d/rc.local Compatibility
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: disabled)
Don’t try to enable/disable it; in both Fedora and PureOS it’s already correctly set up.
All you need is to create either /etc/rc.local (in PureOS) or /etc/rc.d/rc.local (for Fedora). The file should be owned by root and have perms 750:
-rwxr-x—. 1 root root 386 Dec 6 17:13 rc.local
Put the set keycodes command above in file with an exit code, so the content is:
setkeycodes 56 43
exit 0
Now when you reboot the key is fixed automagically and you don’t need to worry about it any more until you reinstall your system from scratch.