Auto key press script

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Is there a code that automatically presses the keyboard when certain actions are performed in the game?

  2. What is the issue? Include screenshots / videos if possible!
    I’m asking because I want to fix the bug that occurs when I press the language change key.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    yes. but cannot find any similar solutions.
    i found “BindAction” which bind an action to user input. But what i wanna do is “binding userinput to an action”
    sorry if my English is hard to understand.

By pressing the keyboard, do you mean something like a key bind, or it’ll hold your key down?

Couldn’t you use something like Enum.KeyCode and then use UserInputService:IsKeyDown and if your ‘binded key’ is down, it will run a certain action.

I really can’t tell if you mean an action is done, something on your keyboard will be pressed, or if you press something on your keyboard something is done.

You can see more about IsKeyDown here.

1 Like

SetKeyDown and SetKeyUp or TypeKey would work, I suppose, but they are all LocalUserSecurity.


out of curiosity, could you explain what LocalUserSecurity is ?

LocalUserSecurity means this member cannot be used in scripts, but is usable in the command bar.

oh i see, but isn’t that unusable in op’s situation ?