WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStWidget class reference

SetKeyboardMode

Sets the keyboard mode used on a WS_FIELD widget.

Depending on the mobile unit, the keyboard mode specifies whether the keyboard will transform the keystrokes on alphabetic keys or numbers.

Ole declaration

VARIANT_BOOL SetKeyboardModeByName(LPCTSTR sObjectName, SHORT usKeyboardMode);

VARIANT_BOOL SetKeyboardModeById(SHORT usObjectId, SHORT usKeyboardMode);

Parameters
sObjectName
The name of the target widget.
usObjectId
The id of the target widget.
usKeyboardMode
The new keyboard mode.
Return Value

On success, SetKeyboardMode returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.

The keyboard modes can be found on the WSFieldConstants enumeration.

Remarks

Only certain mobile units with reduced keyboards (between 35 and 21 keys) support this feature.

The keyboard state can be one (and only one) of the following constants:

Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
WStFactory oFactory = new WStFactory();
short iFieldId = 33;

oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_FIELD, iFieldId, "", 0,0, 50, 50, "123");
oWidget.SetKeyboardModeById(iFieldId, (short)WSFieldConstants.WS_FIELD_KM_NUMERIC);
Visual Basic 6 (Full Example: FieldDemoModule.bas.txt)
Public wsWidget As New WStWidget...
 wsWidget.ModifyInputModeByName "maxLengthField", 0, WS_FIELD_IM_NUMERIC_ONLY
wsWidget.ModifyLenCtrlModeByName "maxLengthField", 0, WS_FIELD_LC_FORCE_ENTRY
wsWidget.SetMaxLengthByName "maxLengthField", 2
wsWidget.ModifyInputDevicesByName "maxLengthField", 0, WS_FIELD_ID_DISABLE_SCAN
wsWidget.SetKeyboardModeByName "maxLengthField", WS_FIELD_KM_NUMERIC
...
See also

ModifyInputMode | ModifyDisplayMode | ModifyInputDevices | ModifyLenCtrlMode | SetScannerConfigFile | SetMaxLength | GetLastInputType | GetLastBarcodeType

WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference