seeking input on input libraries
-
- OGRE Community Helper
- Posts: 766
- Joined: Mon May 16, 2005 12:09 am
seeking input on input libraries
I've been looking for a good cross-platform input library.
- Ogre's default one isn't meant to be great.
- Libgii sucks in my opinion.
- SDL I haven't tried but given what I've read I'd like to stay away from it.
- Glut I could use and it is very simple, but doesn't send events when CTRL itself is pressed, nor printscreen, pause or the other special characters.
- plib is the same.
Now I'm considering Allegro's input library. Oh not the whole package. Allegro is giftware, basically about as close to public domain as you can get without being public domain. So I'm considering ripping out their input system. I've already abstracted my code so I can switch back and forth between GII and Ogre's input. I could create a new class and port all of allegro's implementation from C to C++.
What I want are opinions on other possible libraries, or if you think this is a good idea. Their implementation doesn't look very large either.
- Ogre's default one isn't meant to be great.
- Libgii sucks in my opinion.
- SDL I haven't tried but given what I've read I'd like to stay away from it.
- Glut I could use and it is very simple, but doesn't send events when CTRL itself is pressed, nor printscreen, pause or the other special characters.
- plib is the same.
Now I'm considering Allegro's input library. Oh not the whole package. Allegro is giftware, basically about as close to public domain as you can get without being public domain. So I'm considering ripping out their input system. I've already abstracted my code so I can switch back and forth between GII and Ogre's input. I could create a new class and port all of allegro's implementation from C to C++.
What I want are opinions on other possible libraries, or if you think this is a good idea. Their implementation doesn't look very large either.
-
- OGRE Retired Team Member
- Posts: 3067
- Joined: Tue Feb 10, 2004 12:53 pm
- Location: The Netherlands
- x 1
-
- Halfling
- Posts: 86
- Joined: Mon Dec 13, 2004 9:47 am
- Location: Oregon, United States
If you know windows API, you could write your own pretty easily. Although that would tie you down to the windows platform if you were interested in porting your software to another system.
wumpus: the thing I don't like about SDL for input, is that the library does much more than just input. When I want a library to do input for me, I want it to only contain information relative to retrieving and notifying me when input occurs.
Thats the problem I see with a lot of libraries. They tend to try to do everything, rather than one thing well.
Just my $0.02
wumpus: the thing I don't like about SDL for input, is that the library does much more than just input. When I want a library to do input for me, I want it to only contain information relative to retrieving and notifying me when input occurs.
Thats the problem I see with a lot of libraries. They tend to try to do everything, rather than one thing well.
Just my $0.02
-
- Lich
- Posts: 1742
- Joined: Tue Apr 05, 2005 1:11 pm
- Location: Gosport, South England
- x 1
-
- OGRE Community Helper
- Posts: 766
- Joined: Mon May 16, 2005 12:09 am
@wumpus: Well that's why I'm seeking input. Through reading the forums here, I've read that one must use environment variables to get rid of extra windows and that sometimes didn't work. I've also read people having trouble compiling or using sdl on windows. I've got my code abstracted enough I could try out sdl.
@sarev0k: My main platform is linux. Windows-only is not interesting to me.
@sarev0k: My main platform is linux. Windows-only is not interesting to me.
-
- Goblin
- Posts: 282
- Joined: Tue Jan 04, 2005 6:56 pm
- Location: The Netherlands
That's the only real problem related to SDL. Other then this, it actually works great. This is also related to the compiling problem though, as compiling the SDL library differently fixed it for me.Chris Jones wrote:im also looking for an input library to use.
ive tried SDL, but i never managed to get it to work with the ogre window, it always made its own 1, i did what the tutorial said too, didnt work
Proud member of the OpenFRAG Game Development community
-
- Kobold
- Posts: 32
- Joined: Wed Jan 28, 2004 10:09 pm
- Location: Aalborg, Denmark
I'm also looking for an input library.
I've decided not to use SDL, as SDL have many depedencies not related only to input. Furthermore, the default Debian package of Ogre is GLX-based, which makes SDL impossible to use (please prove me wrong on this one!), and I'd really much like to stick with an easy-to-use package than spend time on compiling and maintaining the Ogre libraries myself.
libGii looks good on the paper, but I havn't got it working successfully. After the giiOpen-call, my framerate drops to way below 1. Very bad.
And oh - I'm a Linux (only) user, but I very much prefer to use a cross-platform library.
Any ideas, or should I (we?) try to roll my own simple OO (c++) input library? I'd be very interested to help out if no viable library can be found...
I've decided not to use SDL, as SDL have many depedencies not related only to input. Furthermore, the default Debian package of Ogre is GLX-based, which makes SDL impossible to use (please prove me wrong on this one!), and I'd really much like to stick with an easy-to-use package than spend time on compiling and maintaining the Ogre libraries myself.
libGii looks good on the paper, but I havn't got it working successfully. After the giiOpen-call, my framerate drops to way below 1. Very bad.
And oh - I'm a Linux (only) user, but I very much prefer to use a cross-platform library.
Any ideas, or should I (we?) try to roll my own simple OO (c++) input library? I'd be very interested to help out if no viable library can be found...
6 times 7 equals 42.
-
- Lich
- Posts: 1742
- Joined: Tue Apr 05, 2005 1:11 pm
- Location: Gosport, South England
- x 1
-
- OGRE Community Helper
- Posts: 766
- Joined: Mon May 16, 2005 12:09 am
I'm going to give sdl a shot. I have created my own wrapper for the input libraries, so sdl will plug in to it nicely. I feel it is a pretty good design. With a single change, end-user code can switch between ogre's input, libgii or sdl or another module. I'll be releasing this input wrapper after I've got it working with sdl. If sdl doesn't work for me then I'm going to make an additional module by ripping the allegro code.
-
- Kobold
- Posts: 32
- Joined: Wed Jan 28, 2004 10:09 pm
- Location: Aalborg, Denmark
Once i finish my last exam tomorrow, I'll hopefully have some time to look into a cross-platform input library. I imagine it will be much like the SDL-input, but I have a plan for making it simple to integrate with 'existing' windows (in x-windows, at least).
I would be very interested in your solution -- I have absolutely no idea on how allegro does stuff... libgii and especially the SDL way is pretty simple, but still needs to be torn apart, hacked upon and then put nicely together, which will take some time.
Cheers,
Jakob
I would be very interested in your solution -- I have absolutely no idea on how allegro does stuff... libgii and especially the SDL way is pretty simple, but still needs to be torn apart, hacked upon and then put nicely together, which will take some time.
Cheers,
Jakob
6 times 7 equals 42.
-
- OGRE Community Helper
- Posts: 766
- Joined: Mon May 16, 2005 12:09 am
-
- Lich
- Posts: 1742
- Joined: Tue Apr 05, 2005 1:11 pm
- Location: Gosport, South England
- x 1
-
- Greenskin
- Posts: 135
- Joined: Wed Feb 23, 2005 1:28 pm
- Location: Tokyo, JAPAN
Supporting a variety of input devices
As you guys are thinking about input handling, I'd like to encourage you to keep in mind that there's more input devices in the world than just mouse-keyboard-joystick. There are pressure sensitive tablets and spaceballs and all kinds of trackers and haptic armatures and midi keyboards and slider boxes and all sorts of things. So if you're going to write yet another input system, it would be nice if it could be easily extended with new devices. Which means there may be more raw sources of events than just the main Win32 or X-Win message loop, because not all of those devices generate windows messages. Some have to be polled, others have proprietary drivers that you just have to interface with directly that give you callbacks.
In addition to the SDL/GII/Allegro input handling that pretty much focuses on the standard WIMP/message-loop paradigm, there are also a few VR projects that deal with combining input from a bunch of sources (including networked sources):
These can be a source of ideas as well.
I'm working with Ogre/wxWidgets. So what I'm currently attempting to do is build an event system in my app that allows me to use wx as a source of mouse and keyboard events but also use other sources as well. For instance I want to be able to use any of the devices supported by VRPN by registering a "VRPNInputReader". Or generate events from a tablet by registering a "TabletInputReader" that communicates directly with the tablet device using the WINTAB library on Windows.[/list]
In addition to the SDL/GII/Allegro input handling that pretty much focuses on the standard WIMP/message-loop paradigm, there are also a few VR projects that deal with combining input from a bunch of sources (including networked sources):
These can be a source of ideas as well.
I'm working with Ogre/wxWidgets. So what I'm currently attempting to do is build an event system in my app that allows me to use wx as a source of mouse and keyboard events but also use other sources as well. For instance I want to be able to use any of the devices supported by VRPN by registering a "VRPNInputReader". Or generate events from a tablet by registering a "TabletInputReader" that communicates directly with the tablet device using the WINTAB library on Windows.[/list]
-
- Halfling
- Posts: 78
- Joined: Sat Mar 26, 2005 8:39 pm
-
- OGRE Community Helper
- Posts: 766
- Joined: Mon May 16, 2005 12:09 am
regress: I downloaded the source and looked through it searching for their input system. All I saw was a bunch of abstract classes and a wrapper for ogre's input. I have that already as well as a wrapper for SDL and GII.
baxissimo: Thanks for the suggestions. Honestly, I don't want to write an input library. I want to get enough input working for the applications that I do want to produce.
baxissimo: Thanks for the suggestions. Honestly, I don't want to write an input library. I want to get enough input working for the applications that I do want to produce.
-
- Lich
- Posts: 1742
- Joined: Tue Apr 05, 2005 1:11 pm
- Location: Gosport, South England
- x 1
-
- OGRE Community Helper
- Posts: 766
- Joined: Mon May 16, 2005 12:09 am
Yes, with the rest of my framework. It is version 0.1. Because of problems with libgii and with sdl not working at all the support for those two systems is light weight. Thus there is currently no joystick support.
http://www.ogre3d.org/phpBB2/viewtopic. ... highlight=
http://www.ogre3d.org/phpBB2/viewtopic. ... highlight=
-
- Goblin
- Posts: 222
- Joined: Mon Dec 27, 2004 5:21 am
-
- OGRE Retired Team Member
- Posts: 2543
- Joined: Fri Oct 24, 2003 2:53 am
- Location: San Diego, Ca
- x 2
Aklix I havn't been able to find anything like that. Do you have any links of interest?
The ogre Input system while not perfect, is useful; however, I am hoping to find something that supports joysticks, force feedback (would be nice), and action mapping. Or possibly writting a small input lib myself that could enumerate support for advanced features like that, or emulate features (like action mapping) and provide a sutiable API between different OS's. Probably using DirectX on windows, and maybe some of Allegro's code for other OSs (Allegro does look promising).
Though, I am still waiting to see what others find/use, and how much time I have.
The ogre Input system while not perfect, is useful; however, I am hoping to find something that supports joysticks, force feedback (would be nice), and action mapping. Or possibly writting a small input lib myself that could enumerate support for advanced features like that, or emulate features (like action mapping) and provide a sutiable API between different OS's. Probably using DirectX on windows, and maybe some of Allegro's code for other OSs (Allegro does look promising).
Though, I am still waiting to see what others find/use, and how much time I have.
Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
-
- Kobold
- Posts: 32
- Joined: Wed Jan 28, 2004 10:09 pm
- Location: Aalborg, Denmark
Hi all,
I'm back after a weeks hard work at the Roskilde Festival 2005, and will continue my work on a simple input library. I've already got some code ready and working, but it's not quite ready for the public yet.
The infrastructure of the library (which btw is named "libsinp") is very much like SDL, so it should be fairly easy to write drivers for other platforms than X11, which is the one I have to complete before releasing the lib.
Cheers,
Jakob
I'm back after a weeks hard work at the Roskilde Festival 2005, and will continue my work on a simple input library. I've already got some code ready and working, but it's not quite ready for the public yet.
The infrastructure of the library (which btw is named "libsinp") is very much like SDL, so it should be fairly easy to write drivers for other platforms than X11, which is the one I have to complete before releasing the lib.
Cheers,
Jakob
6 times 7 equals 42.
-
- OGRE Community Helper
- Posts: 766
- Joined: Mon May 16, 2005 12:09 am
Aklix, I suspect you are thinking of libgii, "LibGII is intended to be to input what our LibGGI library is to graphics." Basically with my experience with libgii, I don't want to try libggi!
makob, Very cool! Look in the allegro project for working interfaces for windows or x11 if you need them. That code is very free, so you can rip it without a problem. Not even lgpl.
makob, Very cool! Look in the allegro project for working interfaces for windows or x11 if you need them. That code is very free, so you can rip it without a problem. Not even lgpl.
-
- Kobold
- Posts: 32
- Joined: Wed Jan 28, 2004 10:09 pm
- Location: Aalborg, Denmark
Bump! 
Ok, I think my library is ready for inspection now. I've basically ripped SDL's event, keyboard and mouse handling apart and put it together again. The result is "libsinp" (library for simple input) -- boring name, I know... Sorry
You can fetch the sources via anonymous Subversion using
Build instructions:
So far, only an X11 input driver and a small test driver is implemented. But it works(tm)!
There's some notes/documentation in the doc/ directory you'd be interested in reading before testing the library. Also, the test/ directory contains some simple tests - the "x11test" is a somewhat proof-of-concept where the library is hooked up to an existing window. The "footest" does almost nothing.
I'm VERY interested in (constructive) feedback, bug reports and people who would like to give a hand in writing drivers/porting the stuff to other platforms than Linux/X11.
Cheers,
makob - makob@makob.dk
(note that I'll be on vacation from July 14 to July 25)

Ok, I think my library is ready for inspection now. I've basically ripped SDL's event, keyboard and mouse handling apart and put it together again. The result is "libsinp" (library for simple input) -- boring name, I know... Sorry

You can fetch the sources via anonymous Subversion using
Code: Select all
svn co https://makob.dk/svn/libsinp/trunk libsinp
Code: Select all
./bootstrap
./configure --enable-debug --enable-x11 --disable-foo
make
There's some notes/documentation in the doc/ directory you'd be interested in reading before testing the library. Also, the test/ directory contains some simple tests - the "x11test" is a somewhat proof-of-concept where the library is hooked up to an existing window. The "footest" does almost nothing.
I'm VERY interested in (constructive) feedback, bug reports and people who would like to give a hand in writing drivers/porting the stuff to other platforms than Linux/X11.

Cheers,
makob - makob@makob.dk
(note that I'll be on vacation from July 14 to July 25)
6 times 7 equals 42.
-
- OGRE Community Helper
- Posts: 766
- Joined: Mon May 16, 2005 12:09 am
Great news! This means your library must be licensed under LGPL. I'll make a wrapper for my framework and see about using it. I should have something by the time you're back from vacation.makob wrote:Ok, I think my library is ready for inspection now. I've basically ripped SDL's event, keyboard and mouse handling apart and put it together again. The result is "libsinp" (library for simple input) -- boring name, I know... Sorry
-
- OGRE Community Helper
- Posts: 766
- Joined: Mon May 16, 2005 12:09 am
I used the 'debian/rules binary' to make debian packages after configuring and making. However libsinp-dev_0.0.0.svn20-1_i386.deb depends on libsinpbroken (= 0.0.0.svn20-1), and libsinp has no libraries in it!
I made my own package with checkinstall and installed ok. I'll write back later when I've actually used it.
I made my own package with checkinstall and installed ok. I'll write back later when I've actually used it.