Is it possible to create a script similar to AHK in Roblox?

I was wondering, if you could create a script similar to AutoHotKey.
So in Ahk you can do:

q::o

and when you press q, it changes it to o.
I want to make this in Roblox, where I click a button, and the game thinks it’s another one, just like AutoHotKey. I’ve tried the UserInputService events, but none of the funtions actually change the key pressed.

I do think that it is possible to create an AutoHotKey type system in roblox, but I’d say it’ll require a lot of lua knowledge

you can just modify the variable:

local keysId = {
     [Enum.KeyCode.E] = Enum.KeyCode.O;
     [Enum.KeyCode.F] = Enum.KeyCode.S;
}

game:GetService("UserInputService").InputBegan:Connect(function(input, typing)
     if typing then return end
     local key = input.KeyCode
     print(key) -- prints Enum.KeyCode.E
     local key = keysId[key] or key
     print(key) -- prints Enum.KeyCode.O
end)

But the game won’t recognize the change, would it? I want it so the game thinks I’m pressing another button.