There is a 99% chance that it will work. Whether it be a PS2, USB and *SOMETIMES* serial.
The problem is the way the driver software presents the scanned barcode to the system. Most (99%) just dump it into the keyboard buffer; this is done for maximum compatibility. Others (1%), send messages to the destination program with the scanned data.
So, yes, a keylogger will pick up a barcode, just like it will pick up a credit card track swipe.