Component:VirtualKey: Difference between revisions

From Resonite Wiki
Automated: create new component page
 
add related
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
|Name=Virtual Key
|Name=Virtual Key
}}
}}
{{stub}}
Virtual key is a component that turns a [[Button Events|button event]] into a button press on the keyboard in game as if it came from the physical keyboard.


== Usage ==
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|TargetKey|Key|
|TargetKey|Key| The key to simulate.
|AppendString|String|
|AppendString|String| What text to append if the user is focused into a text field
|ShiftTargetKey|Key|
|ShiftTargetKey|Key| What key to use if the [[Component:VirtualShift|Virtual Shift component]] is taking effect, or shift is held on the physical keyboard.
|ShiftAppendString|String|
|ShiftAppendString|String| What text to append if the user is focused into a text field and if the [[Component:VirtualShift|Virtual Shift component]] is taking effect, or shift is held on the physical keyboard.
|IgnoreShift|Bool|
|IgnoreShift|Bool| Whether to ignore shift and virtual shift keys entirely.
|ModifierKey|{{RootFieldType|RelayRef`1|[[Component:VirtualModifierKey|VirtualModifierKey]]}}|TypeAdv5=true|
|ModifierKey|{{RootFieldType|RelayRef`1|[[Component:VirtualModifierKey|VirtualModifierKey]]}}|TypeAdv5=true| 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|
|ModifiedTargetKey|Key| The key to use instead of <code>TargetKey</code> when <code>ModifiedTargetKey</code> is pressed down.
|ModifiedAppendString|String|
|ModifiedAppendString|String| hat text to append if the user is focused into a text field and the key specified by <code>ModifiedTargetKey</code> is pressed down.
|Keyboard|{{RootFieldType|RelayRef`1|[[Component:VirtualKeyboard|VirtualKeyboard]]}}|TypeAdv8=true|
|Keyboard|{{RootFieldType|RelayRef`1|[[Component:VirtualKeyboard|VirtualKeyboard]]}}|TypeAdv8=true| The keyboard object this key is a part of.
}}
}}


== 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)
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 ==
Used in the default and custom community keyboards to allow said keyboards to type into the game and textfields.


== See Also ==
== See Also ==
* [[Component:VirtualKey|Virtual 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]]
[[Category:ComponentStubs]]

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