# UK keyboard



## balanga (Mar 3, 2016)

In /etc/rc/conf I define my keyboard as
`keymap="uk.iso.kbd"`

Am I missing something since a number of special characters are not displaying as they should... I presume I'm using a US keymap.


----------



## xavi (Mar 4, 2016)

Run the following command from the terminal and then test if the UK keys work correctly for you:

`$ setxkbmap gb`

If they do, then you can add that command to one of your startup files. I'm not in front of my FreeBSD machine at the moment, but IIRC it was either ~/.xinitrc or ~/.xsessions.


----------



## balanga (Mar 4, 2016)

Thanks, I would never have benn able to work that out for myself - I just assumed that the keyboard definition on installation automatically applied to xorg...


----------



## grahamperrin@ (Jul 11, 2021)

<https://www.freebsd.org/cgi/man.cgi...&manpath=FreeBSD+13.0-RELEASE+and+Ports#FILES> includes: 

/usr/local/share/X11/xkb/keymap

There's no such file: 


```
% file /usr/local/share/X11/xkb/keymap
/usr/local/share/X11/xkb/keymap: cannot open `/usr/local/share/X11/xkb/keymap' (No such file or directory)
% find /usr/local/share/X11/xkb -name "keymap" -print
%
```

Will creating the file negate the need for per-user editions of ~/.xinitrc and if so, what – at a minimum – should /usr/local/share/X11/xkb/keymap comprise, for me in the UK?


----------



## astyle (Jul 11, 2021)

Per FreeBSD Handbook section 5.4, Xorg Configuration, OP is actually correct. I would also recommend scrolling down to section 5.4.7, Input Devices, and start from there for help with keyboards.


----------



## grahamperrin@ (Jul 12, 2021)

Thanks, what about the manual page?


----------



## aragats (Jul 12, 2021)

balanga said:


> In /etc/rc/conf I define my keyboard as
> `keymap="uk.iso.kbd"`
> 
> Am I missing something since a number of special characters are not displaying as they should... I presume I'm using a US keymap.


This is about vt(4), why all replies are about Xorg?


----------



## astyle (Jul 12, 2021)

aragats said:


> This is about vt(4), why all replies are about Xorg?


This is not about vt(4)... Xorg is what helps configure the keyboard. Once the Xorg loads the keymap, then vt(4) becomes even usable...


----------



## aragats (Jul 12, 2021)

astyle said:


> This is not about vt(4)... Xorg is what helps configure the keyboard. Once the Xorg loads the keymap, then vt(4) becomes even usable...


Where do you see any reference to Xorg in the OP?
rc.conf is a part of the OS, Xorg is installed from ports. The keymaps in vt and and in X are totally independent. Both setxkbmap(1) and xorg.conf help setting X keymap, but any setting in rc.conf is irrelevant to X.


----------



## astyle (Jul 12, 2021)

aragats said:


> Where do you see any reference to Xorg in the OP?
> rc.conf is a part of the OS, Xorg is installed from ports. The keymaps in vt and and in X are totally independent. Both setxkbmap(1) and xorg.conf help setting X keymap, but any setting in rc.conf is irrelevant to X.


We're helping OP connect the dots... the line that OP is using in rc.conf is not an ideal hack to get a keyboard working, Xorg should generally take care of keyboard config. But now that I look at the thread more carefully, grahamperrin is/was really necroposting to a 5-year-old thread...


----------



## grahamperrin@ (Jul 12, 2021)

balanga said:


> UK keyboard



It's a suitably generic title. I use a UK keyboard.



astyle said:


> 5-year-old



I knew this would happen. Bloody Brexit.

/usr/local/share/X11/xkb/keymap remains a mystery.


----------



## kpedersen (Jul 12, 2021)

aragats said:


> Where do you see any reference to Xorg in the OP?


It isn't very clear but the following is a hint.



balanga said:


> I just assumed that the keyboard definition on installation automatically applied to xorg...



These days I just assume people are talking about Xorg because generally if you are looking for help with the VT, you have probably been with UNIX-like platforms for a while and are very familiar with manpages.


----------



## vometia (Jul 19, 2021)

kpedersen said:


> ... generally if you are looking for help with the VT, you have probably been with UNIX-like platforms for a while and are very familiar with manpages.


I spent ages trying to figure out how to get a compose key working on the console.  Obviously with the very specific requirement, "it doesn't seem to be there so it _'needs'_ to be!" and only succeeded in giving myself a headache.  I eventually gave up as it didn't look like it would be straightforward even if I wrote my own tables.  But I also have a habit of looking at the wrong things, so y'know.

Er, I should also point out this isn't a particularly an even remotely serious request before I manage to add another new and exciting tangent to the topic!


----------



## astyle (Jul 19, 2021)

vometia said:


> I spent ages trying to figure out how to get a compose key working on the console.  Obviously with the very specific requirement, "it doesn't seem to be there so it _'needs'_ to be!" and only succeeded in giving myself a headache.  I eventually gave up as it didn't look like it would be straightforward even if I wrote my own tables.  But I also have a habit of looking at the wrong things, so y'know.
> 
> Er, I should also point out this isn't a particularly an even remotely serious request before I manage to add another new and exciting tangent to the topic!


Dunno if this helps, but:









						Compose key - Wikipedia
					






					en.wikipedia.org
				



 A good place to get started

and









						How to define a Compose Key in terminal (no desktop environment)?
					

I would like to define a compose key on my system (Debian Sid "Wheezy"). I have no Xorg (and don't want any desktop environment). Only in terminal.  I would like to set it up on my Alt-Gr key (righ...




					unix.stackexchange.com
				




This is where I'd look. Obviously, you'd need to adjust for FreeBSD if that's the OS you have installed.


----------



## vometia (Jul 19, 2021)

Thanks.  I have it working in X-windows (and even MS Windows using... er, I can't quite remember, Sharpkeys or something like that), it was just a case of "it's not there and it should be!"  A quick and largely uninformed glance suggests that the VT driver probably doesn't support it, but as I only use the console for upgrades (or if the network is having a bad hair day) it's not important and I should look at least slightly shame-faced for being irrelevant in somebody else's topic...

Edit: oh yeah, nearly forgot, I think it was that "Linux does it and FreeBSD is better, so..." which led to my spate of misadventure.


----------



## astyle (Jul 19, 2021)

vometia said:


> Thanks.  I have it working in X-windows (and even MS Windows using... er, I can't quite remember, Sharpkeys or something like that), it was just a case of "it's not there and it should be!"  A quick and largely uninformed glance suggests that the VT driver probably doesn't support it, but as I only use the console for upgrades (or if the network is having a bad hair day) it's not important and I should look at least slightly shame-faced for being irrelevant in somebody else's topic...
> 
> Edit: oh yeah, nearly forgot, I think it was that "Linux does it and FreeBSD is better, so..." which led to my spate of misadventure.


I'd suggest that you don't worry about the 'VT driver', and focus on config files for keyboard maps. VT stands for Virtual Terminal. FreeBSD will generally support any USB (and most older PS/2, FWIW) keyboard on the market, just plug it in, and forget it.  If you have a US keyboard, a generic US keymap will do. Just take a look at what your physical keyboard layout looks like - QWERTY or DVORAK... Editing the config file for the correct keyboard map (a.k.a. keymap) will give you the Compose key. Finding the correct config file - that will be different on FreeBSD than on Linux.


By default, when you boot up, you'll have 8 Virtual Terminals available. But that's a separate topic from keyboards.


----------



## vometia (Jul 19, 2021)

astyle said:


> I'd suggest that you don't worry about the 'VT driver', and focus on config files for keyboard maps. VT stands for Virtual Terminal. FreeBSD will generally support any USB (and most older PS/2, FWIW) keyboard on the market, just plug it in, and forget it.  If you have a US keyboard, a generic US keymap will do. Just take a look at what your physical keyboard layout looks like - QWERTY or DVORAK... Editing the config file for the correct keyboard map (a.k.a. keymap) will give you the Compose key.
> 
> 
> By default, when you boot up, you'll have 8 Virtual Terminals available. But that's a separate topic from keyboards.


Oh, that's a good point, I nearly forgot that I have an actual VT320 terminal in the garage, a relic from my time at DEC (blimey, was it really 25 years ago?  Yikes) which has a compose key on it.  Somebody even made me a serial cable with the DEC "like an RJ45 but more wonky" connectors too, so I have no excuses.  Well, apart from the mound of stuff I'd need to climb over to get it.

And an... erm, LK401 or whatever the PC keyboard was.  But it's a PS/2 and has a sort of "genuine mushy rubber-dome" key feel.  I have PS/2-USB converter but not one that does mushy-to-clicky.

Edit: various mistakes; the weather's too hot to think.


----------



## astyle (Jul 19, 2021)

vometia said:


> Oh, that's a good point, I nearly forgot that I have an actual VT320 terminal in the garage, a relic from my time at DEC (blimey, was it really 25 years ago?  Yikes) which has a compose key on it.  Somebody even made me a serial cable with the DEC "like an RJ45 but more wonky" connectors too, so I have no excuses.  Well, apart from the mound of stuff I'd need to climb over to get it.
> 
> And an... erm, LK401 or whatever the PC keyboard was.  But it's a PS/2 and has a sort of "genuine mushy rubber-dome" key feel.  I have PS/2-USB converter but not one that does mushy-to-clicky.
> 
> Edit: various mistakes; the weather's too hot to think.


LK401? That's a good place to start. Try googling this term: "LK401 freebsd keymap". Also: If you just plug the keyboard in, and then boot up, FreeBSD will most likely take it. The keyboard may not work perfectly from get-go, but that's what config files are for. `# /sbin/updatedb`, followed by `# locate` should be helpful.


----------

