I know this if of little or no help, but....
In that case you will need to use the actual interrupt for the keyboard to get the codes directly. Pretty much writing your own keyboard handler. I think the old ABC repository used to have examples on it. not sure if you can even still find that today. unless you already have a copy.