Bug 247465 - base system/kern after update to xorg-server-1.20, Sun keys are > not recognized
Summary: base system/kern after update to xorg-server-1.20, Sun keys are > not recognized
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Vladimir Kondratyev
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2020-06-21 20:32 UTC by Kostas Oikonomou
Modified: 2020-07-11 00:32 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kostas Oikonomou 2020-06-21 20:32:45 UTC
Hello,

I have been using a Sun type 6 USB keyboard for a long time with my FreeBSD
system.
After the update to xorg-server-1.20, the Sun-specific keys on the left of the
keyboard are no longer recognized.


Here is the output of setxkbmap:


[ko@wiley ~]$ setxkbmap -print
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include
"pc+sun_vndr/us+sun_vndr/gr(simple):2+inet(evdev)+group(menu_toggle)"	};
	xkb_geometry  { include "sun(type6unix)"	};
};
[ko@wiley ~]$ 


And here is what libinput debug-events --verbose --show-keycodes reports, first
pair of columns, 
and what xev reports, second pair of
columns:Stop   KEY_POWER      116    Xf86PowerOff    124
Again  KEY_SLEEP      142    XF86Sleep       150
Props
Undo
Front
Copy   KEY_WAKEUP     143    XF86Wakeup      151
Open
Paste  KEY_SEARCH     217    XF86Search      225
Find   KEY_BOOKMARKS  156    XF86Favorites   164
Cut    KEY_REFRESH    173    XF86Reload      181
A) I've tried to fix some mappings, e.g. the Copy key, by doing

xmodmap -e "keycode 143 = XF86Copy"

but this doesn't work. Similarly for Paste, etc.

B) You can see that the important keys Open, Front, and Undo produce no keycodes
at all.


C) I had previously posted this question to the X11 forum. It resulted in a long
discussion, but no resolution.
Please see below:


https://forums.freebsd.org/threads/sun-keyboard-and-xorg-server-1-20-freebsd-12-1-xfce-4-12.75521/


Any help would be appreciated.

Kostas
Comment 1 Vladimir Kondratyev freebsd_committer 2020-06-21 21:13:16 UTC
Please, dump your keyboard USB report descriptor and left key scancodes.

Add

hw.usb.quirk.0="0xVID 0xPID 0 0xffff UQ_KBD_IGNORE"

to /boot/loader.conf and reboot. It will effectively replace your keyboard with generic HID driver (uhid). 0xVID and 0xPID should be replaced with your keyboard vendor ID and product ID (in hex)

Than dump USB report descriptor with 'sudo usbhidctl -f /dev/uhidX -r' and scncodes with 'sudo usbhidctl -f /dev/uhidX -la' command. You should press the keys while running latter command. Please post results here.
Comment 2 Kostas Oikonomou 2020-06-22 15:21:59 UTC
(In reply to Vladimir Kondratyev from comment #1)
I did the first step, with keyboard id 0x0430 and vendor id 0x0005. 

Unfortunately, after rebooting, this deactivated my keyboard, so I could not do anything. The Sun keyboard was completely inactive (even in sigle user mode).

I have a wireless USB keyboard, and plugging that in allowed me to comment out the change in loader.conf and fix the situation.
Comment 3 Vladimir Kondratyev freebsd_committer 2020-06-22 15:51:39 UTC
(In reply to Kostas Oikonomou from comment #2)
Unfortunately, after rebooting, this deactivated my keyboard,

That is expected. I should have warned you. Sorry. You need 2-nd keyboard or ssh session to test 1-st keyboard with usbhidctl.

Alternatively, you can replace usb keyboard driver with https://github.com/wulf7/iichid as it exports uhid-compatible character device as /dev/hidrawX and allows usbhidctl attachment with live keyboard.
Comment 4 Vladimir Kondratyev freebsd_committer 2020-06-22 15:54:11 UTC
(In reply to Vladimir Kondratyev from comment #3)
> Alternatively, you can replace usb keyboard driver
> with https://github.com/wulf7/iichid as it exports
> uhid-compatible character device as /dev/hidrawX and
> allows usbhidctl attachment with live keyboard.

Forget it. You need 12-STABLE or 13-CURRENT to get keyboard work this way.
Comment 5 Kostas Oikonomou 2020-06-22 17:54:01 UTC
(In reply to Vladimir Kondratyev from comment #4)

Using the 2nd keyboard I did

[ko@wiley ~]$ sudo usbhidctl -f /dev/uhid0 -r > usb_report_descriptor0
[ko@wiley ~]$ sudo usbhidctl -f /dev/uhid1 -r > usb_report_descriptor1

The files usb_report_descriptor0 and usb_report_descriptor1 are at the end.

Then I did

[ko@wiley ~]$ sudo usbhidctl -f /dev/uhid0 -la > codes0
usbhidctl: hid_get_report(rid 0): Device not configured

^C
[ko@wiley ~]$ sudo usbhidctl -f /dev/uhid1 -la > codes1
usbhidctl: hid_get_report(rid 32): Device not configured
usbhidctl: hid_get_report(rid 33): Device not configured
usbhidctl: hid_get_report(rid 16): Device not configured
usbhidctl: hid_get_report(rid 17): Device not configured
usbhidctl: hid_get_report(rid 32): Device not configured
usbhidctl: hid_get_report(rid 33): Device not configured
^C
[ko@wiley ~]$ 

The files codes0 and codes1 are empty.

=========================================================================

[ko@wiley ~]$ cat usb_report_descriptor0
Report descriptor:
Collection type=Application page=Generic_Desktop usage=Keyboard
Input   rid=0 pos=0 size=1 count=1 page=Keyboard usage=Keyboard_LeftControl, logical range 0..1
Input   rid=0 pos=1 size=1 count=1 page=Keyboard usage=Keyboard_LeftShift, logical range 0..1
Input   rid=0 pos=2 size=1 count=1 page=Keyboard usage=Keyboard_LeftAlt, logical range 0..1
Input   rid=0 pos=3 size=1 count=1 page=Keyboard usage=Keyboard_Left_GUI, logical range 0..1
Input   rid=0 pos=4 size=1 count=1 page=Keyboard usage=Keyboard_RightControl, logical range 0..1
Input   rid=0 pos=5 size=1 count=1 page=Keyboard usage=Keyboard_RightShift, logical range 0..1
Input   rid=0 pos=6 size=1 count=1 page=Keyboard usage=Keyboard_RightAlt, logical range 0..1
Input   rid=0 pos=7 size=1 count=1 page=Keyboard usage=Keyboard_Right_GUI, logical range 0..1
Output  rid=0 pos=0 size=1 count=1 page=LEDs usage=Num_Lock, logical range 0..1
Output  rid=0 pos=1 size=1 count=1 page=LEDs usage=Caps_Lock, logical range 0..1
Output  rid=0 pos=2 size=1 count=1 page=LEDs usage=Scroll_Lock, logical range 0..1
Output  rid=0 pos=3 size=1 count=1 page=LEDs usage=Compose, logical range 0..1
Output  rid=0 pos=4 size=1 count=1 page=LEDs usage=Kana, logical range 0..1
Input   rid=0 pos=16 size=8 count=6 page=Keyboard usage=Reserved_(no_event_indicated) Array, logical range 0..139
End collection
Total   input size 8 bytes
Total  output size 1 bytes
Total feature size 0 bytes
[ko@wiley ~]$ cat usb_report_descriptor1
Report descriptor:
Collection type=Application page=Microsoft usage=0x0001
Input   rid=16 pos=0 size=8 count=6 page=Microsoft usage=0x0001 Array, logical range 0..255
Output  rid=16 pos=0 size=8 count=6 page=Microsoft usage=0x0001 Array, logical range 0..255
End collection
Collection type=Application page=Microsoft usage=0x0002
Input   rid=17 pos=0 size=8 count=19 page=Microsoft usage=0x0002 Array, logical range 0..255
Output  rid=17 pos=0 size=8 count=19 page=Microsoft usage=0x0002 Array, logical range 0..255
End collection
Collection type=Application page=Microsoft usage=0x0004
Input   rid=32 pos=0 size=8 count=14 page=Microsoft usage=0x0041 Array, logical range 0..255
Output  rid=32 pos=0 size=8 count=14 page=Microsoft usage=0x0041 Array, logical range 0..255
Input   rid=33 pos=0 size=8 count=31 page=Microsoft usage=0x0042 Array, logical range 0..255
Output  rid=33 pos=0 size=8 count=31 page=Microsoft usage=0x0042 Array, logical range 0..255
End collection
Total   input size 32 bytes
Total  output size 32 bytes
Total feature size 0 bytes
[ko@wiley ~]$
Comment 6 Vladimir Kondratyev freebsd_committer 2020-06-22 19:08:59 UTC
(In reply to Kostas Oikonomou from comment #5)
Great! usb_report_descriptor0 is a keyboard report descriptor.

Now, please run 
sudo usbhidctl -f /dev/uhid0 -la

but let it run instead of terminate and than press/release sequentially all the left-side Sun keys. If all is done properly, you will see following strings among others at keypress:

Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=XXX 0 0 0 0 0

where XXX is a decimal HID scancode.

On release this string should be just:

Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Please post all these XXX with according key names here.
Comment 7 Kostas Oikonomou 2020-06-22 19:59:04 UTC
(In reply to Vladimir Kondratyev from comment #6)

On the left panel of the Sun keyboard are 10 keys, in 5 rows:

Stop, Again
Props, Undo
Front, Copy,
Open, Paste
Find, Cut

I pressed them in order left-to-right, top-to-bottom:


[ko@wiley ~]$ sudo usbhidctl -f /dev/uhid0 -la
Password:
usbhidctl: hid_get_report(rid 0): Device not configured
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=

Generic_Desktop:Keyboard.LEDs:Num_Lock=0
Generic_Desktop:Keyboard.LEDs:Caps_Lock=0
Generic_Desktop:Keyboard.LEDs:Scroll_Lock=0
Generic_Desktop:Keyboard.LEDs:Compose=0
Generic_Desktop:Keyboard.LEDs:Kana=0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=120 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=121 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=118 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=122 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=119 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=124 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=116 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=125 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=126 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=123 0 0 0 0 0

Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_LeftAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Left_GUI=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightControl=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightShift=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_RightAlt=0
Generic_Desktop:Keyboard.Keyboard:Keyboard_Right_GUI=0
Generic_Desktop:Keyboard.Keyboard:Reserved_(no_event_indicated)=0 0 0 0 0 0

^C
[ko@wiley ~]$
Comment 8 Vladimir Kondratyev freebsd_committer 2020-06-22 20:53:07 UTC
Try

# sysctl kern.evdev.rcpt_mask=12
Comment 9 Kostas Oikonomou 2020-06-22 21:17:23 UTC
(In reply to Vladimir Kondratyev from comment #8)
I did. What is supposed to happen?
Comment 10 Vladimir Kondratyev freebsd_committer 2020-06-22 21:24:00 UTC
(In reply to Kostas Oikonomou from comment #9)
> I did. What is supposed to happen?
Sun-specific keys on the left of the keyboard start to work
Comment 11 Kostas Oikonomou 2020-06-22 21:32:00 UTC
(In reply to Vladimir Kondratyev from comment #10)
The Sun keyboard is still totally disabled/inactive
Comment 12 Vladimir Kondratyev freebsd_committer 2020-06-22 21:35:52 UTC
(In reply to Kostas Oikonomou from comment #11)
> The Sun keyboard is still totally disabled/inactive

Did you remove/comment out hw.usb.quirk line from /boot/loader.conf and reboot than?
Comment 13 Kostas Oikonomou 2020-06-22 22:51:50 UTC
(In reply to Vladimir Kondratyev from comment #12)
Removed the line from loader.conf, rebooted, and now xev shows all the right keycodes!  I already got Open and Undo working in xfce and Emacs, and the Cut, Copy, Paste work in my browser.

Thanks very much, this was a tough problem!

Some last questions:

1) The sysctl kern.evdev.rcpt_mask=12 line goes in /etc/rc.conf?
2) Can you give a short explanation of what sysctl kern.evdev.rcpt_mask=12
did?
Comment 14 Vladimir Kondratyev freebsd_committer 2020-06-22 23:22:44 UTC
(In reply to Kostas Oikonomou from comment #13)
> Thanks very much, this was a tough problem!
Great!

> 1) The sysctl kern.evdev.rcpt_mask=12 line goes in /etc/rc.conf?
It is better place kern.evdev.rcpt_mask=12 line in to /etc/sysctl.conf

> 2) Can you give a short explanation of what sysctl kern.evdev.rcpt_mask=12 did?
It disabled kbdmux as source of events and enabled ukbd. In USB keyboard case that reduced number of internal keycode translations from 2 (HID -> ATset1 -> evdev) to 1 (HID -> evdev). It looks like some of nonstandard Sun-specific keys were lost in transit as translation tables are not adjusted for 2 step translation good enough.
Comment 15 Vladimir Kondratyev freebsd_committer 2020-07-11 00:32:53 UTC
Recent 13-CURRENT and 12-STABLE have kern.evdev.rcpt_mask=12 sysctl by default.