Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jun 2021 06:53:49 +0900 (JST)
From:      Yasuhiro Kimura <yasu@utahime.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Keymapping erased when disconnecting/connecting keyboard
Message-ID:  <20210630.065349.1086999653536948054.yasu@utahime.org>
In-Reply-To: <tdeYojrRuJdb1LcX4FtLr5aK9CJlAxIP8NWMf-huyeNUBHv2oIuvkcnduUtwXPUK8N6EkE6TNeEARElIdXOKH0fmRz-91YPR4V14dMeiOls=@protonmail.com>
References:  <tdeYojrRuJdb1LcX4FtLr5aK9CJlAxIP8NWMf-huyeNUBHv2oIuvkcnduUtwXPUK8N6EkE6TNeEARElIdXOKH0fmRz-91YPR4V14dMeiOls=@protonmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
From: Kristofer via freebsd-questions <freebsd-questions@freebsd.org>
Subject: Keymapping erased when disconnecting/connecting keyboard
Date: Mon, 28 Jun 2021 17:17:57 +0000

> I have another issue that I have not seen before FreeBSD 13.0. I frequently unplug the keyboard to use on another machine and I have been doing this for many years on older FreeBSD installations without any issues. Now with 13.0, every time I plug in the keyboard again, I have US keymap and it ignores the setting I have in /etc/rc.conf. locale is also unmodified, as epxected. The kaymap is correctly set to Swedish keymap when I log in, but as soon as I remove/re-add the keyboard, it is lost.
> On top of that, I haven't been able to figure out how to get get the keymap back without rebooting the machine. There has got to be some simple thing I'm missing here.
> For reference, the keyboard in question is identified this way in /var/log/messages in case that makes any difference to how I should solve it
> 
> kernel: ukbd0: <Lenovo ThinkPad Compact USB Keyboard with TrackPoint, class 0/0, rev 2.00/3.30, addr 4> on usbus3
> 
> TIA,
> Kristofer

If you change keyboard settings by setting such variables as keymap,
keyrate, keybell, etc. in /etc/rc.conf, then you can restore the
status of boot time by executing `service syscons restart` with root
privilege.

There are two points to note.

1. This restores settings of console, i.e. either vt(4) or syscons(4).
   If you want to restore that of X server, I'm not sure if you can
   restore without restarting it.
2. Keep in mind terminating X server before executing the command.
   Though I have never tried it, it is very likely it results in
   chaotic situation if you forgot it.

---
Yasuhiro Kimura



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210630.065349.1086999653536948054.yasu>