From: Matthieu Herrb Subject: improve wscons man pages To: tech@openbsd.org Date: Fri, 15 Aug 2025 16:23:33 +0200 Hi, The diff below adds some documentation about the supported ioctls() on wskbd(4), wsmouse(4) and wsmux(4). For wskbd(4) I also included the description of the supported keymaps. Some of the text has been copied and adapted from the correspondiing NetBSD manual pages. Feedback, ok ? Index: wskbd.4 =================================================================== RCS file: /local/cvs/src/share/man/man4/wskbd.4,v diff -u -p -u -r1.24 wskbd.4 --- wskbd.4 3 Sep 2016 14:36:14 -0000 1.24 +++ wskbd.4 15 Aug 2025 14:19:20 -0000 @@ -129,6 +129,132 @@ When audio devices are supported, keys and .Cm VolumeDown tweak mixer settings. +.Ss Keyboard encodings +The following encodings are supported. +Device drivers for legacy keyboard interfaces may only support a subset +of these. +However, generally, all encodings are supported by +.Xr pckbd 4 +and +.Xr ukbd 4 . +.Bl -column ".Li us.colemak" ".Dv KB_US|KB_COLEMAK" +.It Sy "wsconsctl" Ta Sy "define" Ta Sy "language" +.It Li user Ta Dv KB_USER Ta User-defined +.It Li us Ta Dv KB_US Ta English/US keyboard mapping (default) +.It Li uk Ta Dv KB_UK Ta English/UK keyboard mapping +.It Li be Ta Dv KB_BE Ta Belgian +.It Li br Ta Dv KB_BR Ta Brazilian with +.Dq dead accents +.It Li cf Ta Dv KB_CF Ta Canadian French +.It Li dk Ta Dv KB_DK Ta Danish with +.Dq dead accents +.It Li nl Ta Dv KB_NL Ta Dutch +.It Li ee Ta Dv KB_EE Ta Estonian with +.Dq dead accents +.It Li fr Ta Dv KB_FR Ta French +.It Li de Ta Dv KB_DE Ta German QWERTZ with +.Dq dead accents +.It Li hu Ta Dv KB_HU Ta Hungarian +.It Li is Ta Dv KB_IS Ta Icelandic with +.Dq dead accents +.It Li it Ta Dv KB_IT Ta Italian +.It Li jp Ta Dv KB_JP Ta Japanese +.It Li la Ta Dv KB_LA Ta Latin American Spanish +.It Li no Ta Dv KB_NO Ta Norwegian with +.Dq dead accents +.It Li pl Ta Dv KB_PL Ta Polish +.It Li pt Ta Dv KB_PT Ta Portuguese +.It Li ru Ta Dv KB_RU Ta Russian +.It Li es Ta Dv KB_ES Ta Spanish +.It Li sv Ta Dv KB_SV Ta Swedish with +.Dq dead accents +.It Li sf Ta Dv KB_SF Ta Swiss French +.It Li sg Ta Dv KB_SG Ta Swiss German +.It Li tr Ta Dv KB_TR Ta Turkish (QWERTY) with +.Dq dead accents +.It Li ua Ta Dv KB_UA Ta Ukrainian +.It Li us.declk Ta Dv "KB_US|KB_DECLK" Ta English/US mapping for +.Tn DEC LK400 Ns - Ns style +keyboards with PC keyboard interface (e.g., +.Tn LK461 ) +.It Li us.dvorak Ta Dv "KB_US|KB_DVORAK" Ta English/US keyboard with +.Dq Dvorak +layout +.It Li us.colemak Ta Dv "KB_US|KB_COLEMAK" Ta English/US keyboard with +.Dq Colemak +layout +.El +.Pp +The +.Dq Li \&.nodead +suffix +.Dv ( KB_NODEAD +flag) +can be applied to layouts with +.Dq dead accents +to switch them off. +.Pp +The +.Dv KB_US , +.Dv KB_UK , +.Dv KB_FR , +.Dv KB_JP +and +.Dv KB_US|KB_DVORAK +mappings can be modified +to swap the left +.Aq Ctrl +and the +.Aq CapsLock +keys by the +.Dv KB_SWAPCTRLCAPS +variant bit or the +.Dq Li .swapctrlcaps +suffix. +.Pp +The +.Dq Li .metaesc +suffix +.Dv ( KB_METAESC +flag) +option can be applied to any layout. +If set, keys pressed together +with the +.Tn ALT +modifier are prefixed by an +.Tn ESC +character. +(Standard behaviour is to add 128 to the +.Tn ASCII +value.) +.Ss Ioctls +The following +.Xr ioctl 2 +calls are provided by the +.Nm +driver or by devices which use it. +Their definitions are found in +.In dev/wscons/wsconsio.h . +.Bl -tag -width Dv +.It Dv WSKBDIO_GTYPE +Get the keyboard type. +.It Dv WSKBDIO_GETMODE +Get the keyboard mode, 0 means translated through keyboard map, 1 means raw. +.It Dv WSKBDIO_SETMODE +Set the keyboard mode. +.It Dv WSKBDIO_COMPLEXBELL , WSKBDIO_SETBELL , WSKBDIO_GETBELL , WSKBDIO_SETDEFAULTBELL , WSKBDIO_GETDEFAULTBELL Pq Vt "struct wskbd_bell_data" +Get and set keyboard bell settings. +.It Dv WSKBDIO_SETKEYREPEAT , WSKBDIO_GETKEYREPEAT , WSKBDIO_SETDEFAULTKEYREPEAT , WSKBDIO_GETDEFAULTKEYREPEAT Pq Vt "struct wskbd_keyrepeat_data" +Get and set keyboard autorepeat settings. +.It Dv WSKBDIO_SETLEDS , WSKBDIO_GETLEDS Pq Vt "int" +Get and set keyboard LED settings. +.It Dv WSKBDIO_GETMAP , WSKBDIO_SETMAP Pq Vt "struct wskbd_map_data" +Get and set keyboard keymapping settings. +.It Dv WSKBDIO_GETBACKLIGHT, WSKBDIO_SETBACKLIGHT Pq Vt "struct wskbd_backlight" +Get and set keyboard backlight +.It Dv WSKBDIO_GETENCODING , WSKBDIO_SETENCODING Pq Vt "kbd_t" +Get and set keyboard encoding settings. +.El .Sh FILES .Bl -tag -width /usr/include/dev/wscons/wsksymdef.h -compact .It Pa /dev/wskbd* Index: wsmouse.4 =================================================================== RCS file: /local/cvs/src/share/man/man4/wsmouse.4,v diff -u -p -u -r1.24 wsmouse.4 --- wsmouse.4 5 Oct 2024 13:27:16 -0000 1.24 +++ wsmouse.4 15 Aug 2025 14:19:20 -0000 @@ -161,6 +161,56 @@ When multi-touch input is available, a t the bottom area while there are other inputs - movement, scrolling, or tapping -, and the driver continues to ignore it as long as and whenever other touches are present. +.Ss Ioctls +The following +.Xr ioctl 2 +calls are provided by the +.Nm +driver or by devices which use it. +Their definitions are found in +.Pa dev/wscons/wsconsio.h . +.Bl -tag -width Dv +.It Dv WSKBDIO_GTYPE +Get the mouse or device type. +.It Dv WSMOUSEIO_SRES Pq Vt "int" +Set the resolution of the pointer. Not applicable to all mouse types. +.It Dv WSMOUSEIO_GCALIBCOORDS, WSMOUSEIO_SCALIBCOORDS Pq Vt "struct wsmouse_calibcoords" +Get and set device calibration data for touchscreens. +.It Dv WSMOUSEIO_SETMODE Pq Vt "int" +Sets the mode of a touchpad device +.Po Li WSMOUSE_COMPAT +or +.Li WSMOUSE_NATIVE Pc +.It Dv WSMOUSEIO_GETPARAMS, WSMOUSEIO_SETPARAMS Pq Vt "struct wsmouse_parameters" +Obtain and set various mouse parameters as a key/value set. +Currently these primarily relate to touchpads. +The structure +.Vt struct wsmouse_parameters +is defined as follows: +.Bd -literal -offset indent +struct wsmouse_param { + enum wsmousecfg key; + int value; +}; + +struct wsmouse_parameters { + struct wsmouse_param *params; + unsigned int nparams; +}; +.Ed +.Pp +The number of parameters to read or write must be specified in +.Va nparams . +For each parameter, when +.Dv WSMOUSEIO_GETPARAMS +is used, a key must be specified. +When +.Dv WSMOUSEIO_SETPARAMS +is used, a key and a value must be specified. +A single ioctl may retrieve up to +.Dv WSMOUSECFG_MAX +.Va nparams . +.El .Sh FILES .Bl -tag -width /usr/include/dev/wscons/wsconsio.h -compact .It Pa /dev/wsmouse* Index: wsmux.4 =================================================================== RCS file: /local/cvs/src/share/man/man4/wsmux.4,v diff -u -p -u -r1.15 wsmux.4 --- wsmux.4 31 Mar 2022 17:27:21 -0000 1.15 +++ wsmux.4 15 Aug 2025 14:19:21 -0000 @@ -70,6 +70,61 @@ This is used by the .Xr wsmoused 8 daemon to take data from a mouse connected to a serial port and make it appear on the standard mouse mux. +.Ss Ioctls +.Nm +supports +.Xr ioctl 2 +commands to configure and manage events that are returned. +The following commands are available: +.Bl -tag -width Dv +.It Dv WSMUXIO_INJECTEVENT Pq Vt "struct wscons_event" +injects a synthetic event to the given device. +Used by +.Xr wsmoused 8 . +This command uses the same +.Vt wscons_event +structure as returned by +.Xr read 2 +on +.Xr wscons 4 +input devices as input. +.Bd -literal +struct wscons_event { + u_int type; + int value; + struct timespec time; +}; +.Ed +.It Dv WSMUXIO_ADD_DEVICE Pq Vt "struct wsmux_device" +adds a device to the mux. +This commands uses a +.Vt wsmux_device +structure as input. +.Bd -literal +struct wsmux_device { + int type; +#define WSMUX_MOUSE 1 +#define WSMUX_KBD 2 +#define WSMUX_MUX 3 + int idx; +}; +.Ed +.It Dv WSMUXIO_REMOVE_DEVICE Pq Vt "struct wsmux_device" +removes a device from the mux. +.It Dv WSMUXIO_LIST_DEVICES Pq Vt "struct wsmux_device_list" +returns an array of WSMUX_MAXDEV elements decribing the devices attached to the mux. +The array is composed of +.Fa wsmux_device +structues enclosed in a +.Fa wsmux_device_list +strucure. +.Bd -literal +struct wsmux_device_list { + int ndevices; + struct wsmux_device devices[WSMUX_MAXDEV]; +}; +.Ed +.El .Sh FILES .Bl -item -compact .It -- Matthieu Herrb