Lack of keyboard input in a windowed Mac OS X application
Posted: Mon Jan 04, 2010 11:16 pm
Hi! I am using Irrlicht in Mac OSX 10.6 with XCode 3.2.1 and while the engine is great I have found that Mac OSX support is still far from perfect...
My biggest struggle with Irrlicht 1.6 in Mac is that it does not catch the keyboard input when the application runs in a window (it certainly works when the application runs in fullscreen, see createDevice() or createDeviceEx()). However, running in fullscreen is not the solution because sometimes (e.g, when the program crashes) the Irrlicht engine does not restore the Mac desktop (leaving the screen with a frozen rendering instead) and you must reboot the machine. There are other issues with the Irrlicht gui as well but this is probably left aside for a future post. In addition, the Irrlicht window does not appear on top of the other windows (which is quite annoying specially when you add a FPS camera animator node).
Regarding the keyboard problem, I have been diving into the CIrrDeviceMacOSX and my guess is there there is a problem with the routing of keyboard events (keyboard input is routed from the NSApp down to the NSWindow down to the Irrlicht event callbacks). In my desperation, I have been thinking in writting a Mac-specific modification of the Irrlicht engine but my current "solutions" will not preserve compatiblity with the other devices (i.e., Windows or Linux).
It would be great if we can make Irrlicht more compatible with OSX, any ideas/future plans to fix the keyboard problem and the other things?
My biggest struggle with Irrlicht 1.6 in Mac is that it does not catch the keyboard input when the application runs in a window (it certainly works when the application runs in fullscreen, see createDevice() or createDeviceEx()). However, running in fullscreen is not the solution because sometimes (e.g, when the program crashes) the Irrlicht engine does not restore the Mac desktop (leaving the screen with a frozen rendering instead) and you must reboot the machine. There are other issues with the Irrlicht gui as well but this is probably left aside for a future post. In addition, the Irrlicht window does not appear on top of the other windows (which is quite annoying specially when you add a FPS camera animator node).
Regarding the keyboard problem, I have been diving into the CIrrDeviceMacOSX and my guess is there there is a problem with the routing of keyboard events (keyboard input is routed from the NSApp down to the NSWindow down to the Irrlicht event callbacks). In my desperation, I have been thinking in writting a Mac-specific modification of the Irrlicht engine but my current "solutions" will not preserve compatiblity with the other devices (i.e., Windows or Linux).
It would be great if we can make Irrlicht more compatible with OSX, any ideas/future plans to fix the keyboard problem and the other things?