If a hotkey_enable button or key is defined, no hotkeys will function unless the "enable" button is also pressed at the same time.
By default, there is no hotkey_enable keyboard key defined. With only the keyboard connected, the hotkeys will work individually.
But when you connect a USB gamepad, that gamepad's autoconfig is applied. The autoconfig does define a hotkey_enable button on the gamepads (usually Select).
In order to use keyboard hotkey functions when the gamepad is connected, you must either:
press the gamepad's
hotkey_enable button while you press the keyboard hotkey key, or
define a keyboard
hotkey_enable key and use that, or
remove or #disable the
hotkey_enable function from your gamepad's autoconfig (you'll also need to remove or disable all other hotkey functions that share a button with any game action buttons), or
unplug the gamepad.
Hotkeys only work on the keyboard or on P1 gamepad. If the gamepad is anything other than P1 it won't work, but it still defines the hotkey_enable so you still have to use it, one way or another, while the pad is connected.