Ugly keyboard handling between the kernel and the userspace.