NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: USB-keyboard with a non-standard layout in wscons. Solved!



Thanks for your answers.  Everything is now solved
even under NetBSD 5.1!

On Mon, Jun 29, 2015 at 5:15 AM, Dan LaBell <dan4l-nospam%verizon.net@localhost> wrote:
>
> On Jun 27, 2015, at 8:08 AM, Hans dinsen-hansen wrote:
>
>> Dear list.
>>
>> Thanks for all your mails.  I sat he whole morning and
>> 1)  made a safety dump of my NetBSD.
>> 2) Built as lot of kernels and tested them with dmesg.
>>     All of them invented a wskbd0 ;-(  even if I told them
>>     to ignore pckb* with more and more #-lines.
>>
> In your kernel do you have?
> options         WSDISPLAY_COMPAT_PCVT         # emulate some ioctls
> options         WSDISPLAY_COMPAT_USL          # VT handling
> options         WSDISPLAY_COMPAT_RAWKBD       # can get raw scancodes
> # don't attach pckbd as the console if no PS/2 keyboard is found
> options         PCKBD_CNATTACH_MAY_FAIL
> options        UKBD_LAYOUT="(KB_DK | KB_NODEAD)"  # for ukbd driver
>
> Have you tried the generic kernel, the one that from your initial install,
> not one you built?  This may be a stupid question, but are you doing do a
> make clean between builds?
> I connected a Pazzport, which is a mouse keyboard combo
> ----
> wsdisplay0: screen 5 added (80x50, vt100 emulation)
> uhidev0 at uhub1 port 2 configuration 1 interface 0
> uhidev0: iPazzPort iPazzPort, rev 2.00/1.00, addr 2, iclass 3/1
> uhidev0: 2 report ids
> ums0 at uhidev0 reportid 1: 3 buttons and Z dir
> wsmouse0 at ums0 mux 0
> uhid0 at uhidev0 reportid 2: input=2, output=0, feature=0
> uhidev1 at uhub1 port 2 configuration 1 interface 1
> uhidev1: iPazzPort iPazzPort, rev 2.00/1.00, addr 2, iclass 3/1
> ukbd0 at uhidev1
> wskbd1 at ukbd0 mux 1
> wskbd1: connecting to wsdisplay0
> -----
> and I discovered they keycodes are quite different for the usb, starting
> at 4, and escape being 41 etc.
> Also, discovered I can select which keyboard with
>  wsconsctl -f /dev/wskbd1.
> Anyway way, I was able to select dk.nodead for the usb keyboard,
> and change a key, and it didn't trash it.
> I'm running 5.2, but plan to update to 5.2.3 soon.

I built a new kernel with the suggestions, Dan gave me.
I had no success with changing the meaning of keycode 49.
However, I noticed that the key gave the lower case
symbol whether i pressed the upper case button or not.

I also noticed that Ctr-Alt-Fn wrote something like "^[[19~"
on the screen.

I got the idea that perhaps keys as Ctr, Shift, Enter, &c
were disabled through my setting of one single re-mapping.
I created a mapfile, edited and saved it in /usr/local and
installed it through /etc/wscons.conf.  And suddenly everything
worked!

As documentation I'll show a diff between kernel configurations,
a line from my /etc/wscons.conf and parts of my mapfile.

diff GENERIC Kun_USB_kbd # "kun" is Danish for only.
3c3
< # GENERIC machine description file
---
> # Kun_USB_kbd machine description file
233c233,236
< #options     PCKBD_LAYOUT="(KB_DE | KB_NODEAD)"
---
> #options     PCKBD_LAYOUT="(KB_DK | KB_NODEAD)"
> # don't attach pckbd as the console if no PS/2 keyboard is found
> options         PCKBD_CNATTACH_MAY_FAIL
> options         UKBD_LAYOUT="(KB_DK | KB_NODEAD)"  # for ukbd driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
My /etc/wscons.conf contains:
---- <snip> -------------------
mapfile /usr/local/share/wscons/keymaps/usbkbd
---- <snip> -------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The mapfile contains a full map:
keycode 4 = a A
---- <snip> -------------------
keycode 49 = apostrophe asterisk
keycode 50 = apostrophe asterisk
---- <snip> -------------------
keycode 230 = Mode_switch Multi_key
keycode 231 = Meta_R
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thank you for all your help.

    Hans Dinsen-Hsansen


Home | Main Index | Thread Index | Old Index