adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-devel] New input system working & documented


From: Alexandre Courbot
Subject: [Adonthell-devel] New input system working & documented
Date: 28 Feb 2002 15:59:35 +0100

I've just commited the new input system. You can test it with alextest,
as before.

This time joystick and control events are working. The manager supports
up to 5 joysticks, with 10 axis and 10 buttons each. The definitions for
the logical controller will change, as I don't remember exactly what
James had in mind (and whether the buttons should be named A, B or
ACTION, RUN, etc...). For now, it supports 4 direction buttons and 4
action buttons.

In alextest, the character only catches control events (and keyboard
events, so you can quit by pressing ESC). Therefore, they must be mapped
before doing anything. In main(), the directions are mapped both to
keyboard direction keys and first joystick axis 0 and 1. The A button
(which makes the character run) is mapped to the control key the 'r'
key, the first joystick's button 1, and mouse right button, which means
you can move the charcter with your joystick while running by pressing
the right mouse button! On your joysticks the axis might not be mapped
the same way as mine however (I've a weirdo "plenty-o-buttons" one), so
the player might go up when you press left, etc. But feel free to modify
main.cc to map the keys you like! ;)

You'll notice that there is a input_manager_SDL.cc file. It contains all
the input code that is SDL dependant. That is, if we want to support
another library, we'll just need to write an input_manager_<lib>.cc file
and link to this one instead. The good news is that the Python wrappers
won't need to depend on SDL anymore, as we have our own keys/buttons
enums now.

Voila, hope you like it! Comments, improvements, precisions about the
logical controller (James?) are welcome! :)
Alex (who definitely have to plug some SNES pads on the // port now).
-- 
http://www.gnurou.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]