With most keys you should be able to just left click on it to pick it up, assuming you are close enough or have an open path to it. Anything else that does not have a default action of being picked up when clicked on (such as books) can be retrieved by drag-and-dropping into the inventory or onto a character's portrait in BD (or the interface bar in DD).