I have no idea if this will help, but I just used the query keymap in
4.2.5 on the 7/Home key on my keyboard. It returned
;7
You could try setting keymaps for whichever keys to ; followed by the
numbers from 1 to 9. The exception is the stay still 5 key which does
not return ;5, but instead appears to return a comma: ,
There's no easy way to see whether there are trailing spaces.