"Subclassing" is the thing you really want to search for. As gigel_hifi mentioned, you could also look for "key hooks", but I'm not sure if you can squash key press propagation with that method. Probably. It's sort of like using a hammer when the back of a screwdriver will do.