WSMUX(4) | Device Drivers Manual | WSMUX(4)

# NAME

`wsmux` — console keyboard/mouse multiplexor for wscons

# SYNOPSIS

`wskbd* at ... mux N`
`wsmouse* at ... mux N`

`pseudo-device wsmux` [count]

# DESCRIPTION

The `wsmux` is a pseudo-device driver that allows several wscons(4) input devices to have their events multiplexed into one stream.

The typical usage for this device is to have two multiplexors, one for mouse events and one for keyboard events. All wsmouse(4) devices should direct their events to the mouse mux (normally 0) and all keyboard devices, except the console, should direct their events to the keyboard mux (normally 1). A device will send its events to the mux indicated by the mux locator. If none is given, the device will not use a multiplexor. The keyboard multiplexor should be connected to the display, using the wsconscfg(8) command. It will then receive all keystrokes from all keyboards and, furthermore, keyboards can be dynamically attached and detached without further user interaction. In a similar way, the window system will open the mouse multiplexor and receive all mouse events; mice can also be dynamically attached and detached.

It is also possible to inject events into a multiplexor from a user program. This is used by the wsmoused(8) daemon to take data from a mouse connected to a serial port and make it appear on the standard mouse mux.

## Ioctls

`wsmux` supports ioctl(2) commands to configure and manage events that are returned. The following commands are available:

`WSMUXIO_INJECTEVENT` (struct wscons_event)
  injects a synthetic event to the given device. Used by wsmoused(8). This command uses the same wscons_event structure as returned by read(2) on wscons(4) input devices as input.

      struct wscons_event {
      	u_int		type;
      	int		value;
      	struct timespec	time;
      };

`WSMUXIO_ADD_DEVICE` (struct wsmux_device)
  adds a device to the mux. This commands uses a wsmux_device structure as input.

      struct wsmux_device {
      	int type;
      #define WSMUX_MOUSE	1
      #define WSMUX_KBD	2
      #define WSMUX_MUX	3
      	int idx;
      };

`WSMUXIO_REMOVE_DEVICE` (struct wsmux_device)
  removes a device from the mux.
`WSMUXIO_LIST_DEVICES` (struct wsmux_device_list)
  returns an array of WSMUX_MAXDEV elements describing the devices attached to the mux. The array is composed of wsmux_device structures enclosed in a wsmux_device_list structure.

      struct wsmux_device_list {
      	int ndevices;
      	struct wsmux_device devices[WSMUX_MAXDEV];
      };

# FILES

- /dev/wsmouse
- /dev/wskbd
- /usr/include/dev/wscons/wsconsio.h

# SEE ALSO

intro(4), wscons(4), wsdisplay(4), wskbd(4), wsmouse(4), wsconscfg(8), wsconsctl(8), wsmoused(8)

August 16, 2025 | Debian