Problem:
[When I originally typed this question, I wasn’t sure on some aspects, so some things are “discovered” throughout the problem description. This makes it look poorly worded. Please stick though or skip to the question at the end if you can help, this is a bit more of a theoretical question.]
We all know that different countries have different keyboard layouts,
But how would Enum.KeyCode and UserInputService work with this?
I ask because of the hash key (#) [save me the naming debate please].
On a British Keyboard, this is it’s own key adjacent to the enter key.
However on an American Keyboard, This is located on the 3 key and typed when shift is also pressed.
So if I wanted to use the # key to activate something (and I do), I think just using KeyCode 92 wouldn’t be good enough.
Playing about on studio with this simple script:
function onKeyPress(inputObject, gameProcessedEvent)
print(inputObject.KeyCode.Value)
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
If I try and press one of the shift accessible letters from my keyboard, it fires two separate events for both shift and the key.
I take it this is as these are designed for key presses rather than character inputs…
Question:
So I ask, is there an [quick] alternate method, to just capture character input key press?