Make tvOS gamepad buttons send a message just once per physical press of a button - swift

I am making an Apple TV game and am programming the settings screens. The problem I am running into is that the Nimbus gamepad is sending multiple button pressed messages when I press the button just once. I would really appreciate it if someone could tell me if there is a way to make the controller send only one button tapped message when the button is tapped just once. I mean I would like it is there was a way to have only one message generated after I press a button and release the button. Thanks very much.

Looking at the GameController docs:
https://developer.apple.com/documentation/gamecontroller/gccontrollerbuttoninput?changes=_2
Are you using pressedChangedHandler or valueChangedHandler? IIRC, the Nimbus has pressure-sensitive buttons so you should expect to receive continuously changing values when the button is pressed or released. pressedChangedHandler should only be called when isPressed is toggled.

Related

How do i make a functional button in scratch?

I've been trying to make a button on scratch where if you press it once, it takes you to the help screen and if you press it again, it takes you back to the main menu. If anyone knows how to do this, please help! Thank you!
You could use two events. and you have everything on the help screen appear when one event happens, and hide when the other event occurs. Same with the main screen.
The code for the button would be something like this
when Green Flag clicked
go to front layer
forever
wait until mouse down and touching mouse-pointer
wait until not mouse down
broadcast msg1
wait until mouse down and touching mouse-pointer
wait until not mouse down
broadcast msg2
and for everything connected to the help screen,
when I receive msg1:
show
when I receive msg2:
hide
and for everything connected to the home screen,
when I receive msg2:
show
when I receive msg1:
hide
If you do not understand text for some reason:
Code for button:
Code for everything that is on main menu:
Code for everything that's on the home menu

Is it possible to remap the headset buttons

Is it possible using the SDK to change the bluetooth headset/remote buttons behavior. I would like to capture the button press(es) and perform some action, eg, skip next track, launch popup etc
I think you will receive appropriate callbacks from iOS when a button is pressed, and within these callbacks you can decide what to do.

iOS Objective-C UIButton action not working correctly

I am making a simple application for iphone (for learning and education purposes). Inside the .XIB file there is a button used to clear all text fields on the screen. I create a "clear:" method for the button. assign the method to "Touch Up Inside", but when I run the app in iOS Simulator the button acts like the "clear:" method has been assigned to "Touch Up Outside". I click the button nothing happens, I click and hold the button then drag my mouse pointer outside of the button and let go and all text fields clear. Can anyone help me make it so "Touch Up Inside" works properly? (If I am completely mistaken, and sound like a noob just tell me, I am a beginner)
Are you sure you have it hooked up correctly to TouchUpInside? Try deleting that Send Event association, and redoing it.
It should look something like this:

UILocalNotification in sleep mode on iPhone

I'm developing a Voip application.
When I press the lock button(app goes to sleep), and the server sends a request I present a local notification.
The local notification is presented as it should and The button slider text says "slide to answer". If I slide here, the app gets open.
However, if now I press again the lock button, and then unlock, the notification is still presented and the slider text has changed to "slide to unlock".
Now, when I slide to unlock, it's as if I pressed the "close" button on a regular notification bar, meaning the app won't open.
My question is why on the second time the local notification is still presented ? and if so, is there a way to track the unlock button event or the unlock slider so I can tell the server that I don't want to answer the call ?
Thanks
The notification is only a dialog (i.e., the user can interact with it directly) for a short time - until the device is locked again, either by using the button or automatically after a time-out of about 15 seconds.
After that, it turns into a notification. The user cannot interact with it directly, apart from reading the message.
Sorry, but it doesn't get any better unfortunately.

which UIButton event can act as a mouse over event like in flash

i would like to create a UIButton it will zoom in when mouse over it,can anyone tell me which event can do this
There is no mouse, only touches. How can you hover over a button without tapping it on a touch based interface? I dont think it works the way you think it does.
Hop into interface builder. Drop in a button and look in the attribute window.
You'll see the section that has Title: Image: Background. If you click on the drop down that says 'ALL', you can select several button states and set them accordingly. Use the highlighted state for when the user presses down on the button.
This should get you to understand how it works. You can dig into the docs to find out how to do it programaticaly from there.
Hover on the iPhone is a touch. Unless you're tracking where the finger is and you want objects to react when you enter their bounds. But the highlighted state should get you there.