Comments (3)
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.
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.
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)
- Undefined references to KEYBOARD functions HOT 1
- Keyboard has to be reconnected again to work :-( HOT 3
- Put SDL in portlibs directory? HOT 1
- Crash when unloading OGG music file HOT 2
- Wont compile HOT 2
- SMPEG Linking Errors When Using SDL_Mixer HOT 2
- Library does not work properly with libogc 1.8.7 HOT 1
- LIBPNG VERSION HOT 4
- SDL_Delay HOT 1
- SDL_image does not compile HOT 2
- configure script fails due to devkitPPC unitptr_t conflict HOT 10
- Stereo for sound effects is reversed. HOT 1
- Mouse sensitivity HOT 2
- 640 X 512 screen resolution
- Font redering HOT 3
- Wireless USB Keyboard not working
- Gamecube controller support HOT 2
- SDL_CondWaitTimeout makes an incorrect timespec HOT 5
- SDL_KillThread is not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdl-wii.