Tactile feedback provides users with immediate confirmation that the touch event has been registered. It is especially useful in noisy environments. You can use vibration as tactile feedback on user actions. Tactile feedback is implemented for those common S60 UI components where it has been seen as beneficial. If you create custom components for widgets, consider providing tactile feedback for buttons, sliders, strokes, gestures, and notifications.
For general principles on providing tactile feedback, see Tactile feedback.
You use JavaScript SystemInfo Service API methods to provide tactile feedback. For more information, see Vibration information and control services.
Check that vibration is enabled on a mobile device.
if (sysinfo.vibrasettings==1) startVibration();
Specify settings for the intensity and duration of vibration. The following example specifies maximum intensity for maximum duration when users touch a UI component.
function startVibration() { // get the system defined maximum duration var duration = sysinfo.vibramaxduration; // get the system defined minimum intensity var intensity = sysinfo.vibraminintensity // start vibration sysinfo.startvibra(duration, intensity); }
For more information about setting the duration and intensity of vibration, see the startvibra() method of the JavaScript SystemInfo Service API.