The biggest hurdle was that I needed to compile Mame with NO_USE_XINPUT = 0
Aside from that, it works great. Light gun games require the use of a cursor unless the game has a really good calibration routine. Honestly though it's best when you just shoot from the hip.
wminput's Joystick functionality is disabled via udev to avoid screwing up emulators that rely on joystick order.
mame needs to be told about the lightguns via hardcoded Xinput names
Xinput devices need hardcoded device paths
udev rules create symlinks for wiimotes to make Xinput happy.
wminput needs to be running before X starts (see wiimote init script)
Mouse has to be disabled in mame for this to work well, so the different wiimote buttons are mapped to unique keyboard presses. Mame (or X, not sure) does not recognize the full range of linux keypresses, so things get tricky.
I followed this guide to enable Wiimotes as a lightgun for Mame:
http://blog.novaslp.net/post/97113634233/wiimotes-as-lightguns-in-mame-on-linux
The biggest hurdle was that I needed to compile Mame with
NO_USE_XINPUT = 0
Aside from that, it works great. Light gun games require the use of a cursor unless the game has a really good calibration routine. Honestly though it's best when you just shoot from the hip.
My configuration is in a jumbled mess here: https://gist.github.com/elsonrodriguez/de9ad8dad7e1f672e2bd
Key points: