---
title: "Common Section Keyboards"
canonical: "https://docs.cuesystem.com/space/CVCGC/462651478/Common%20Section%20Keyboards"
format: markdown
---
> Macro (toc)

---

# Properties

![image](media://aff88a30-4720-4210-a8b0-9256c61c31d6)

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Position |
| X | Long | 0 to screen resolution width |  | X position of left top corner of object |
| Y | Long | 0 to screen resolution height |  | Y position of left top corner of object |
| Width | Long | Depends on the object | Depends on the object | Width of the object |
| Height | Long | Depends on the object | Depends on the object | Height of the object |
| Behavior |
| Locked | Yes, No | No |  | By this property it is possible to lock position and size of object in IDE (while programming touch panel, not in runtime). |
| Join |  |  |  | Not used in this object |
| Keyboard |
| AutoHide | Boolean | Yes No | Yes | If Yes the object automatically hides after press of the button Enter.  
If No the button Close must be pressed to hide. |

# Functions

For new objects we recommend to use the function EditText(). For compatibility with older projects use the function ShowObject() based on BasicKeyboards.

## EditText

This function opens keyboard, adds texttoedit in it, and enables editing the text. This function ends by hiding the keyboard. By pressing ENTER, function returns edited text. By pressing CANCEL, function returns previous text and returns LastError - EDIT_WAS_CANCELED.

If passwordmask true, only * are visible instead of text.

If promttext is defined, but actual lenght of texttoedit is zero, keyboard displays the prompttext.

If newflags is defined, keyboard opening mode is selected. The Keyboard always displays on the bottom of the screen. You can use the following predefined constants for flagging

- _OW_MODAL
- _OW_TOPMOST

Function returns True on success or False if an error occurs.

#### Syntax

```visualbasic
Function EditText(
  ByRef texttoedit As Text,
  Optional passwordmask As Boolean := False, 
  Optional promttext As AddressOf Text := Nothing, 
  Optional newflags As Long := _OW_MODAL) 
As Boolean
```

## ShowObject

This function opens keyboard, adds newinittext in it, and enables editing the text. This function ends immediately. If passwordmask true, only * are visible instead of text. If promttext is defined, but actual lenght of texttoedit is zero, keyboard displays the prompttext.

Parameter newid is identification number of keyboard and this number is returned as parameter of every event.

If newflags is defined, keyboard opening mode is selected. The Keyboard always displays on the bottom of the screen. You can use the following predefined constants for flagging

- _OW_MODAL
- _OW_TOPMOST

Function returns True on success or False if an error occurs.

#### Syntax

```visualbasic
Function ShowObject(
  Optional newinittext As Text := ““, 
  Optional newid As Long := 0, 
  Optional newflags As Long := _OW_MODAL) 
As Boolean
```

## GetText

This function returns keyboard text. By pressing ENTER, function returns edited text. By pressing CANCEL, function returns previous text.

#### Syntax

```visualbasic
Function GetText(ByRef editedtext As Text)
```

## HideObject

This function closes keyboard window. It returns LastError - KEYBOARD_HAS_BEEN_HIDDEN

#### Syntax

```visualbasic
Function HideObject()
```

## IsObjectVisible

This function returns true, if the keyboard is open.

#### Syntax

```visualbasic
Function IsObjectVisible() As Boolean
```

## SetPasswordMask

This function sets property PasswordMask to newpasswordmask value. Function returns True.

#### Syntax

```visualbasic
Function SetPasswordMask(newpasswordmask As Boolean) As Boolean
```

## GetPasswordMask

This function returns the current value of property PasswordMask.

#### Syntax

```visualbasic
Function GetPasswordMask() As Boolean
```

## SetPrompt

This function sets Prompt to newprompt. Function returns True.

#### Syntax

```visualbasic
Function SetPrompt(newprompt As Text) As Boolean
```

## GetPrompt

This function returns the current value of property Prompt.

#### Syntax

```visualbasic
Function GetPrompt() As AddressOf Text
```

## EnableCustomButton

This function sets buttontext to Custom Button and show the Custom Button.

#### Syntax

```visualbasic
Function EnableCustomButton(buttontext As Text)
```

## DisableCustomButton

This function hide the Custom Button.

#### Syntax

```visualbasic
Function DisableCustomButton()
```

## SetAutoHide

This function sets AutoHide property to newautohide value. Function returns True.

#### Syntax

```visualbasic
Function SetAutoHide(newautohide As Boolean) As Boolean
```

## GetAutoHide

This function returns the current value of AutoHide property.

#### Syntax

```visualbasic
Function GetAutoHide() As Boolean
```

# Events

## OnEnter 

This event is raised whenever button Enter is pushed. It returns input text in the parameter keyboardtext and id which was set by function ShowObject.

#### Syntax

```visualbasic
Event OnEnter As Process(keyboardtext As Text, id As Long)
```

## OnCancel 

This event is raised whenever button CANCEL is pushed. It returns id which was set by function ShowObject. By pressing CANCEL, function returns LastError - EDIT_WAS_CANCELED.

#### Syntax

```visualbasic
Event OnCancel As Process (id As Long)
```

# LastError

## EDIT_WAS_CANCELED

CANCEL pressed on keyboard.

## KEYBOARD_HAS_BEEN_HIDDEN

This value is returned, when the keyboard was hidden.

## KEYBOARD_IS_ALREDY_OPEN

This value is returned, when another keyboard is already open.