Wiimote as mouse/lightgun not working
-
Pi 4b 8gb
cannakit psu
Image made directly from retropie.org.uk download
retropie 4.7.1retropie 4b 8gb
sd image made from retropie.org
retropie 4.7
i have a usb keyboard and 2.4ghz wireless mouse (not bluetooth) plugged in while doing these tests. I have tested without the wireless mouse plugged in with same results.***I am using an oem Nintendo Wii sensor bar that was modded to work in a standard usb A ports and NOT a mayflash Dolphin bar. This was done by cutting off the wii proprietary connector and soldering the wires into a usb A connector as well as removing 4 LEDs out of ten to bring the voltage down to under 5v. It works perfectly fine for wiimote tracking. ***
Almost all the guide I see for using wiimotes in lightgun games such as duck hunt use a dolphin bar and not a standard wii sensor bar. Why am I using an oem sensor bar? Because the dolphin bar went way up in price after the tariff war with china, and I have quite a few oem wii sensor bars so why not.
Here's what I've tried so far:
Using wminput aka method 1 in the wiki I was able to get the wiimote to work as a mouse tilt wiimote up and down side to side left mouse button mapped to wiimote button b and right mouse button mapped to wiimote button a. The other buttons and d pad on the wiimote are mapped to keyboard keys. No thanx to the guide on using the ir tracking functions .
You have to read up on the wminput github page as to how to get the wiimote to map as a mouse/keybpard vs a joystick. You need to use
Plugin.acc.X = REL_X
Plugin.acc.Y = REL_Y
and map at least a left mouse button to a wiimote button. This turns the wiimote into a mouse/keyboard configuration and this works in lxde in the Retropie menu and in the retroarch menu in game but wont work as a controller (even though some of the buttons on the wiimote are mapped to keyboard keys and keyboard itself works) or mouse (real mouse also works fine) to use in games such as duck hunt. I've tried nestopia and fceumm emulator that comes preinstalled with retropie.I could also use the motion/tilt as a joystick input using :
Plugin.ir_ptr.X = ~ABS_X
Plugin.ir_ptr.Y = ~ABS_Y
in the wii button mapping config file. This works in retropie menu and in the retorarch menu as well as being able to somewhat(very difficult) control a game in an emulator BUT still doesnt work as a pointer or mouse in duck hunt. So you still can't use it as a shooting device.I have tried a couple different emulators along with different configurations in retroarch to try to get this wiimote to work as a mouse in the duck hunt game. It works fine everywhere else as mentioned but not in the game. This is so frustrating.
I realize I could make it work with a mayflash dolphin bar but thats not the spirit of the pi and now I'm really intrigued as to how to get this to work using the hardware currently I have. With that said please dont post "buy a dolphin bar" as that's not helpful in the least.
-
So I was able to make this work by simply unplugging the mouse from the pi, leaving the controller settings in retroarch for fceumm set to auto NOT zapper, and then under settings change zapper mode to mouse.
My wminputA file is as follows:
#IR for mouse REL - fps style
#Plugin.ir_fps.X = REL_X
#Plugin.ir_fps.Y = REL_Y#ir_ptr
Plugin.ir_ptr.X = ~ABS_X
Plugin.ir_ptr.Y = ~ABS_Y#custom buttons
Wiimote.A = BTN_RIGHT
Wiimote.B = BTN_LEFT
Wiimote.Up = KEY_UP
Wiimote.Down = KEY_DOWN
Wiimote.Left = KEY_LEFT
Wiimote.Right = KEY_RIGHT
Wiimote.Minus = KEY_ESC
Wiimote.Plus = KEY_ENTER
Wiimote.Home = KEY_LEFTALTWiimote.1 = KEY_LEFTCTRL
Wiimote.2 = KEY_SPACENunchuk.C = KEY_C
Nunchuk.Z = KEY_Z#plugin for nunchuk stick
Plugin.nunchuk_kb.Up = KEY_W
Plugin.nunchuk_kb.Down = KEY_S
Plugin.nunchuk_kb.Left = KEY_A
Plugin.nunchuk_kb.Right = KEY_DPlugin.led.Led1 = 1
#EOF
#IR for mouse REL - fps style
#Plugin.ir_fps.X = REL_X
#Plugin.ir_fps.Y = REL_Yworks as a mouse in zapper games BUT not even close to as well as
#ir_ptr
Plugin.ir_ptr.X = ~ABS_X
Plugin.ir_ptr.Y = ~ABS_Yso I'd use the ir_prt not ir_fps mapping.
I've found that if you forget to unplug your mouse before you start the game you can simply unplug it and the wiimote will take over immediately as the mouse.
If using a wireless mouse you must unplug the dongle not just turn the power off to the mouse. This could be problematic for wireless keyboard/mouse combos as you have to unplug the dongle and lose both keyboard and ouse function.
So far I havent been able to get the hot keys to work in game (even thought they work fine in emulationstation) to exit the game and have to use the keyboard for that unless you have a gamepad installed (which doesnt interfere with the wiimote as a mouse as a zapper) then you can use the game pad to exit the game.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.