Key Expression Field for Key Press Responses and Pattern Field for Text Entry Responses behave differently from values entered into the icon title
Issue
Key names in the "Key Expression" field for Key Press responses and in the "Pattern" field for text entry responses behave differently from key names used in the Icon Title of a Key Press response or expressions used in the title of a Text Entry response.
For instance, you can enter CtrlV | Tab in the title of the key press interaction, and the response will trigger if the user presses and holds the control key while pressing the "V" key or it will trigger if the user presses the "Tab" key. If you enter the identical expression in the "Key Expression" field, Authorware will ask you to define the variable CtrlV. It will not, however, ask you to create a Tab variable, and if you remove CtrlV from the expression field, the Tab key will still trigger the response as expected.
Similarly, if you enter Navigate|Navigation in the title of a text entry response, the response will match if the user enters either "Navigate" or "Navigation" into the text entry field. However, if you enter the same text into the pattern field, you will be prompted to create the variable "Navigation."
Reason
In Macromedia Authorware 6.5, the "Key Expression" field was added to KeyPress responses to allow developers to change the key or keys that would trigger the keypress response at runtime. In essence, the Key Expression field now accepts strings containing the key names. This means that you can either use a literal string ("CtrlV"), or you can set up a variable containing the string (myString := "CtrlV") and then use the variable in the "Key Expression" field.
Tab works in both the Icon Title and the "Key Expression" field because Tab happens to be a variable that contains the tab character. Return works the same way.
At the same time, the Pattern field for Text Entry Responses was enhanced so it can now accept changing values at runtime, so that field will interpret anything you put into it as a variable expression. This is why you would be prompted to create a Navigation variable if you entered Navigate|Navigation into the Pattern field. Like Tab, Navigate is a System variable, so you would not be prompted to create it.
Solution
Use actual key names (without quotes) in the Icon Title of a key press response to set the response to react to key presses that will not change at runtime. Use one or more variables containing the names of the keys you want the response to react to in the "Key Expression" field if you need the flexibility to change the keys at runtime. If you need the keypress response Icon Title to be different from the keys, you can also use literal strings as the key names in the "Key Expression" field.
For Text Entry Responses, use the response title to set up alternate literal values that could be entered by the user. If you want the pattern to change at runtime, use a variable or other expression in the pattern field. If you want the title of the response to be different from the pattern to match, but you need to use literals as the pattern, enter the pattern in the pattern field and enclose it in quotes. For example, "Navigate|Navigation" or simply "Betty".
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
