Component:VirtualKey: Difference between revisions

From Resonite Wiki
add mega info I hope
add related
 
(2 intermediate revisions by one other user not shown)
Line 20: Line 20:
== Behavior ==
== Behavior ==
When paired with a UIX button or physical button on the same slot, it allows for simulation of key presses as if they came from the actual physical keyboard. This can be used for some funny effects where pressing a button forces the user that pressed it to jump (or, god forbid, make them switch to desktop or VR)
When paired with a UIX button or physical button on the same slot, it allows for simulation of key presses as if they came from the actual physical keyboard. This can be used for some funny effects where pressing a button forces the user that pressed it to jump (or, god forbid, make them switch to desktop or VR)
This cannot be used to send key presses outside of Resonite to control the external operating system unless the component is in [[Userspace]].


== Examples ==
== Examples ==
Line 25: Line 27:


== See Also ==
== See Also ==
* [[Component:VirtualKeyboard|Keyboard]]
* [[Component:VirtualKey|Virtual Key]]
* [[Component:VirtualModifierKey|Modifier Key]]
* [[Component:VirtualKeyboard|Virtual Keyboard]]
* [[Component:VirtualModifierKey|Virtual Modifier Key]]
* [[Component:VirtualMultiKey|Virtual Multi Key]]
* [[Component:VirtualShift|Virtual Shift]]
* [[Component:VirtualCloseKey|Virtual Close Key]]
* [[Component:VirtualKeyTextDrive|Virtual Key Text Drive]]
* [[Component:VirtualShiftColorDriver|Virtual Shift Color Driver]]


[[Category:Components:Userspace:Virtual Keyboard{{#translation:}}|Virtual Key]]
[[Category:Components:Userspace:Virtual Keyboard{{#translation:}}|Virtual Key]]
[[Category:Components{{#translation:}}|Virtual Key]]
[[Category:Components{{#translation:}}|Virtual Key]]

Latest revision as of 00:04, 17 October 2024

Component image 
Virtual Key component as seen in the Scene Inspector

Virtual key is a component that turns a button event into a button press on the keyboard in game as if it came from the physical keyboard.

Usage

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
TargetKey Key The key to simulate.
AppendString String What text to append if the user is focused into a text field
ShiftTargetKey Key What key to use if the Virtual Shift component is taking effect, or shift is held on the physical keyboard.
ShiftAppendString String What text to append if the user is focused into a text field and if the Virtual Shift component is taking effect, or shift is held on the physical keyboard.
IgnoreShift Bool Whether to ignore shift and virtual shift keys entirely.
ModifierKey direct RelayRef`1<VirtualModifierKey> A key that can act as a special modifier (for example, if you wanted a key on your VR keyboard that appended "Cat!!" every time you type a letter)
ModifiedTargetKey Key The key to use instead of TargetKey when ModifiedTargetKey is pressed down.
ModifiedAppendString String hat text to append if the user is focused into a text field and the key specified by ModifiedTargetKey is pressed down.
Keyboard direct RelayRef`1<VirtualKeyboard> The keyboard object this key is a part of.

Behavior

When paired with a UIX button or physical button on the same slot, it allows for simulation of key presses as if they came from the actual physical keyboard. This can be used for some funny effects where pressing a button forces the user that pressed it to jump (or, god forbid, make them switch to desktop or VR)

This cannot be used to send key presses outside of Resonite to control the external operating system unless the component is in Userspace.

Examples

Used in the default and custom community keyboards to allow said keyboards to type into the game and textfields.

See Also