XCHANGEKEYBOARDDEVIC(3)

πŸ’– XCHANGEKEYBOARDDEVIC πŸ’–

okay bestie, so this one is from section 3 of the manual β€” XChangeKeyboardDevice(3) β€” and it's literally the glow-up button for your keyboard situation. ✨


🌸 NAME 🌸

XChangeKeyboardDevice β€” change which device is used as the X keyboard. no cap, that's the whole job. πŸ’…


✨ SYNOPSIS ✨

#include <X11/extensions/XInput.h>

Status XChangeKeyboardDevice( Display *display,
                              XDevice *device);
  • display β€” the connection to the X server. it's giving "hey bestie, i'm calling from this socket." 🫢
  • device β€” the device you want to be the X keyboard. main character appointment fr fr. πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

The XChangeKeyboardDevice request causes the server to use the specified device as the X keyboard. like, actually promoting it. πŸŽ€

The device must have been previously opened by the requesting client via XOpenDevice, or a BadDevice error will result. so if you didn't open it first, it's not beating the allegations. 😭

The device must support input class Keys, or a BadMatch error will result. a keyboard with no keys? not on this server's watch. πŸ’€

If the server implementation does not support using the requested device as the X keyboard, a BadDevice error will result. some servers just don't have that range, and that's a them problem. πŸ™ˆ

If the specified device is grabbed by another client, AlreadyGrabbed is returned. If the specified device is frozen by a grab on another device, GrabFrozen is returned. If the request is successful, Success is returned. so basically: grabbed β†’ already taken, frozen β†’ on ice, success β†’ slay. 🧊✨

If the request succeeds, a ChangeDeviceNotify event is sent to all clients that have selected that event. A MappingNotify event with request = MappingKeyboard is sent to all clients. The specified device becomes the X keyboard and the old X keyboard becomes accessible through the input extension protocol requests. the old keyboard isn't fired, bestie β€” it just moved departments. πŸ‘‘βž‘οΈπŸŒˆ

XChangeKeyboardDevice can generate a BadDevice or a BadMatch error. that's just the vibe check. 🫢


πŸ’… DIAGNOSTICS πŸ’…

  • BadDevice β€” An invalid device was specified. The specified device does not exist, has not been opened by this client via XOpenInputDevice, or is already one of the core X device (pointer or keyboard). This error may also occur if the server implementation does not support using the specified device as the X keyboard. it's giving "who even are you" energy. πŸ’€
  • BadMatch β€” This error may occur if an XChangeKeyboardDevice request was made specifying a device that has no keys. zero keys. not a single one. the audacity honestly. 😭

πŸ”₯ SEE ALSO πŸ”₯

  • XChangePointerDevice(3) β€” the pointer edition, for when you also need to relocate the vibes. πŸ–±οΈβœ¨

okay that's the whole page, you ate that πŸ“πŸ’–

this was brought to you by the 05/18/2026 release of the XCHANGEKEYBOARDDEVIC(3) manual page β€” periodt. πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from