Open GoogleCodeExporter opened 9 years ago
I was able to get the Wiimote to act like a mouse in SDL, although I'm only
using it for positional information and not button states (I'm using the
wiimote as a joystick for those).
Did you try any of the following:
- Add SDL_INIT_JOYSTICK to your SDL_Init() call?
- Call SDL_JoystickOpen(0)?
- If handling the mouse via events instead of polling, have you tried calling
SDL_JoystickEventState(SDL_ENABLE)?
I'm doing all of those.
Original comment by benshadw...@gmail.com
on 17 Sep 2011 at 3:02
I think that if you do not use SDL_JoystickEventState(SDL_ENABLE), you should
use SDL_joystickUpdate to cyclically update the wiimote state.
The WPAD_ScanPads function, which updates the wiimote data (also IR), is called
only by SDL_joystickUpdate or cyclically by the SDL event management after
SDL_JoystickEventState(SDL_ENABLE) so you must use one of them to update IR
data.
The function PumpEvents in SDL_wiievents.c, which pumps the SDL events and
reads the keyboard, the real mouse and emulates a mouse with the wiimote, does
not call WPAD_ScanPads (or better PAD_ReadPending(0, NULL)). Therefore the IR
position is not updated.
This could cause some problems in some SDL applications.
I think this is the reason why in wii-uae the mouse emulation is jerky.
Wii-uae does not use SDL_JoystickEventState(SDL_ENABLE) but instead uses
SDL_joystickUpdate to read the Joystick status and therefore the emulated mouse
can stop working if wii-uae does read the joysticks status.
I am trying to find the best solution to solve this problem.
Original comment by olimpier...@gmail.com
on 1 Oct 2011 at 9:40
The game engine I'm porting (Aleph one) does call the following function :
void enter_joystick(void) {
SDL_JoystickEventState(SDL_ENABLE);
joystick = joystick ? joystick :
SDL_JoystickOpen(input_preferences->joystick_id);
return;
}
I still did not check if joystick_id is 0 or not.
Since I have a lot of trouble debugging the application (no way for me to
use gdb with the wii, and the game does not start with Dolphin), I can only
start working on it when I know I have at least a couple of hours of free
time, what does not happen so often :( !
I started to implement a remote logger so that at least I can see what
happens, but I'll have to revamp it in order for it to be mergeable with
main project's trunk so it will not be in the near days. May be in a couple
of week or so...
Anyway, thanks for your help, it is very appreciated !
Mathieu
Original comment by mathieu...@gmail.com
on 5 Oct 2011 at 8:27
Original issue reported on code.google.com by
mathieu...@gmail.com
on 30 Aug 2011 at 10:59