Bug 213835

Summary: [patch] bhyve: send ps/2 scancodes for NumLock, ScrollLock and numerical keypad keys.
Product: Base System Reporter: Vasily Postnicov <ivan.zhmudo>
Component: binAssignee: Marcelo Araujo <araujo>
Status: Closed FIXED    
Severity: Affects Some People CC: araujo, olevole, virtualization
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
The patch none

Description Vasily Postnicov 2016-10-27 18:39:12 UTC
Created attachment 176222 [details]
The patch

Hello. I've noticed, that bhyve (at least when it works in conjunction with VNC client) does not understand *lock and keypad keys and prints debug messages like "Unhandled ps2 keyboard keysym". Suggesting a patch which seems to fix the problem.

Also, can you please explain what uint32_t keysym codes are? The first 127 of them seem to be ASCII codes and translation table contain ASCII->PS/2 set 2 scancode mappings. But why TAB,ESC and some other symbols are coded with leading 0xff? For example, TAB is 0xff09. How keysyms are generated for *lock and Keypad keys?

Nevertheless, I wrote the patch using the mentioned debug output.
Comment 1 Marcelo Araujo freebsd_committer freebsd_triage 2018-06-15 05:44:07 UTC
I'm working to improve the ps/2 scancodes.
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-11-02 08:28:21 UTC
A commit references this bug:

Author: araujo
Date: Fri Nov  2 08:28:14 UTC 2018
New revision: 340046
URL: https://svnweb.freebsd.org/changeset/base/340046

Log:
  Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
  keys.

  PR:		213835
  Submitted by:	Vasily Postnicov <ivan.zhmudo@gmail.com>
  MFC after:	4 weeks
  Relnotes:	Yes
  Sponsored by:	iXsystems Inc.

Changes:
  head/usr.sbin/bhyve/ps2kbd.c
Comment 3 Marcelo Araujo freebsd_committer freebsd_triage 2018-11-02 08:30:13 UTC
Thanks for the patch and sorry about my delay to commit it.

Best,
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-12-09 06:42:25 UTC
A commit references this bug:

Author: araujo
Date: Sun Dec  9 06:41:57 UTC 2018
New revision: 341757
URL: https://svnweb.freebsd.org/changeset/base/341757

Log:
  MFC r340046, r340050

  r340046:
  Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
  keys.

  PR:		213835
  Submitted by:	Vasily Postnicov <ivan.zhmudo@gmail.com>
  Relnotes:	Yes
  Sponsored by:	iXsystems Inc.

  r340050:
  Remove printf for debug purpose forgotten on r340046.

  Reported by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>

Changes:
_U  stable/12/
  stable/12/usr.sbin/bhyve/ps2kbd.c
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-12-09 06:42:28 UTC
A commit references this bug:

Author: araujo
Date: Sun Dec  9 06:42:07 UTC 2018
New revision: 341758
URL: https://svnweb.freebsd.org/changeset/base/341758

Log:
  MFC r340046, r340050

  r340046:
  Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
  keys.

  PR:		213835
  Submitted by:	Vasily Postnicov <ivan.zhmudo@gmail.com>
  Relnotes:	Yes
  Sponsored by:	iXsystems Inc.

  r340050:
  Remove printf for debug purpose forgotten on r340046.

  Reported by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>

Changes:
_U  stable/11/
  stable/11/usr.sbin/bhyve/ps2kbd.c
Comment 6 Marcelo Araujo freebsd_committer freebsd_triage 2018-12-09 07:00:33 UTC
MFC to stable 11 and 12 done.