High level API for gesture and keyboard input

I’ve requested this, but I request this again. Just as a reminder. Hopefully 2LL will consider this requested feature -seriously- for v1.4. :slight_smile:

First of all, I’d like to congratulate and thank 2LL for the release of v1.3. It’s all great! Especially for the text API and the physics engine (though this one need more features). I haven’t playing with them by myself due the high load of my work, but from the given demoes/examples I know they’re all great. :slight_smile:

Second of all, it’s about what I use Codea for. I mainly use Codea for code prototyping and brainstorming. Both for myself or my team. I’m not a visual programmer, so I’m not using Codea quite often. But when I need to do it (visual coding), I’ll use Codea definitely.

For that use case, I prefer high level and ready-to-use APIs. I know how to use the given APIs, including the ones I considered as low level. But this low level codes distract the important codes. For example, code to detect gestures. It requires some 20 LOC spread here and there just to be able to detect a two fingers pinch. It also happen to detect keyboard input, though to a lesser extend.

What I expect is a much simpler function or class for common gestures detection and keyboard input. I expect gesture can be handled like the touch class, that automatically detected by using touched() function, with all the important informations (state, position, delta, etc) already there ready to be queried. I expect gestures (also keyboard events) can be detected using similar mechanism. This way I can focus more on the idea, not on how to code the idea. :wink:

If I remember correctly, I had reported this on the bug tracker. Feel free to ask me to report this if my memory serves me wrong. I do hope this features will be provided by 2LL on the next major version. finger crossed :slight_smile:

Thanks for the feedback, @bee.

The physics engine needs more features, yet you haven’t used it?

Have you tried using @Andrew_Stacey’s touch handling library? A high level gesture API is something you can quite easily build yourself, once, and use everywhere from that point on.

I agree that we should include this at some point. Maybe even in version 1.4. But that should not stop you from making it for yourself right now, so you can use it.

Custom sprites, find and replace, et al. are taking priority over this feature as they are things people can not build themselves without support from us.

I agree we need a better gesture API, but I think the keyboard is extremely easy. Now that I’ve gotten a hang of Codea, I’m starting to write my own libraries, so I think I’ll en up writing a gesture library soon. What are the other difficult things to do in Codea, because I think gestures are the hardest thing to do.

@simeon: I looked at the physics demo code and study it a bit and I also read some thread in this forums about it. I want to play with it more as I have more free time.

I haven’t try Andrew’s gesture library. I’ll take a look at it later. Though I prefer it built-in, I could use it temporarily until it’s provided in the future. I know such features can be build by myself, or utilizing other users’ library, but it doesn’t have the “magic” (automation, ease of use, convinience, reliability, support, etc) such as built-in features. The magic of high level API is also something that can’t be done by the users. :slight_smile:

Of course you should work on things that are more important by 2LL consideration. This is just a user request after all. :slight_smile:

No problem, @bee, and I appreciate the suggestion. My point is: don’t let it stop you implementing it yourself if you need it, and don’t let it stop you importing other peoples’ code to do it. You can do it right now and you should — from reading your request it sounded like something you need right away.

You might even find that whatever solution you end up with is better or more flexible than what we include in the future.

You might even find that whatever solution you end up with is better or more flexible than what we include in the future.

I doubt it. :slight_smile: The way you implement drawing text API, for example, is way over my best expectation. I didn’t expect it would be THAT great. And it’s also fast, even on my iPad 1. I mean this is Codea, something that isn’t intended for serious and professional coding tool. Yet the quality is not far from XCode 4 or Visual Studio, at least for an iPad app.

I believe you -and 2LL for the matter- will provide the best possible implementation for any features in Codea. This is very well understandable since Codea is your creation. Nobody understand a creation like its own creator. :slight_smile:

(cough cough export to Xcode cough cough) 8->

I applaud @Simeon’s response. We should not wait on or feel constrained by the fact that Codea currently does not offer a high level gesture API, for there are workarounds.

At the same time I totally agree with @bee: Codea’s success depends on how much it helps us focus on ‘code ideas’ rather than how to implement such code. Well said @bee!

A pertinent discussion.

Also agreed:

  I believe you -and 2LL for the matter- will provide the best possible implementation for any features in Codea.