In order to prevent two keys being active simultaneously, the Selectric had a linear track full of steel balls running from side to side, with just enough free space to allow a metal tab from a single key to enter. So locking the keyboard was just a matter of having a solenoid occupy the free space.
To the best of my knowledge, the only IBM keyboards that could flat out prevent the keys from being pressed were ones based on the Selectric typewriter mechanism, such as the 2741