When you input the key you want to be the toggle, you have to use a code. So for example my line for toggling DoF is

#define DoF_ToggleKey VK_F11
Not sure if that's what you were doing wrong but it took me a while to work it out