Pickpocket is a stealthy way of getting your hands on Keys. It is one of three ways of getting Keys, the other two being stunning the Guard with, for example, upgraded Smoke Bombs or killing the Guard.
The game can be quite vague on this. The correct way to succesfully pickpocket a Guard is the following (only works for the default keybindings):
- Press E
- Release E
- Press Right Mouse Button
- Swipe left or right(depends on what the game shows you)
- Release Right Mouse Button.
- In the level "A blade at his neck", one of the three optional objectives is to pickpocket both Keys.