NB! It seems this console command is not compatible with CS2.
Command Profile

JOYSTICK_FORCE_DISABLED_SET_FROM_OPTIONS

CS:GO

Sets external controllers you've connected to the game enabled or disabled, depending on the command's setting. This command manually changes the selected option for whether controllers are enabled in the game settings, too.

Syntax
joystick_force_disabled_set_from_options [0 / 1]

Description

Sets external controllers you've connected to the game enabled or disabled, depending on the command's setting. This command manually changes the selected option for whether controllers are enabled in the game settings, too.

Syntax And Arguments

joystick_force_disabled_set_from_options [0 / 1]
0 / 1 Enter a 1 after this command to enable a controller, and a 0 after the command to disable being able to use controllers.