Giter Club home page Giter Club logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 20, 2024
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 [email protected] on 17 Sep 2011 at 3:02

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 20, 2024
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 [email protected] on 1 Oct 2011 at 9:40

from sdl-wii.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 20, 2024
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 [email protected] on 5 Oct 2011 at 8:27

from sdl-wii.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.