-
Notifications
You must be signed in to change notification settings - Fork 0
Keyboard
A device which allows you to get player input using a keyboard-like interface.
void Keyboard:SimulateKeyPress(string? key, string Player)
void Keyboard:SimulateTextInput(string? input, string Player)
Event "KeyPressed" (KeyCode key, string keyString, UserInputState state, string Player)
Event "TextInputted" (string text, string Player)
Simulates a key press just like you would press a key on the keyboard.
Simulates textinput just like you would type in the keyboard and enter.
An event which fires when a player sitting on a Seat connected to the Keyboard presses a key.
keyString
is the key pressed as a string (for example,a
if the player pressed A.) If shift is held, the keyString will be capitalized. If the key is non-printable (i.e. shift or backspace)keyString
will be nil.state
is always Enum.UserInputType.End.
An event that fires when a player inputs text and presses "Enter" (or "Return") on the keyboard.
Change the telescope coords with a keyboard and print out the data. Doesn't require formatting. Can be upgraded to use a screen instead of printing to the console.
local keyboard = GetPartFromPort(1, "Keyboard") --> Same deal here, but with a keyboard.
local telescope = GetPartFromPort(1, "Telescope")
keyboard:Connect("TextInputted", function(text) --> Attach the function to the event "TextInputted".
telescope:Configure:({ ViewCoordinates = text .. ", false" })
print(JSONEncode(telescope:GetCoordinate()))
end)
Home | Globals | Additional resources | TODO
-
Part
- Part.ClassName
- Part.Position
- Part.CFrame
- Part.GUID
- Part:GetColor()
- Part:GetSize()
- Part:Trigger()
- Part:Configure()
- Part:Connect()
- Evt Triggered
- Evt Configured
- Gyro
- Keyboard
- Microphone
- LifeSensor
- Instrument
- EnergyShield
- Disk
- Bin
- Container
- Modem
- Screen
- TouchSensor
- Button
- Light
- Rail
- StarMap
- Telescope
- Speaker
- Reactor
- Microcontroller
- Dispenser
- Faucet
- Servo
- BlackBox
Additional objects used in Microcontrollers
Public code that enhances the experience of using a Microcontroller.