# Norwegian Keyboard



## Psypro (Dec 8, 2015)

Hi

I tried again still no support for Norwegian letters like ø. æ. å.
Wikipedia link, try to make that letter yourself, should be close to the enter key of the keyboard : https://en.wikipedia.org/wiki/Æ

I have tried FreeBSD 10 some time ago, and tried FreeBSD 11 today. 

At installment when testing keyboard, these keys does not work.
When entering login information, the keys does work!!!!!
After login in the keys does not work.
Root user gives a text 1013/1130 when hitting the key (something like that just made that up some numbers)
Normal user gives a "Beep sound" when hitting the key
Tried adding a user with CSH shell, does not work there either.

I tried with two different keyboards.
Microsoft 2000 wireless
Reboot, and then
Lenevo OEM USB keyboard

Nr1: For a OS that prides it self with a well working core system, if find I strange that such basic functionality as keymap shows so weak functioning.
Nr2: That a know error is not dealt with in an timely manner. Years has past and same problem.


----------



## tobik@ (Dec 8, 2015)

Have you setup your system as described in the Handbook https://www.freebsd.org/doc/handbook/l10n.html and https://www.freebsd.org/doc/handbook/x-config.html#x-config-input-keyboard ?


----------



## Psypro (Dec 8, 2015)

I recommend the installation system and "base system" just work, with out hacking, and editing files. 
And, is it not prof enough that the installation program even cant handle the keys. I can hardly imagine that is the way the install program was designed.
I see it as a bug, that the test program for keyboard in the Freebsd install, fails to correctly show Norwegian keys. That is rather underwhelming, and defending is this weak functionality, I think belittle FreeBSD.
Similar I see it as a bug, when Freebsd base system, fails to apply local setting from installation consistently. Apply correct keymap to login procedure, but fails to apply it for shell.

Tanks for the replay BTW, read those handbook last time. I had hoped thing has improved since last time.


----------



## Psypro (Dec 8, 2015)

It works in Nano.
I have not changed anything.


----------



## chrbr (Dec 8, 2015)

Are you aware of https://wiki.freebsd.org/Newcons?
If you add this to /boot/loader.conf

```
kern.vty=vt
```
special characters might work as expected. See sc(4) and vt(4). Everythingis still not perfect but may be it suits your needs. The issue is screen resolution. Please dig for other threads related to vt or newcons, too. I guess you have just not found the right keywords. Good luck and success, . The other path would be to use sc(4) and luit(1) (select release+ports to find the man page) for some stuff, but this should be not really future proof.


----------



## Juha Nurmela (Dec 8, 2015)

Both sc(4) and vt(4) work fine with nordic characters (maybe with all accented ones). The problem is that the selection done while installing, does not propagate to all required places. There aren't many, just 3 places, so IMHO it isn't a big deal.

I know Psypro isn't asking for help, but anyway, pike is a fish

/etc/rc.conf

```
keymap="fi.kbd"
allscreens_flags="-f gallant.fnt"
```
/etc/login.conf
After edit, run `cap_mkdb /etc/login.conf`.

```
default:\
  :charset=iso-8859-1:\
  :lang=en_US.ISO8859-1:\
```
/usr/local/etc/X11/xorg.conf.d/keyboard.conf

```
Section "InputClass"
  Identifier  "KeyboardDefaults"
  Driver  "keyboard"
  MatchIsKeyboard "on"
  Option  "XkbLayout" "fi"
EndSection
```

Run `cap_mkdb /etc/login.conf` if you did not already.

fi, se, no, dk, ...

Juha


----------



## Psypro (Dec 11, 2015)

Thank you both for your encouragement, and sharing knowledge with a fresh user. I went back, and gave it another try. This time, writing from FreeBSD Xfce4!

Still I think I want to report what I see as a bug in the install.
The test keyboards script in bsdinstall(8), fails to show Norwegian specific keys


----------



## Psypro (Dec 11, 2015)

Juha Nurmela said:


> Both sc(4) and vt(4) work fine with nordic characters (maybe with all accented ones). The problem is that the selection done while installing, does not propagate to all required places. There aren't many, just 3 places, so IMHO it isn't a big deal.
> 
> I know Psypro isn't asking for help, but anyway, pike is a fish
> 
> ...



Still does not work : (
Followed every step.

Now I have ,å.æ in Xfce4
But still not inside vi(1) or shell, or xterm(1).


----------



## Psypro (Dec 11, 2015)

Tried yours exact, now trying with these. Still no shell, å, æ.
Works in xfce4.

A part from my Login.conf

```
default:\
:charset=UTF-8:\
  :lang=nb_NO.UTF-8:\



    :passwd_format=sha512:\
    :copyright=/etc/COPYRIGHT:\
    :welcome=/etc/motd:\
    :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\
    :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\
    :nologin=/var/run/nologin:\
    :cputime=unlimited:\
    :datasize=unlimited:\
    :stacksize=unlimited:\
    :memorylocked=64K:\
    :memoryuse=unlimited:\
    :filesize=unlimited:\
    :coredumpsize=unlimited:\
    :openfiles=unlimited:\
    :maxproc=unlimited:\
    :sbsize=unlimited:\
    :vmemoryuse=unlimited:\
    :swapuse=unlimited:\
    :pseudoterminals=unlimited:\
    :kqueues=unlimited:\
    :priority=0:\
    :ignoretime@:\
    :umask=022:
```

rc.conf


```
hostname="BSD"
keymap="no"
ifconfig_re0="DHCP"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
allscreens_flags="-f gallant.fnt"
```


----------



## Psypro (Dec 11, 2015)

https://forums.freebsd.org/threads/how-to-change-keyboard-mapping-in-the-console.50104/#post-280286

First, to have UTF-8 you need a vt(4) console, for this you need to add
kern.vty="vt"kern.vty=vt to your /boot/loader.conf

Next, in your /etc/rc.conf you must have keymap="es"keymap=es

In /etc/login.conf you need to add at least this:


```
spanish|Spanish Users Accounts:\
:charset=UTF-8:\
:lang=es_ES.UTF-8:
```

Then in terminal run: `# cap_mkdb /etc/login.conf`

And finally: `# pw user mod root -L spanish`
if you want to add spanish letters for some other user, just change root to user login name, for example:
`# pw user mod macondo -L spanish`
After reboot you should have Spanish signs."

This worked for me, using Norwegian values as shown in previous post.


----------



## Juha Nurmela (Dec 11, 2015)

That's funny. Maybe I forgot something or fi/no is somehow different. I did praise vt(4) bit too much. Swedish characters are ok, but shifting by _AltGr_ does not produce ø æ like it does under X11.

Notice the *en_US* there, that's to keep normal system messages. Else there will be a mixture of localized and english messages from different programs. I find it really confusing. You can see the options in /usr/share/locale/. 

Related environment variables on xterm, you don't need to set them all explicitly, it's automatic

```
hopo $ env
XTERM_VERSION=XTerm(320)
MM_CHARSET=iso-8859-1
LANG=en_US.ISO8859-1
TERMCAP=xterm|X11 terminal emulator:......snip
XTERM_LOCALE=en_US.ISO8859-1
```

This on the text console

```
MM_CHARSET=iso-8859-1
LANG=en_US.ISO8859-1
```

This should be ok, but let's check anyway

```
hopo $ stty -a
...
cflags: cread cs8
```


Juha


----------



## Juha Nurmela (Dec 11, 2015)

`cap_mkdb`. Aaargh  forgotten command added to the recipe now.

Juha


----------



## tingo (Dec 11, 2015)

Psypro: just a check - you are installing on a physical machine, right? Not on a virtual machine in VirtualBox or some other virtualization engine?


----------



## Juha Nurmela (Dec 11, 2015)

Check and remove those extra lines in /etc/login.conf, the ancient file format is unforgiving. No blanks after the backslashes either.


```
default:\
:charset=UTF-8:\
:lang=nb_NO.UTF-8:\



:passwd_format=sha512:\
```

Juha


----------



## tingo (Dec 12, 2015)

Psypro said:


> I tried again still no support for Norwegian letters like ø. æ. å.
> Wikipedia link, try to make that letter yourself, should be close to the enter key of the keyboard : https://en.wikipedia.org/wiki/Æ
> 
> I have tried FreeBSD 10 some time ago, and tried FreeBSD 11 today.
> ...


Actually, I did see this yesterday, while I was installing FreeBSD 10.2-release from the UEFI memstick image onto my new (uefi) laptop. Normally, I don't bother with testing the keyboard, I just select a Norwegian keyboard layout and continue. But I had this thread in memory, and decided to try testing the keyboard as well. And Psypro is correct; the æ, ø and å characters do not show up in the input field when you press the corresponding keys on the keyboard. Is there an existing PR for this?

After the installation, everything works.


----------



## Juha Nurmela (Dec 12, 2015)

Same happens here, trying on an existing system with `bsdinstall keymap`. `dialog` works funny, it does not show _åäö_ in the input box (lind ke), but prints the correct typed input out (lind åke) later, after pressing OK. It starts to work if  things are changed from 8859 to UTF8.

I see vt(4) does only UTF8. That's sensible. dialog(1) seems to use strlen(3) for cursor positioning though and even splits characters between screen writes. *^L* paints the input buffer in one go.

Juha


----------

