Keyboard events don't work with irrlicht on Xcode - xcode

When I run my Irrlicht application in Xcode, I can't use keyboard input:
If I press a key while the application is running, I end up writing that letter on whichever window was opened before the application, for example: I'm editing my code, than I press Build/run, the application opens (I press with the mouse on the window just to make sure it is focused) and than I press a key and that letter is written in the editor window...
I am certain the problem is not from the code, because if I press the top bar of the application's window, press the key, and release the mouse button (in a fast motion) the event gets fired..
Now, from what I read in this link (fourth post), it seems there's an incompatibility between command-line application with Xcode and irrlicht. The guy changed to a Cocoa application and got it to work. I don't know how to do this, since Irrlicht uses lots of namespaces and with cocoa I get loads of problems with it..
Any idea? thanks!

Well after a random search i found this guide:
http://irrlicht.sourceforge.net/forum/viewtopic.php?f=5&t=13890&start=60
Some things were different with my Xcode 3.2.6 (e.g. i had no *AppDelegate.m, *AppDelegate.h nor *.xib file) but easy to get to the end of the tutorial.
In the end i got like 1000 errors, something to do with precompile appkit.h errors, and with a quick search here is the solution for all those errors:
http://www.cocoabuilder.com/archive/cocoa/194905-xcode-cocoa-project-with.html#195211
easy peasy :)

Related

Minimalist cocoa app, how to create a menu bar?

I’m just trying to create a window in cocoa. I wanted to use this code as a basis but somehow the app menu does not show up (still shows the one from the terminal, un-clickable though).
Can anybody give me a hint what might have changed in cocoa since that article was written? I’m using Yosemite.
It works fine for me, but I had to Cmd-Tab switch away and back again to the running executable before the app menu became active. I tried appending a space and the ampersand symbol to the end of the code, which tells the shell to background the task, thinking it may launch normally then, but to no avail.
You might try appending an AppleScript command such as tell application MinimalistCocoaApp to activate after the command to launch ./MinimalistCocoaApp (separated by a semicolon). I'm not sure the "compile and run" terminal command for AppleScript, but that should be easily Googled.

SDL 2.0 on Mac - how to activate/respond to greyed-out Toggle Full Screen menu item?

Working on porting a Windows game to Mac using SDL2, and I noticed on the Mac that the menu bar for the game includes a View menu with an item Toggle Full Screen. I'm assuming SDL put it there automatically, as I didn't request it anywhere in my code. However, since the game can run in a window or full screen (and the window is resizable), I figure I should make this menu item actually work somehow.
I know practically nothing about Mac OSX coding (I just followed a tutorial to get my SDL app to build on the Mac side in XCode), and I can't find anything in the SDL documentation about how to respond to, activate, or remove this menu item (or other ones that are greyed out, like the Minimize option in the Window menu). Best I could find online is a reference to it being added in a commit to the SDL code base, but nothing in the commit message about how one is supposed to hook it up to their application code.
So, how do I activate and respond to this menu item (and any other menu items that only show up in OSX builds for that matter, like Minimize and About)? And is it something I can hook up in a cross-platform way via SDL itself, or did SDL add something that I have to deal with using platform-specific OSX code?

XCode 4.5 Documentation Screen obscures main project screen

I am using xCode for the first time - since 1986 I've used other IDE's (turboPascal, JBuilder, Eclipse, NetBeans, Tibco BW...) but to the uninitiated Xcode seems reach new levels of awkwardness.
Every time I access help e.g 'API documentation help' the documentation screen obscures all other windows. Presumably there is a magic key that dismisses the documentation screen and return me to the main project screen. (Like a back button in a browser). I've tried many key combinations.
Is there a magic key that always gets you back 'as you were'?
You can set a shortcut to switch between the windows of the active app in System Preferences → Keyboard → Keyboard Shortcuts. I prefer Alt+Tab.
This will allow you to switch between the documentation and the editor window with a shortcut. You could also use Cmd+W to close the documentation window.
Use command + ~ to alternate between views, this works in every app on macosx.

Instruments 4.1 unresponsive to projects launched from Xcode 4.1 until pressing Cmd-Tab

If I open Instruments and select a standard application (e.g. Mail or MS Word) it has no issue.
If I am in Xcode and I go to Product > Profile (or press Cmd + I), it launches Instruments, allows me to select a template, and loads the standard screen. Then the downward arrow starts tracing to the right as it should, and the iOS simulator launches the program. However, nothing is plotted in Instruments. It shows no changes to anything no matter what the app is doing. I can't click anything in Instruments: no menu's, can't stop recording, can't open tabs, etc.
I randomly discovered that if I hit Cmd + Tab, Instruments will start behaving normally. This seems really strange to me. Either it's a bug or it's a hole in my knowledge about how to operate Instruments.
Strange bug is fixed in XCode 4.2!
The problem was the hidden password dialog, so sometime it works and sometimes not.
One of possible solutions was:
Run Instruments
Cmd Tab to Xcode covering the instruments. Cycle and hide messages until password dialog is found.
Close Xcode.
PS: I know it is a few years to late for the answer, I was just looking for unanswered questions. Just check as answered - > it's good for both of us. )

Control-Command-Up not switching to counterpart file in Xcode on Lion.

Since the three finger swipe has been stolen in Lion, I find myself forced to resort to the keyboard to switch between .h and .m files. Two finger swipe left and right only seems to work infrequently, and that should be for scrolling anyways.
The keyboard command should be Control-Command-Up, but for some reason this takes me out of Xcode and shows the project file in Finder.
I have checked both System Preferences, and Xcode's key bindings settings, and I can't find anything wrong. Xcode is set properly, and I can't find any conflicts.
Do you by any chance have another program such as Afloat installed that might be taking over the key combination? For instance, Afloat uses the Control-Command-Up key combo to do just what you described - show the open application's file in Finder.
Besides changing the key combo, the Xcode default Control-Command-Down will also switch to the counterpart.
I think it's a bug. For now I assigned another key combination: ^Q and ^Z to "jump to counterpart" and it works.

Resources