Split up keyboard handling code for xkbcommon to separate file