This article applies to:
This sample illustrates how to control a SlideChoice with various keys.
The Button device can be set to use the Keyboard in the Button properties > Input Device To Filter. However, this is not customizable. This sample may be useful in studies requiring Keyboard or Human Interface Device (HID) input that require customization of keys to interact with the SlideChoice.
This sample demonstrates how to move a SlideChoice Indicator based on the keyboard keys 1-5. The StimulusSingle and StimulusMultiple have an Infinite duration and continue on the Mouse click of the Next button. The Keyboard Input Mask Max Count is set to 1000 so it is not reached.
The StimulusSingle has a Script Task Event that fires on StimulusSingle.Keyboard(1).Press which enables a single check. Due to Single Selection, we do not need to worry about unchecking. The StimulusMultiple has a Script Task Event that fires on StimulusMultiple.Keyboard(1).Press which handles multiple checks. The Script Task Events check if it is a key we are looking for (i.e., 1-5). If it is, we interact with the SlideChoice.
NOTE: The Mouse can also manipulate the Choice as the Input Device To Filter remains set to the Mouse.