Where to Begin

Hello. I am a novice programmer and I need help from the better. Basically I've gotten back to Xcode with more focus and now I will ask people here for help.


First question. How do I move an object with the arrow keys? I'll put this simple so I can (At-least) get an answer.



Thanks.

Replies

No help? Typical.

That's perhaps a bigger question than you realise. We know nothing about what you've done so far, which makes pitching an answer at the right level very difficult. I suggest you watch the WWDC content for SceneKit (Google "wwdc scenekit" turns up five videos) as a starter, and download, build and experiment with the "Fox" demo code that's provided alongside the more recent ones. That's written to build on iOS *and* for Mac, so definitely has keyboard input.

I'll give it a try. You're literaly the first person here to reply to me. Thanks.🙂

As was said, you have to be more precise when you ask question.

- Is it IOS / OSX (you speak of arrow keys, so it is probably OSX)?

- Is it SceneKit (likely because you posted here) or a drawing application ?

- have you some code already ? (I understand no)


When questions appear too large, you don't get many answers. That's it.


You should implement the keys handling as follows:

override func keyDown(theEvent: NSEvent)

h ttps://developer.apple.com/library/content/documentation/Cocoa/Conceptual/EventOverview/HandlingKeyEvents/HandlingKeyEvents.html


See:

h ttps://developer.apple.com/library/content/samplecode/Fox/Listings/Swift_Common_GameControls_swift.html


have a look here as well :

h ttps://stackoverflow.com/questions/31881911/use-arrow-key-input-for-scenekit-game-in-swift