One of the iPad's much-appreciated improvements over the iPhone was its support for Bluetooth keyboards, both the Apple Wireless Keyboard and non-Apple models. Fortunately, iOS 4 brought this support to the iPhone (3GS and 4) and third-generation iPod touch as well.
Unfortunately, a subtle and non-obvious interaction between Bluetooth keyboards and all compatible versions of the iOS can cause results that range from irritating to destructive. The short version: make sure you turn off your Bluetooth keyboard before packing it for a trip. You may even want to pop its batteries out.
Why take such a precaution? First, the Bluetooth keyboard can wake a paired iOS device, so if the keyboard is in your bag with the keys mashed against some other object, the iOS device (and the keyboard itself) could be woken up repeatedly, draining battery power. Even worse, if the Play/Pause key on the keyboard is pressed, the paired device will start playing audio - even if it's locked with a passcode.
The Apple Wireless Keyboard's power button can also be depressed from the side, turning it on - so consider removing batteries rather than just powering off.
Second, if you do have a passcode lock set (Settings > General > Passcode Lock), as is recommended for anyone whose device contains sensitive data, iOS has a progressive delay built into the passcode lock: each time the wrong code is entered (in this case, unintentionally), the duration increases before the code may be tried again. After a few failed "attempts" to unlock by a mashed keyboard, the iOS device disallows logins for an hour or more. Dan Frakes at Macworld found this out the hard way.
Third, if you have Erase Data enabled in the Passcode Lock settings screen - recommended for anyone using a passcode - an iPad or iOS 4 device will scramble its flash memory after 10 failed "attempts." All iOS devices that support Bluetooth keyboards also have hardware encryption, and employ "crypto-shredding," in which the hardware key is discarded, making data impossible to access or decrypt within just a few seconds. (The iPhone 3G and second-generation iPod touch can run iOS 4, but neither supports external keyboards.)
If your device loses access to its cryptographically protected storage, getting that lost information back is a simple matter of reconnecting the device to the copy of iTunes it backs up to and then restoring, but that might be inconvenient if you're travelling with only the iOS device, or disappointing if you had created documents in Pages, transferred photos and deleted them from a camera, or performed other tasks that involved irretrievable work. Mike Rothman at Securosis managed to turn this into a lesson about looking on the brighter side.
A few solutions present themselves. First, and easiest, turn off your Bluetooth keyboard before packing it. For the Apple Wireless Keyboard, the on/off switch is on the right edge of the round keyboard support (the battery compartment opens on the left side). Press it to turn the keyboard off. Instead of turning it off, if you're concerned about the on/off switch being pressed (thus enabling all the problems described above), remove the batteries instead.
Alternatively, you can always turn Bluetooth off on your iOS device to ensure that it isn't accidentally accessed from a mashed keyboard.
Of course, the ultimate solution should come from Apple, in the form of an iOS option that would ignore input from a Bluetooth keyboard when the device is showing the passcode screen.