Remote controller library + test

Here’s something I’ve been working on.
It is a front-end for hopefully making working with the remote easier (and adds some useful functionality).

Here’s a demo with source. You’ll need to build and copy to device from the build options, as some info is sent to the console, but there’s an on-screen guide to the important bits.

https://www.dropbox.com/s/3gwxtxjfkcxekac/Apple%20TV%20Control%20test.zip?dl=0

It isn’t yet finished, but here’s what currently happens:

Button Z (light touch on pad) and button A (hard touch on pad) return x and y absolute positions.

Instead of axis and relativetouch events, these two buttons now have a moved phase as well as up and down.

Button also as a cancelled phase (for when you touch the pad lightly before pressing harder).

So all keys are treated mostly the same.

All button a and Z events will eventually return valid absolute and relative events, and will include things like distance, angle, most aligned axis etc.

Things to do:

  • addition of a resumed phase to button Z or cancelled to button a (for when a hard touch becomes a light touch, ie the reverse of my current button Z cancelled phase)

  • a fast light touch isn’t yet registered, but it will be.

  • you can’t detect when the menu button is pressed down. When you release it, you’ll get both the down then up events. Can’t fix that, it is apple controlling it.

I cheekily set menu to not quit the app so you can test it. To get out either press the screen button or hold the menu button for a few seconds. This last bit of functionality is likely why we don’t get a menu button down event immediately.

  • my dX dY properties are not correct yet, nor I think are the time / duration things. Yet :slight_smile:

Let me know what you think guys.

Hey rakoonic,

I have downloaded and reviewed your sample project. I also ran it in the simulator. I am confused as to what I am supposed to use it for. When you say “build and copy to device” do you mean tvOS or iOS? At first I thought this library was some sort of helper to simulate the tvOS remote so that would mean building it for iOS. But having reviewed the code, it seems now that you actually mean to build this for tvOS. In that case, I am confused as to how this is useful. Judging by the amount of code and your bullet lists above this is very useful for some purpose. I just don’t know what it is yet. :mellow:  Can you please elaborate?  :slight_smile:

Essentially through no fault of corona (it is Apple’s libs), making the best use of the controller(s) can be complicated, and lacks certain functionality.

This lib is my attempt to simplify these controls (all buttons / actions now use the same event model), add in functionality I need and think others could want (both absolute and relative coordinates of *all* track pad events), and also remove limitations (button Z was limited to only a single controller, now it is device specific).

Once I finish it, I’ll try to do some samples as well.

Hey rakoonic,

I have downloaded and reviewed your sample project. I also ran it in the simulator. I am confused as to what I am supposed to use it for. When you say “build and copy to device” do you mean tvOS or iOS? At first I thought this library was some sort of helper to simulate the tvOS remote so that would mean building it for iOS. But having reviewed the code, it seems now that you actually mean to build this for tvOS. In that case, I am confused as to how this is useful. Judging by the amount of code and your bullet lists above this is very useful for some purpose. I just don’t know what it is yet. :mellow:  Can you please elaborate?  :slight_smile:

Essentially through no fault of corona (it is Apple’s libs), making the best use of the controller(s) can be complicated, and lacks certain functionality.

This lib is my attempt to simplify these controls (all buttons / actions now use the same event model), add in functionality I need and think others could want (both absolute and relative coordinates of *all* track pad events), and also remove limitations (button Z was limited to only a single controller, now it is device specific).

Once I finish it, I’ll try to do some samples as well.