Just to make sure I'm understanding correctly, you want to (for example), have the F key on your PLD activate a particular hotbar slot, while the F key on your WHM does something completely different, such as opening your inventory?

No, there's no way to do that in-game. Most things you can bind keys to can either be dragged onto hotbars directly (even invisible hotbars if it's stuff you have memorized and don't need/want to see) or put into macros to be placed on hotbars, so that's a possibility for some things. Doesn't cover absolutely everything, though, and it's limited by hotbar limitations.

Gaming devices (like the G600) tend to have a certain number of profiles you can switch around, so that is a possibility, but it wouldn't be automatic; you'd have to use the device software to switch to the right profile every time you switched classes. You could maybe set up a button to switch hardware profiles and fire off a macro to change gearset in one press, but it'd get squirrelly if you press the button in a situation where you can't change gearsets. (Edit: and it also depends on the specific device in question supporting something like that to begin with.)