Change Browser Behavior Using ClientSettings
ClientSettings is an additional interface available in the Thinfinity VirtualUI Library that allows developers to remotely and programmatically configure particular browser settings. These settings are related to the cursor visibility and some specific touch action behaviors.
There is also a Javascript Clientsettings object version. Learn how to use it.
The table below shows a detailed reference of the ClientSettings interface current properties:
As mentioned previously, these properties were created to provide a better end-user experience when using touch devices.
When using a touch device, it is unusual for a mouse pointer to be displayed. Instead, finger gestures are interpreted by the device as different commands, acting on the element or elements that are located where the gesture is made.
But this is not always the best way, especially when the applications were not designed for these gestures. Most of the times, the best solution to this issue is to show the pointer and simulate the mouse actions using the captured gestures.
The properties that we have presented above will help us define the ideal settings to enjoy the best possible and intuitive user experience for our application.
The following example shows how to recognize a touch or mobile device, and to change the pointer behavior when it's detected. Warning: The detection list is not complete:
vui = new VirtualUI();
userAgent = vui.BrowserInfo.UserAgent.ToLower();
if ((userAgent.IndexOf("touch") != -1) || (userAgent.IndexOf("mobile") != -1) ||
(userAgent.IndexOf("iphone") != -1) || (userAgent.IndexOf("ipod") != -1) ||
(userAgent.IndexOf("ipad") != -1) || (userAgent.IndexOf("android") != -1) ||
(userAgent.IndexOf(" cros ") != -1)) {
vui.ClientSettings.MouseMoveGestureStyle = MouseMoveGestureStyle.MM_STYLE_ABSOLUTE;
vui.ClientSettings.MouseMoveGestureAction = MouseMoveGestureAction.MM_ACTION_WHEEL;
}
Read more about using ClientSettings from Javascript.
Last updated