Skip to content

Commit

Permalink
use Steam Input for controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
alkazar committed May 11, 2024
1 parent 6756dbf commit bb6a57a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/retroarch-common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ autosave_interval = "2"
menu_driver = "rgui"
menu_show_load_content_animation = "false"
network_cmd_enable = "true"
input_driver = "udev"
input_joypad_driver = "udev"
input_driver = "sdl2"
input_joypad_driver = "sdl2"
video_fullscreen = "true"
video_smooth = "false"
video_scale_integer = "false"
Expand Down
28 changes: 28 additions & 0 deletions config/steam-virtual-gamepad.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
input_driver = "sdl2"
input_device = "Steam Virtual Gamepad"
input_vendor_id = "10462"
input_product_id = "4607"
input_b_btn = "0"
input_y_btn = "2"
input_select_btn = "4"
input_start_btn = "6"
input_up_btn = "11"
input_down_btn = "12"
input_left_btn = "13"
input_right_btn = "14"
input_a_btn = "1"
input_x_btn = "3"
input_l_btn = "9"
input_r_btn = "10"
input_l2_axis = "+4"
input_r2_axis = "+5"
input_l3_btn = "7"
input_r3_btn = "8"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+2"
input_r_x_minus_axis = "-2"
input_r_y_plus_axis = "+3"
input_r_y_minus_axis = "-3"
12 changes: 10 additions & 2 deletions libexec/launcher
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ savestate_directory = ${SAVE_DIR}


mkdir -p ${CONFIG_HOME}/retroarch
AUTOCONFIG=${CONFIG_HOME}/retroarch/autoconfig
if [ ! -e ${AUTOCONFIG} ] || [ -L ${AUTOCONFIG} ]; then
rm -f ${AUTOCONFIG}
mkdir -p ${AUTOCONFIG}
fi

if [ ! -e ${CONFIG_HOME}/retroarch/autoconfig ]; then
ln -s /usr/share/libretro/autoconfig ${CONFIG_HOME}/retroarch/autoconfig
if [ ! -e ${AUTOCONFIG}/steam-virtual-gamepad.cfg ]; then
ln -s /usr/share/chimera/config/steam-virtual-gamepad.cfg ${AUTOCONFIG}/
fi

# use the RetroArch config as is, allowing users to manually configure RetroArch if they want to
Expand All @@ -56,6 +61,9 @@ if [ "${RETRO_CORE}" == "dolphin" ]; then
cp -f ${CORE_CONFIG} ${CONFIG_HOME}/retroarch/config/remaps/dolphin-emu/dolphin-emu.rmp
fi

# Ignore all controller devices except for Steam Input
export SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT="0x28de/0x11ff"

retroarch \
--appendconfig "${RETRO_CONFIG}|${CORE_CONFIG}" \
--libretro /usr/lib/libretro/${RETRO_CORE}_libretro.so \
Expand Down

0 comments on commit bb6a57a

Please sign in to comment.