keyfob to usb (ask communication)

hello everyone,
I am looking for a usb receiver that can intercept the 3 or 4 commands from a keyfob.
so that i can then program in my java program
if keyfob button A is pushed do something
if keyfob button B is pushed do something else
if keyfob button C is pushed do something else else
if keyfob button D is pushed do something else else else.