got the basic idea in a comment, but hit a brick wall on reading the scan codes easily (without C). stopping for tonight, I've got a keyboard to fix.