I am having issues with input.KeyCode = Enum.KeyCode.Plus

It’s simply not triggering.

	if key.KeyCode == Enum.KeyCode.Plus or key.KeyCode == Enum.KeyCode.KeypadPlus then
		FirstInput = false
		if Input1 == "" then return end
		functioanlity = "+"
		output.Text = Input1 .. functioanlity
		click:Play()
	end```
3 Likes

works fine for me, do you have numlock enabled on your keyboard?

my code:

game:GetService("UserInputService").InputBegan:Connect(function(key)
	if key.KeyCode == Enum.KeyCode.Plus or key.KeyCode == Enum.KeyCode.KeypadPlus then
		print("+")
	end
end)

My only other guess is that you have something wrong with the rest of your code, hard to tell though with the small bit of code you gave.

The only one that doesn’t work is the one that isn’t on the number pad. It might be a problem with my keyboard.

Have you tried printing the input.KeyCode to see what your keyboard button is actually mapped to?

It’s returning Equals and not plus after further examination.

You mean the one that has both the plus and equal?

No quite literally Plus is returning “Equals” but equals is returning Equals as normal. If I understood that correctly.

Does the plus on the number pad return plus? The one thats not on number pad do you mean this key?
image

It’s either you are not pressing shift + =, just =, or there is another issue. Can you show us the output window after pressing plus?

Assuming it’s the first thing, I would make it detect equals instead of plus.

Issue is, I am having something else that is using equals, and yeah one second let me get the output window.

I do and it does return plus yes, although on my keyboard = is above plus dont know if that matters.

image_2023-08-16_190029718

This is what my output looks like for input.KeyCode

They key that returns equal, is that the double =+ key?

Yeah it is. Is that where the issue is coming from?

Is the plus on top, or on bottom?

It’s on the bottom the equals sign takes priority.

Ok, that probably is the issue that equal sign takes priority, and roblox may not be able to detect the key combination that results in a plus.

Do you have any solutions to offer

Sure, what are you wanting it to do after it detects?

I just need to know how to detect the plus.