Reference

XUngrabKeyboard(3) on Linux

The text 0b6cc75ba6cb, as Debian 9 (Stretch) shipped it.

grab the keyboard

XUngrabKeyboard(3) on Linux now