'A' Button Input isn't being detected?

Hey!

So I’m trying to make a system where you need to press the order of keys that show up. For console support, I’ve tried using UserInputService and ContextActionService. Neither of them detect the ‘A’ button. I’ve tried multiple controllers, tried print lines–no luck.

The code for using ContextActionService (I decided to switch over permanently, if possible):

Any responses are appreciated. Thanks!

1 Like

I’m not sure if this is correct, but I believe the default use of Button A is to allow Xbox users to jump. I suppose any other use of this button wouldn’t work, since it might interfere with the jumping animation.

Hopefully this helped! :happy1:

Except, a lot of menus use A, I believe. Correct me if I’m wrong, though.

Have you tried binding it at a higher priority to check if it is in fact a case of another action being performed and sinking the input?

Ideally you want to be the highest priority and actually sink the input yourself afterwards to prevent things like jump from performing afterwards while you are in this particular context.

Not sure, because I’m not an Xbox player myself. I believe what @BanTech suggested would probably help, because making the ‘A’ button a higher priority should “override” the jumping action.

Didn’t work. I’m very confused. I’ve asked several scripters and they say nothing should be wrong.

I agree, I can’t see anything immediately wrong with what you’ve shown. It’s not easy to fully check your code due to a lack of monospaced font, but it looks okay to me.

The device check may be an issue given you can’t actually check device on Roblox, but in general my guess is the issue is elsewhere when binding this handler or defining the device.

Do the other buttons work correctly?

Yeah, every other input works.

Well UserInputService above all else should work without any problem, regardless of priorities and whatever else, UIS will work.

If it doesn’t, the issue goes deeper into your code.

The easy way to check is to have a completely blank baseplate, add just that handler with your BindAction line, and check it correctly fires for all 4 buttons. If A still doesn’t work you know it’s something with this bit of code. If it does work then you know it’s something else in your game.

The only thing is, it isn’t registering. I can put a print line at the top of the function (first line) and nothing prints on ‘A’ being clicked.

Supports the theory that the input is being sunk in another bound action, but if you say you’ve tried binding at a very high priority and have tried UIS then that contradicts it.

UIS would work, but gameProcessed would be true.
Binding at a very high priority would also work.

If neither work and you’ve done what I suggested with a blank place with only this code in it and nothing else, then I don’t know what else to try. I use ButtonA for lots of things without issue so there’s more to this.

Please share your BindActionAtPriority and UserInputService attempts as well as your blank baseplate attempt to just double check there isn’t anything wrong with those that is adding confusion to the mix.

Enum.ContextActionPriority.Default.Value +100
Ought to work.

Hold on, Priority is greater? I thought 1 was better than 100. My bad. I’ll test that soon.

“I did it! I did it! I did it!..okay, we did it.” - Dr. Suess’ The Cat in the Hat Movie

Okay, so after screaming at my monitor for…mehhhh, around 30 minutes, I figured out the issue. It was getting caught in the if statement, if processed then return end. Don’t ask me how, I have no clue.

The way I fixed it was changing that if statement to: if processed and input.KeyCode ~= Enum.KeyCode.ButtonA then return end. Hacky, but it works for now. This appears to be a bug, though.

Thanks so much for the help, everyone!

4 Likes

Even after two years, this bug is still an issue.

The GameProssedEvent boolean seems to always return true when ButtonA is pressed which is really annoying. This post actually stop an hour worth of headaches. Thank you