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:

Property

Use

CursorVisible

Used to set the mouse pointer to 'show' or 'hide'.

Type: Boolean

Default value: True

Available in all Library Versions.

MouseMoveGestureStyle

Defines whether the mouse movement is read as relative or absolute in touch devices.

Type: Enum

Values:

MM_STYLE_RELATIVE = 0

MM_STYLE_ABSOLUTE = 1

Default value: MM_STYLE_RELATIVE

Available in all Library Versions.

MouseMoveGestureAction

Indicates if the dragging should be interpreted as scrolling or turning of the mouse wheel, affecting only the component on which the action is triggered.

Type: Enum

Values:

MM_ACTION_MOVE = 0,

MM_ACTION_WHEEL = 1

Default value: MM_ACTION_MOVE

Available in all Library Versions.

UseViewportSize

Indicates which measure values will be used to define the application's screen size.

Type: Boolean

Values:

True: use the viewport size

False: use a window screen based size.

Default value: False

Available only in Javascript.

DockMenu

Manages the visibility of the bottom menu and its options.

Available only in Javascript

Enabled

Boolean. Enables/disables the complete Dock Menu.

Type: Boolean

Default value: True

Pinned

Indicates when the DockMenu is pinned (visible, fixed) or unpinned (with autohide)

Type: Boolean

Default value: False

Items

Name/value pairs item collection.

WindowList

Enables/disables the "Windows list" option.

Type: Boolean

Default value: True

ErrorReporting

Enables/disables the "Error Reporting" option.

Type: Boolean

Default value: True

Keyboard

Enables/disables the "Keyboard" option (mobile only).

Type: Boolean

Default value: True

FullScreen

Enables/disables the "Full Screen" option (mobile only, if supported).

Type: Boolean

Default value: True

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