# If RetroArch do NOT detect a controller when connected via Bluetooth and won't even recognize manual binding, 
# the cause is most likely SDL (Simple DirectMedia Layer) NOT recognizing the controller as a joystick. 
# To fix this you need to add udev rules to force detection - https://hg.libsdl.org/SDL/file/704a0bfecf75/README-linux.txt
# -------------------------------------------------------------------------------------------------------------------------------------------------
# Fix it by adding this udev rule (the line below WITHOUT the # symbol at the beginning!) to "/etc/udev/rules.d/10-local.rules" and reboot.
# SUBSYSTEM=="input", ATTRS{name}=="8Bitdo FC30 Pro", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
# -------------------------------------------------------------------------------------------------------------------------------------------------

input_device = "8Bitdo FC30 Pro"
input_driver = "udev"

# Hex vid:pid = 3810:0009 -> Decimal vid:pid = 14352:9
input_vendor_id = 14352
input_product_id = 9

input_b_btn = "12"
input_y_btn = "15"
input_select_btn = "21"
input_start_btn = "22"
input_a_btn = "11"
input_x_btn = "14"
input_l_btn = "17"
input_r_btn = "18"
input_l2_btn = "19"
input_r2_btn = "20"
input_l3_btn = "24"
input_r3_btn = "25"
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"

input_b_btn_label = "B"
input_y_btn_label = "Y"
input_select_btn_label = "Select"
input_start_btn_label = "Start"
input_a_btn_label = "A"
input_x_btn_label = "X"
input_l_btn_label = "L1"
input_r_btn_label = "R1"
input_l2_btn_label = "L2"
input_r2_btn_label = "R2"
input_l3_btn_label = "Left Thumb"
input_r3_btn_label = "Right Thumb"
input_l_x_plus_axis_label = "Left Analog Right"
input_l_x_minus_axis_label = "Left Analog Left"
input_l_y_plus_axis_label = "Left Analog Down"
input_l_y_minus_axis_label = "Left Analog Up"
input_r_x_plus_axis_label = "Right Analog Right"
input_r_x_minus_axis_label = "Right Analog Left"
input_r_y_plus_axis_label = "Right Analog Down"
input_r_y_minus_axis_label = "Right Analog Up"

# Bluetooth Mode(POWER) D-pad = Buttons
input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"

input_up_btn_label = "D-Pad Up"
input_down_btn_label = "D-Pad Down"
input_left_btn_label = "D-Pad Left"
input_right_btn_label = "D-Pad Right"

# Bluetooth Mode(POWER+R1) D-pad = Left Analog. Requires Firmware v1.50 (2015-01-30) or newer.
input_up_axis = "-1"
input_down_axis = "+1"
input_left_axis = "-0"
input_right_axis = "+0"

input_up_axis_label = "D-Pad Up"
input_down_axis_label = "D-Pad Down"
input_left_axis_label = "D-Pad Left"
input_right_axis_label = "D-Pad Right"
