Windows Key | This node informs about keystrokes while the focus is on the renderer window. | |
DirectInput Key | This node informs about every keystroke done on the keyboard. | |
Textfield Input | Concatenates keyboard input received by the renderer window to a single string. | |
IME Textfield Input | Concatenates IME (Input Method Editor) keyboard compositions received by the renderer window to a single string. (far-east languages) | |
Chinese Conversion | Conversion of Chinese characters between traditional, simplified, taiwan, Hong-Kong and Japanese standards |
This node makes it possible to interact with a Ventuz scene via keyboard. It provides information whether a specific key is pressed or not. Additionally, it triggers events when a key is pressed or released.
This node only reacts on key hits that occur within the Renderer window. Key hits outside this window are ignored.
If AutoDeactivate is enabled, this node will be automatically deactivated if the parent Hierarchy Container is blocked. The property Active determines if this node is active and if it should react on the key hits. The property Key defines which key the node listens for. To specify the key, click on the triangle in the Key property argument field and then press the desired key. It is also possible to specify a key combination like CTRL + P.
If SendEventArg is enabled the key code is sent as argument via the KeyDown and KeyUp event which occur if the correct key is pressed. This is usually used when binding a key event to a Script Node so that the key code value is available in the event handler without having to bind an additional property.
If Key is set to None, the node will react on all keyboard inputs!
The Emit method simulates a key stroke and the node behaves as if the specific key on the keyboard has been hit. In this case the KeyUp occurs one frame after the KeyDown event. This Emit can be used to build a Ventuz scene which works identically with a real keyboard and a virtual keyboard on a touch display. By default, an emit will only create a Ventuz-internal key press/release message that will not be sent to Windows or any other application. When enabling EmitSimulatesHardware, the press/release are submitted to Windows instead and will thus create the same behavior as if the user would have pressed a key on his keyboard. This has multiple side-effects:
In addition to the events described above, this node provides information about the state (NotPressed, Pressed) of a specific key and its code (KeyCode).
This node provides nearly the same functionality as Windows Key. But there are two differences: this node notices every key stroke inside and outside the Renderer window and even outside the Ventuz application. It is not possible to send the key code as argument via the events and it is not provided as an output property.
Technically the Textfield Input node is related to the Windows Key node. Both only listen to key presses that are issued when the Renderer Window has keyboard focus. But where the Windows Key node is designed for listening to individual key strokes, the Textfield Input node listens for characters being generated instead of keys being pressed. When a diacritic key is pressed (for example the ^ key), Windows notifies applications of the key being pressed but does not issue a character. Only when a second key is pressed, the combined result (for example â) is sent. For non-accented characters, both the key press and character are sent at the same time.
The Textfield Input node listens for such character messages and concatenates all such characters into a single string that is provided via the Text output property. This is usually bound to a Text Layout/Text Rendering combination to visualize the input. Using Backspace to delete the last character is supported but there is no caret that can be used to specify at which position the next character is inserted.
If the SingleLine property is activated, the Textfield Input node will ignoring new line characters. The PressedEnter event will however fire regardless of the SingleLine property. In addition, MaxLength can be used to restrict the number of characters in the generated string. If set to a value different from -1, any new keypress will only be added to the output string if it does not exceed the limit set in MaxLength.
The Paste from Clipboard function directly pastes the contents of your clipboard into the Textfield input.
If the Textfield Input is supposed to be used in conjunction with the Windows Key Emit method, the EmitSimulatesHardware property has to be activated. Otherwise only Ventuz-internal key press/release events are generated which do not cause Windows to send the character messages the Textfield Input node requires.
The InjectChar method accepts an integer value which is translated to a unicode character. When the method is invoked, the browser reacts as if this key would have been inserted via the hardware keyboard. Note that this is not the same as pressing a hardware key. For example, to generate the letter â on a German keyboard takes two key presses, first the ^ key and then the a key. In order to support more languages, the inject method accepts a character and not a key press. There are however a number of special character codes supported:
Code | Description |
---|---|
13 | Return |
9 | Tab |
8 | Backspace |
127 | Delete |
27 | Escape |
The pass an integer value as part of the method invocation, either the output event of a Script node or an Event node has to be used. For the latter, the value can be specified in its Argument property.
The Property Editor accepts hexadecimal numbers if they are entered with a leading "0x" or "#"
The unicode values for the most commonly used characters can be found here and here. Additional information on other character sets can be found here.
The IME Textfield Input node is basically the same as the Textfield Input node except it uses the Input Method Editor (IME) for composing text in far-east languages. Every key stroke is interpreted by the IME and used to create a text composition. The currently edited composition is output at the CompositionPreview property. All Menu output properties describe a a list of candidates for the user to select by either navigating with the cursor keys or by pressing the keys 1 to 9. MenuCandidates and MenuComments provide a string array of all currently selected candidates. The method ControlSelectCandidate can also be used to select a candidate from list. The argument of the event (0-8) is mapped to the keys 1 to 9 and the index 9 is mapped to 0 Depending on the selected Schema a composition is committed by pressing SPACE or by calling the method CompositionCommit The current composition can also be cleared by calling the method CompositionClear, while method ControlReset resets the entire IME, its composition as well the the commited text in CompositionText
By default the node is configured to operate vertically. This means the list of candidates should be displayed vertically because UP/DOWN and PAGE UP/PAGE DOWN are used to navigate. The ConfigHorizontal changes this behavior to horizontal: LEFT/RIGHT and PAGE UP/PAGE DOWN are used to navigate the candidates.
The IME implementation used RIME under this license. RIME uses certain data source files describing the Schemas to be used for input. Some of them are deployed with your installation. The data files can be found in {InstallationDir}\Rime\data. You can manually add your custom data files to this directory. Ventuz and RIME will reparse this data, which is deployed to the default folder C:\ProgramData\Ventuz{version}\Cache\Rime on program start. The actual usage and candidate selection made are stored in databases and can also be found in the Rime folder. RIME is a learning system. It remembers your frequent selections for fast typing. You can delete the entire content of this folder. The clean data will be recreated on program start.
The property Conversion selects the conversion standard to be used to convert traditional Chinese characters to other standards. See also Chinese Conversion node. A selection of None keeps the character produced by the IME untouched.
Please note that the Scene and its logic is responsibe to visualize the composition preview, the candidate menu and the current selection. The IME Textfield Input node produces 10 candidates per page at maximum. The deployed Chinese schemas (pinyin)) produces 5 candidates at maximum.
This node is used to convert Chinese text between certain Chinese standards like Traditional, Simplified, Hong Kong standard, Taiwan standard and Japanese Kanji. The conversion is based on the open source project OpenCC 開放中文轉換. The text of the Input property is converted with the selected conversion type in Config to the Output property. The Active property enables the conversion. If a wrong config is selected or the node is not activated, the input is directly bypassed to the output. For example conversion from traditional 將軍 (jiang'jun: general) to simplified standard results in 将军.