You’ve made quite a few changes to the stock retroarch.cfg there, I’d be tempted to revert to stock and get one part working at a time.
But as a quick fix, try:
Comment out this line
# Alternatively, all hotkeys for keyboard could be disabled by the user. input_enable_hotkey_btn = num1
so it reads
# Alternatively, all hotkeys for keyboard could be disabled by the user. # input_enable_hotkey_btn = num1
input_enable_hotkey_btn = num1 input_exit_emulator_btn = num2 input_save_state_btn = 5 input_load_state_btn = 6
input_enable_hotkey = num1 input_exit_emulator = num2 input_save_state = 5 input_load_state = 6
assuming that num1 and num2 are the keyboard keys that your ipac sends.