Commit 0ef9b20b authored by Rogerborg's avatar Rogerborg

Stop linux/joystick.h from including linux/include.h, as this #defines many...

Stop linux/joystick.h from including linux/include.h, as this #defines many KEY_FOOs which override the irr::KEY_FOO values.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1690 dfc29bdd-3216-0410-991c-e03cc46cb475
parent a4ed0d8e
...@@ -216,7 +216,7 @@ int main() ...@@ -216,7 +216,7 @@ int main()
To be able to look at and move around in this scene, we create a first To be able to look at and move around in this scene, we create a first
person shooter style camera and make the mouse cursor invisible. person shooter style camera and make the mouse cursor invisible.
*/ */
scene::ICameraSceneNode * cam = smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f); smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
device->getCursorControl()->setVisible(false); device->getCursorControl()->setVisible(false);
/* /*
......
...@@ -22,10 +22,17 @@ ...@@ -22,10 +22,17 @@
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ #if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
#include <fcntl.h> #include <fcntl.h>
#include <linux/joystick.h>
#include <unistd.h> #include <unistd.h>
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
// linux/joystick.h includes linux/input.h, which #defines values for various KEY_FOO keys.
// These override the irr::KEY_FOO equivalents, which stops key handling from working.
// As a workaround, defining _INPUT_H stops linux/input.h from being included; it
// doesn't actually seem to be necessary except to pull in sys/ioctl.h.
#define _INPUT_H
#include <sys/ioctl.h> // Would normally be included in linux/input.h
#include <linux/joystick.h>
#undef _INPUT_H
#endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
namespace irr namespace irr
{ {
...@@ -1340,7 +1347,7 @@ void CIrrDeviceLinux::createKeyMap() ...@@ -1340,7 +1347,7 @@ void CIrrDeviceLinux::createKeyMap()
void CIrrDeviceLinux::initialiseJoysticks() void CIrrDeviceLinux::initialiseJoysticks()
{ {
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ #if defined (_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
u32 joystick; u32 joystick;
for(joystick = 0; joystick < 32; ++joystick) for(joystick = 0; joystick < 32; ++joystick)
{ {
...@@ -1392,7 +1399,7 @@ void CIrrDeviceLinux::initialiseJoysticks() ...@@ -1392,7 +1399,7 @@ void CIrrDeviceLinux::initialiseJoysticks()
void CIrrDeviceLinux::pollJoysticks() void CIrrDeviceLinux::pollJoysticks()
{ {
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ #if defined (_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
if(0 == ActiveJoysticks.size()) if(0 == ActiveJoysticks.size())
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment