Show TOC

Distinguish Control Behavior between Mobile and DesktopLocate this document in the navigation structure

To implement a different behavior for your control depending on the device it is running on, you can now also use the property combi for devices which support touch and mouse together.

Some controls have different behaviors between running on desktop and on mobile devices. For example, the sap.m.Carousel control shows the left and right navigation buttons in addition to gesture only when it runs on desktop. The distinction between desktop and mobile behaviors should be done by checking sap.ui.Device.system.desktop but NOT sap.ui.Device.support.touch because desktop browser can also support touch, for example Windows 8 touch-enabled device.

A property combi is provided in sap.ui.Device.support with which you can tell that the browser supports both touch and mouse interfaces.

Not all browser on Windows 8 touch-enabled device support touch events. Some browser fires mouse events when user operates with finger. Since those mouse events are not marked with _sapui_delayedMouseEvents, they can still be handled with SAPUI5 event delegation and the registered handler.

Here's the table showing the values under sap.ui.Device.system in different browsers of Windows 8 touch-enabled device:

Browser Touch Supported sap.ui.Device.system.desktop sap.ui.Device.system.tablet sap.ui.Device.system.combi sap.ui.Device.system.mobile
Internet Explorer NO YES NO NO NO
Chrome YES YES YES YES NO
Firefox NO YES NO NO NO
Safari NO YES NO NO NO