Are you using lr-pcsx-rearmed? I recently submitted some updates to that emulator.
Previously, the GunCon trigger, A, and B buttons were hard coded to the mouse’s left, right, and middle buttons. I switched it so that those are instead mappable via Libretro’s Gun Trigger, Gun Aux A, and Gun Aux B. I also added the Gun Reload input for button-activated offscreen shots.
Does your Wii remote rearrange the button configuration when a nunchuck is attached? You can go into the RetroArch menu and remap buttons if so and if you’re using the latest version of that emulator.
Lr-duckstation should already operate the way I described above, perhaps without the Gun Reload feature (I never tried it).
And if you’re using neither of those emulators, then I don’t know. Someone else will have to help you 😀