generic: backport a fix for the input keymap-matrix module