+ /* BlackBerry has a touchscreen, which we can consider a 1-button mouse at min.
+ Otherwise check for an actual mouse, else get max touch points. PlayBook does not support this. */
+#ifndef __PLAYBOOK__
+ if(!screen_get_context_property_iv(fgDisplay.pDisplay.screenContext, SCREEN_PROPERTY_DEVICE_COUNT, &deviceCount)) {
+ devices = (screen_device_t*)calloc(deviceCount, sizeof(screen_device_t));
+ if(!screen_get_context_property_pv(fgDisplay.pDisplay.screenContext, SCREEN_PROPERTY_DEVICES, (void**)devices)) {
+ /* Check for a pointer */
+ for(i = 0; i < deviceCount; i++) {
+ if(!screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_TYPE, &value) &&
+ value == SCREEN_EVENT_POINTER &&
+ !screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_BUTTON_COUNT, &value)) {
+ free(devices);
+ return value;
+ }
+ }
+ /* Check for mtouch */
+ for(i = 0; i < deviceCount; i++) {
+ if(!screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_TYPE, &value) &&
+ value == SCREEN_EVENT_MTOUCH_TOUCH &&
+ !screen_get_device_property_iv(devices[i], SCREEN_PROPERTY_MAXIMUM_TOUCH_ID, &value)) {
+ free(devices);
+ return value;
+ }
+ }
+ }
+ free(devices);
+ }
+#endif
+ /* Backup, pretend it's a 1-button mouse */