Pressing F7 is detected as pressing C

Having a strange problem which I can’t seem to find a way to fix. When I press F7, UserInputService KeyCode detects it as pressing C, and F8 is detected as B. I’ve tried checking for the InputObject.KeyCode.Value and InputObject.KeyCode.

The code below should only print when you hit C but it prints if you hit F7 as well.
local UserInputService = game:GetService(“UserInputService”)

UserInputService.InputBegan:Connect(function(Input)
	if Input.KeyCode.Value == 99 then
		print("C has been pressed")
	end
end)

Any help is appreciated.

4 Likes

Try doing

local UserInputService = game:GetService(“UserInputService”)

UserInputService.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.C then
		print("C has been pressed")
	end
end)

Also, just tiny note, on my laptop F2 detect as C for some reason.

Same result whether you check for the KeyCode or KeyCode.Value, I’ve already attempted doing that.

1 Like

I have the same issue but on my keyboard pressing F2 / F3 (I forget which key, it’s only one of them) is considered pressing C.

Try using 288 instead of 99 and tell me your results.

1 Like

288 won’t register as F7 or C for some reason.

1 Like

Hmm… do you use a laptop or a PC?

If it helps to add, I do use a laptop.

I have the same issue but on my keyboard pressing F2 / F3 (I forget which key, it’s only one of them) is considered pressing C.

1 Like

Laptop, but a lot of my friends seem to be having the same issue and they use a PC.

1 Like

Try holding fn + F7, and tell me if it works

(@Mrflashmaster21 you too)

1 Like

Can’t do that right now, sorry. :confused:

1 Like

@Mrflashmaster21

The only other reasonable answer I can think of for why it’s not working correctly is if your keyboard settings match the one of the language you speak (English in this case.) If it does, then I would troubleshoot my keyboard, but that’s all I can think of.

Tried doing the FN + F7, not working.

30 characteerrrrss, new to the dev forum not sure why it’s not letting me post under 30 characters.

Its a thing the devforums has that restricts the use of unnecessary short replies.

Maybe go to https://www.keyboardtester.com/ to test your keyboard. Other than that, I don’t know.

To prevent spams on topic, it’s actually a great feature. :smile:

1 Like