cross platform keyboard/mouse input recommendation

2019-02-16 09:54发布

问题:

Does anyone have any suggestions for a good cross platform input library? I'd like to get:

* at least keyboard and mouse input
* on at least the big three operating systems
* Small/fast
* C or C++
* permissive licensing gpl2/mit/free/etc.

So far I've seen:

* OIS (used in Ogre) http://sourceforge.net/projects/wgois/
* SDL (used everywhere it seems, might be a clue) http://www.libsdl.org/index.php
* Allegro http://www.talula.demon.co.uk/allegro/readme.html

Has any one used any of these, or know of something else that might be good?

Thanks

回答1:

I've used SDL for long time, but it still doesn't support multiple windows, and version 2.0 officially supports multiple windows.

So, beyond those you cited, I add these 2:

  • GLFW
  • SFML


回答2:

SDL it is quite popular in game development (at least small games)



回答3:

I ended up using the Qt framework for this.

It's very complete, well supported, has a lot of features, and has better licensing now. It was possible to use it with the Ogre3d library so it worked out well for me. I also found that it's being used by the City of Heroes MMO for their user interface.