Wiimote Classic Controller
first install this lib in order to communicate with the remote
sudo apt-get install python-cwiid
next create this config file /usr/local/share/mappings/wii.conf
abs_x = 0
abs_y = 1
abs_z = -1
reverse_x = true
reverse_y = false
abs_rx = 3
abs_ry = 4
abs_rz = -1
reverse_rx = true
reverse_ry = false
abs_deadzone = 0
abs_dpad_x = 16
abs_dpad_y = 17
reverse_dpad_x = true
reverse_dpad_y = true
btn_north = 308
btn_east = 305
btn_south = 304
btn_west = 307
btn_select = 316
btn_start = 315
btn_mode = 314
btn_thumbl = 310
btn_thumbr = 311
btn_tl = 312
btn_tr = 313
btn_tl2 = 312
btn_tr2 = 313
btn_dpad_up = -1
btn_dpad_down = -1
btn_dpad_left = -1
btn_dpad_right = -1
Load these modules to modules.conf if they are not already in your configuration
sudo echo "hid-wiimote" | tee -a /etc/modules-load.d/modules.conf
sudo echo "uinput" | tee -a /etc/modules-load.d/modules.conf
sudo echo "joydev" | tee -a /etc/modules-load.d/modules.con
Then use bluetooth to sync up to the remote via MyOSMC
XBox Controller
First you need to install xboxdrv for linux to be able to communicate with the controller
sudo apt-get install xboxdrv
next create this config file /home/osmc/xbmc.ini
[xboxdrv]
extra-devices = false
extra-events = false
deadzone = 6000
device-name = "Microsoft Xbox 360 Controller"
[ui-buttonmap]
A = KEY_ENTER
B = KEY_BACKSPACE
X = KEY_X
Y = KEY_ESC
du = KEY_UP
dd = KEY_DOWN
dl = KEY_LEFT
dr = KEY_RIGHT
start = KEY_SPACE
back = KEY_L
white = KEY_C
black = KEY_I
TR = BTN_RIGHT # Left stick buttons
TL = BTN_LEFT # Right stick buttons
RT = KEY_EQUAL # Right trigger
LT = KEY_MINUS # Left trigger
[ui-axismap]
x1=REL_X:10
y1=REL_Y:10
LT^resp:127:255=ABS_Z
RT^resp:127:255=ABS_RZ
# EOF #
make this file executable by typing
sudo chmod +x /home/osmc/xbmc.ini
now edit rc.local
sudo nano /etc/rc.local
append this to the file before exit 0
/home/osmc/xbox.sh
Append modules to modules.conf
sudo echo "uinput" | tee -a /etc/modules-load.d/modules.conf
sudo echo "joydev | tee -a /etc/modules-load.d/modules.conf
Next make a script that binds all this together
create this file /home/osmc/xbox.sh
#!/bin/bash
sudo rmmod xpad
sudo /usr/bin/xboxdrv --config /home/osmc/xbmc.ini --id=0 --led=2 --silent --autofire RT=25 --autofire LT=25 --autofire du=200 --autofire dd=200 --autofire dl=500 --autofire dr=500 & sleep 2
the default configuration for xbox 360 for moonlight is located at
/usr/local/share/mappings/xbox360.conf