This article applies to:
This sample shows how to input accented characters that require more than one key stroke to type.
The InLine object named 'ButtonCombinations' performs several steps that are needed to convert two successive keystrokes into non-English accented characters.
First, several variables are declared with the Dim statement. 'KeyboardResps' is declared as an integer and will count the number of keystrokes. 'KeyPress1' and 'KeyPress2' are declared as KeyboardResponseData variables and will store each of the two keystrokes that the participant enters.
If…Then conditional statements using the previously-defined variables are used to let the program know that it is looking for two keystrokes and to differentiate each response detected from the keyboard by assigining them to their own variable.
After each KeyPress variable is assigned its respective response, an Attribute called "Stimulus2" is initialized with the value "Invalid Combination". Slide2 presents "Invalid Combination" unless one of the specified key combinations in the Instructions is typed.
Then a nested If...Then structure is used to check for for the specified combination. KeyPress1.RESP is checked to see if it is ";". If so, then another If...Then statement checks to see if KeyPress2.RESP is either "u" or "n". Otherwise, if KeyPress1.RESP is " ' ", then another If...Then statement checks to see if KeyPress2.RESP is either "o" or "e".
The characters displayed in the sample are just a few basic examples of how to use this technique.