ABNT2 Keyboard

neebz

New Member

Reaction score: 2
Messages: 19

Hi, im new here (and with Freebsd), and I'm having trouble making my keyboard (br abnt2) work and my cli show characters like "ã".
keybord shorcuts like alt + q to "/" and alt + w to "?" don't work.

my /etc/rc.conf
have:
Code:
keymap="br.kbd"

my: /boot/loader.conf
have:
Code:
kern.vty="vt"

i edited: /etc/login.conf
to:
Code:
:charset=UTF-8:\
:lang=pt_BR.UTF-8:

and: /etc/profile
to:
Code:
LANG=pt_BR.UTF-8; export LANG
CHARSET=UTF-8; export CHARSET

my ~/.xinitrc
have:
Code:
setxkbmap -model abnt2 -layout br
(which for some reason does not change the default keyboard in xfce)

And yes, I have read the freebsd handbook, I also looked for threads on the forum and I still have difficulties.
 
Last edited:

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

i edited: [file/etc/login.conf[/file]
to:
Code:
:charset=UTF-8:\
:lang=pt_BR.UTF-8:
Have you run afterwards cap_mkdb /etc/login.conf ? And the user must log out, then log in to take effect of the new locale.
 

rigoletto@

Daemon
Developer

Reaction score: 1,256
Messages: 2,296

my /etc/rc.conf
have:
Code:
keymap="br.kbd"
Try: keymap="br"

I set keyboard for X like this:

Code:
Section "InputClass"
        Identifier "KeyboardDefaults"
        MatchIsKeyboard "on"
        Option "XkbLayout" "br"
        Option "XkbModel" "abnt2"
        Option "XkbVariant" "abnt2"
EndSection
 
OP
N

neebz

New Member

Reaction score: 2
Messages: 19

rigoletto@

Daemon
Developer

Reaction score: 1,256
Messages: 2,296

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

so... I need to create a custom map to use a abnt2 keyboard on console?
Not necessarily. To get 'ã' character in console with the default keymap, on a ABNT2 Keyboard the 'ã' +'a' keys needs to be pressed.

If you want one key press 'ã' then yes. The keymap needs to be modified.

Move /usr/share/vt/keymaps/br.kbd to, i.e br.kbd.orig, copy br.kbd.orig to br.kbd, edit br.kbd. Change
Code:
040   dtil   dcir   nop    nop    dtil   dcir   nop    nop     O
to
040   0xe3   0xc3   nop    nop    dtil   dcir   nop    nop     O
When saving, the file is write protected, or make it writable or when in vi(1) :w!,

I haven't figured out how to Alt+Q = / but I could look into it.

Detailed explanation of map file format in kbdmap(5),
 
OP
N

neebz

New Member

Reaction score: 2
Messages: 19

you mean "~"+"a"?

so, let me understand this: there is no
Code:
keymap=something
that will make things work like the default abnt2? with the "~"+"o" and alt shortcus and everything else?
 

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

you mean "~"+"a"?
I see. I got mislead by this article.

so, let me understand this: there is no
keymap=something
that will make things work like the default abnt2? with the "~"+"o" and alt shortcus and everything else?
"~" + "o" and "~" + "a" are working out of the box in the console (13.0). Remove all what you have modified in
Code:
- /boot/loader.conf # that one is not related to the problem but
   vt(4) is standard, no need to specify it explicitly
- /etc/profile

If the LANG environment is set in /etc/login.conf for system wide then there is no need to specify it again in the login shells, any login shells, global or local configuration file. If the user wants to override the global environment locally for his account this is best done, shell independent, in ~/.login_conf.

For the other missing key mappings, as it looks like the current br.kbd key map needs some modification. It's not a big deal, just edit the lines shown below.

Note: The modifier key is AltGr (Alt Graph) not Alt.
Code:
For  '/'  by AltGr + q
For  '?'  by AltGr + w

# vi /usr/share/vt/keymaps/br.kbd

edit
016   'q'    'Q'    dc1    dc1    'q'    'Q'    dc1    dc1     C
to
016   'q'    'Q'    dc1    dc1    '/'    '/'    dc1    dc1     C

017   'w'    'W'    etb    etb    'w'    'W'    etb    etb     C
to
017   'w'    'W'    etb    etb    '?'    '?'    etb    etb     C

:wq!

# kbdcontrol -l br
If there is something else missing drop a note.
 
OP
N

neebz

New Member

Reaction score: 2
Messages: 19

perhaps is something that has to be changed about the fonts on the terminal then? 'cause "~"+"a" and "~"+"o" still show "?" and "?" on the screen
 

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

perhaps is something that has to be changed about the fonts on the terminal then?
There is no specific font needed.

In virtual terminal console only the following two requirements are needed to have those special Brazilian Portuguese characters displayed ('~' + 'a' and '~' + 'o'):

  1. Key map set to 'br'
  2. LANG environment must be set to UTF-8 to the login shell, which is default from 13.0 upwards. In 12.2 it must be set retrospectively
Assuming the user is added with the 'default' login class to the system, then /etc/login.conf must have set UTF-8 variables there:
Code:
default:\
        ...
        :charset=UTF-8:\
        :lang=C.UTF-8:
On 12.2, after editing login.conf, cap_mkdb /etc/login.conf must be executed, the user must log out and log in to make the new localization take effect.

If there is the need of a localization other then US, meaning, time, numeric, monetary, messages, then a country specific LANG UTF-8 environment can be set, i.e. pt_BR.UTF-8, but it is not a requirement to display those characters, the above variables in login.conf are sufficient.

This is a screenshot of a virtual console in 13.0-RELEASE, 'br' key map set, 104-key PC keyboard ( / and ? are printed by pressing AltGr+Q and AltGr+W with the modified br.kbd key map):

pt_BR-tconsole.png

If there are other LANG environment settings somewhere else on your system, set global or per user, make sure to remove them.
 

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

Sorry neebz, I've overlooked your post (I've put the thread on 'watch' now).

The font in use in vt(4) is the default font of 12.2 and 13.0 (Terminus Font I believe). I haven't set a specific font. It's not needed to have the Brazilian Portuguese characters displayed.

On 12.2 and 13.0 all what is needed to display them is to have set keymap=br and the login shell to UTF-8. UTF-8 on 12.2 must be set after installation manually, preferable in login.conf (or ~/.login_conf), on 13.0 upwards it's default.

Do you have reverted (removed) all localization modifications in the shells global or per user base configuration files? There should be only in /etc/login.conf or the users ~/.login_conf lang and charset variables set.

What does env | grep 'LANG\|CHARSET' return?
 
OP
N

neebz

New Member

Reaction score: 2
Messages: 19

- FreeBSD 13 fresh install
- modified the login_conf
- cap_mkdb login_conf
- env | grep 'LANG\|CHARSET' returns

LANG=pt_BR.UTF-8
MM_CHARSET=UTF-8

ã and õ still not working
 

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

I 'm unable to reproduce on my system, it just works out of the box, in a VM or on bare metal:

- FreeBSD 13.0-RELEASE
- a 104-key PC keyboard (not ABNT2 keyboard)
- kbdcontrol -l br
- ã Ã õ Õ in console are printed as shown in screenshot of post #14

Maybe the ABNT2 keyboard is not fully supported. Have you tried with a non-ABNT2 keyboard (ABNT, 104/105-key PC)?
 
OP
N

neebz

New Member

Reaction score: 2
Messages: 19

If the abnt2 standard is not fully supported yet in 2021 this is quite discouraging for us =\ here in Brazil basically there are almost no one still using the "abnt1".

I don't want to be that annoying guy who will compare FreeBSD with other systems but it would be more interesting for us brazilian users to simply have the abnt2 option on the installation screen and that by default this would enable characters like "ã" and "õ" on terminal.

I can understand if I don't have complete language support in all applications, English is good enough for me. Not having support for abnt2 and these characters is another story =\

"Brazilian (accent keys)" and "Brazilian (without accent keys)" sounds veeeery strange for us. I don't know if i can ask to change that but Brazilian (ABNT) and Brazilian (ABNT2) should be the options.

Once again: I don't want to be that annoying guy, in fact I wouldn't have a problem asking and helping with support in this regard but I really don't know how to do it.

If someone has a way on how to adjust this without having to log in to an interface, I will gladly eat humble pie and remove what I said without any problem but I must admit that this kind of thing has been quite discouraging in dealing with freebsd =\
 

rigoletto@

Daemon
Developer

Reaction score: 1,256
Messages: 2,296

I switched to vt (I normally use sc due to nvidia) console and IIRC ã and õ were working fine on it (I will try again later). Also, sometimes you tell it doesn't work on console and others on terminal, those are different things that need different solutions. Are you talking about console (no graphic interface at all) or (a graphic, X) terminal?

If this is a terminal try it: setxkbmap -model abnt2 -variant abnt2 -layout br

[EDIT]
If you are using Wayland, I have no idea of how it work.
 

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

Are you talking about console (no graphic interface at all) or (a graphic, X) terminal?
We are talking about console.

Off-topic:
I switched to vt (I normally use sc due to nvidia)
If you are running 13.0 or CURRENT there is a patch (provided by Alex S aka shkhln) which might resolve garbled vt console with NVIDIA. I have myself an NVIDIA with the mentioned problem but I have no need to switch to vt console when running xorg, therefore didn't tried the patch yet.
 

T-Daemon

Daemon

Reaction score: 926
Messages: 1,813

If the abnt2 standard is not fully supported yet in 2021 this is quite discouraging for us
We don't know yet if the hardware is the source of the problem, it's only a assumption, therefore I asked if you have another keyboard.

In case the characters are printed with that keyboard then there is confirmation the hardware (ABNT2 keyboard) is the problem. Or the characters are not printed then there might be a misconfiguration.

But it's highly likely there is a misconfiguration on your side. If rigoletto recalls correctly those characters work fine.
 

rigoletto@

Daemon
Developer

Reaction score: 1,256
Messages: 2,296

The only thing needed is setting keymap="br" on /etc/rc.conf, since LANG and CHARSET are already set to some UTF-8 by default on /etc/login.conf.

If this is not working I assume some some hardware issue/incompatibility.
 
Top