Is There a Way To Press a Key Without Actually Pressing a Key?

Let’s say hypothetically I wanted to make some key trigger shift lock, that isn’t the shift key (I’m not actually doing that but that’s just the example).

Is there any method that would fit the description of UserInputService:FireInput(Enum.Keycode)

Or any sort of hacky way or simulating that (probably there isn’t a method for that though).

Just wondering, I’m thinking of making something cool with that.

1 Like

You can make a separate function that runs when UserInputService is fired:

-- This function will run everytime the UserInputService event is fired
local function ON_INPUT(input: InputObject, gameProcessed: boolean)
   if gameProcessed then
       return
   end

   --...
end

UserInputService.InputBegan:Connect(ON_INPUT)

-- You can fire the function separately like this:
ON_INPUT({KeyCode = Enum.KeyCode.Z}, false)
-- This will run the same function with the same information

But no, you cannot fire RBXScriptSignals (unless you’re talking about BindableEvents)

2 Likes

Ah yeah I just wondering if it was possible to fire a key like if you pressed this TextButton it would for example fire InputBegan with the input being Enum.KeyCode.X or smthn like that.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.