Example #1
0
void Vibrate(int length_ms) {
	// Vibration: intensity strength(1-100), duration ms(0-5000)
	// Intensity: LOW = 1, MEDIUM = 10, HIGH = 100
	switch (length_ms) {
	case -1: // Keyboard Tap
		vibration_request(VIBRATION_INTENSITY_LOW, 50);
		break;
	case -2: // Virtual Key
		vibration_request(VIBRATION_INTENSITY_LOW, 25);
		break;
	case -3: // Long Press
		vibration_request(VIBRATION_INTENSITY_LOW, 50);
		break;
	default:
		vibration_request(VIBRATION_INTENSITY_LOW, length_ms);
		break;
	}
}
Example #2
0
void Vibrate(int length_ms) {
#ifdef BLACKBERRY10
	vibration_request(VIBRATION_INTENSITY_LOW, 500 /* intensity (1-100), duration (ms) */);
#endif
}