Search the source
With Developer Extras turned on hover over the enum and choose edit source
This will open up (for me) scripts/keyconfigs/blender.py
# General settings.
col = layout.column()
col.row().prop(self, "select_mouse", text="Select with Mouse Button", expand=True)
col.row().prop(self, "spacebar_action", text="Spacebar Action", expand=True)
if is_select_left:
col.row().prop(self, "gizmo_action", text="Activate Gizmo Event", expand=True)
Notice there is a generic property update method load(self, context)
def load():
from sys import platform
from bpy import context
from bl_keymap_utils.io import keyconfig_init_from_data
prefs = context.preferences
kc = context.window_manager.keyconfigs.new(IDNAME)
kc_prefs = kc.preferences
Ok then to the python console
>>> C.preferences.keymap.active_keyconfig
'blender'
>>> C.window_manager.keyconfigs['blender'].preferences['spacebar_action'] = 2
will set to the third option. The item that matches that number is available enum definition of the the Prefs class.