I just got a cheap second-hand magic keyboard (Apple). Is there any way to check if it's been key logged? I cannot see any screws or openings other than the one for the battery pack.
This would be practically impossible. Off course, you could open it up and see if there's any strange looking components who doesn't seem to belong there. But how would one tell what's legitimate and what's not? Plus, the keylogger could be in the firmware, meaning it's not hardware and can't be seen directly.
That it's a Bluetooth keyboard makes the situation a bit special. An ordinary hardware keylogger would probably be attached to the cable going from the circuit board out of the keyboard. That makes it a bit easier to detect. But you can't install something like that on a wireless keyborad since there is no cable. That makes it much harder to install a keylogger, but also much harder to detect one if it's installed.
But in the end, the likelihood that your second hand keyboard would contain malware is small. Unless you have some specific reason to believe you may be under a serious targeted attack, you probably shouldn't worry to much about it. Chanses are there are bigger risks elsewhere to care about first.
But if the risk do bother you, your best bet is to by a new keyboard rather than examining the second hand one.
TL;DR: You can't really check if it's been keylogged, but in practice you don't really need to anyway.