How to receive hardware keyboard events but block pop-up keyboard

I have a calculator app, and I would like to add support for using it with a hardware keyboard.

I understand I can receive keyboard events by making my view implement canBecomeFirstResponder and having it return YES, and then calling becomeFirstResponder when the view becomes active.

The problem is: I don't want the pop-up keyboard to appear. The app has its own keyboard; the UI simulates a physical calculator, and handles tap events by figuring out which calculator key is pressed and then acting accordingly. So the pop-up keyboard would literally just get in the way. But I do want to receive key events from hardware keyboards.

I'm thinking of making canBecomeFirstResponder check for the presence of hardware keyboards, and return NO if none are present. But I'm not sure how to deal with hardware keyboards being connected or disconnected while the calculator view is active, and I'm also concerned about the keyboard bar on iPads.

Is it possible to get hardware keyboard events without anything interfering with my UI like that?

How to receive hardware keyboard events but block pop-up keyboard
 
 
Q