4

I may be abusing the word console but I mean the mode without X i.e. pressing ^+Alt F1 and then log as other user where I want to use my chosen layout with USB keyboard.

X works, it configures the new USB keyboard to my choice when I plug it in. But the console keyboard layout is stuck to the setting specified by the kernel. I am trying to change that:

# usbhidctl -f /dev/uhid0 -w keyboard.encoding=us                                       
usbhidctl: Failed to match: keyboard.encoding

Some info about the OpenBSD version:

# uname -rv
4.7 GENERIC.MP#449

2 Answers 2

6

Does

wsconsctl keyboard.encoding=us

work?

If yes, put that in /etc/wsconsctl.conf to make it persistent.

Or are you saying that that would only work for PS/2 keyboards? Maybe enabling USB legacy keyboard mode in the BIOS would help in that case?

wsconscfg -k

may also be of use.

Perhaps you need to change the device from

/dev/uhid0

to something like

/dev/wskbd0

or

/dev/wskbd1
7
  • ...almost downvoting but wsconsctl is not for manipulating usb hid devices. It is the usbhidctl -command. Forgive me if I am wrong but it is my understandig, currently... you may be on the right track. Can you clarify the last point you added? Commented Apr 19, 2011 at 22:37
  • @hhh: Your question does not state that assumption. Did you already try wsconscfg -k, usbhidctl -f /dev/wskbd1 ...? Commented Apr 19, 2011 at 22:38
  • wscons has supported USB devices since 2001. Did you even try this? Commented Apr 19, 2011 at 22:41
  • @Mikel: sorry my question may be misleading but by usb console keybord I mean that I want to get just plugged usb-keyboard working in my specified layout. I tried "-f /dev/uhid0" to manipulate the keyboard, not wskbd1 haven't done such redirection. Commented Apr 19, 2011 at 22:43
  • wscons is supposed to support USB keyboards, so I suggest finding the /dev/wskbd<number> that corresponds to your keyboard (or using wsconscfg to create such a device if it does not already exist), then try wsconsctl on it. Commented Apr 19, 2011 at 22:49
0

Solution that works in the LiveCD environment

wsconsctl(8) is not included in the LiveCD environment, but kbd(8) is included. It is also easier to remember how to use it.

kbd us  # Set the keyboard layout.
kbd -l  # List possible keyboard layouts.

You will need to edit /etc/wsconsctl.conf to make the change persistent.

Source: OpenBSD FAQ - Keyboard and Display Controls

You must log in to answer this question.