First, can Macs be keylogged? I've read that Macs aren't as vulnerable as PCs in regards to malicious software, but I don't know if that applies to keylogging programs as well. Second, if I have been, is there a way I can be sure? A scan or something? Third, if I do for sure have a keylogging program, how do I get rid of it?
Technically Macs
are vulnerable to malicious software, be it through features of the GUI (e.g. input managers), file-system (e.g. resource forks), OS (e.g. file validation), kernel (e.g. mach object format) or, quite simply, unpatched bugs.
Don't Panic!
In practice, however, malicious software
typically requires some user action to install. As always, use
common sense: do not accept files or applications from untrusted sources, and always install security updates.
That said, it's true!

Macs are less vulnerable than PCs: OS X is very secure when looking from outside.
Unfortunately applications are free to connect to whomever /wherever they wish. Because of this, you should install an application-firewall (such as Little Snitch).
The application-firewall will alert you when keylogger attempts to phone home.
(Note: Some keyloggers record data for subsequent physical removal, so these will obviously not be detected with this approach.)