Skip to main content
Version: 8.3 Beta 🚧

system.vision.showNumericKeypad

Backwards Compatibility

This function replaces system.gui.showNumericKeypad. Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility. Only the system.vision variations will appear in the Script Editor's autocomplete popup.

This function is used in Python Scripting.

Description​

Displays a modal on-screen numeric keypad, allowing for arbitrary numeric entry using the mouse, or a finger on a touch screen monitor. Returns the number that the user entered.

note

This function is available on secondary desktops via the system.vision.desktop function. See the Multi-Monitor Clients page for more details on secondary desktops.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.vision.showNumericKeypad(initialValue, [fontSize], [usePasswordMode])

Parameters​

TypeParameterDescription
NumberinitialValueThe value to start the on-screen keypad with.
IntegerfontSizeThe font size to display in the keypad. [optional]
BooleanusePasswordModeIf True, display a * for each digit. [optional]

Returns​

Number - The value that was entered in the keypad.

Scope​

Vision Client

Code Examples​

Example #1
# This function is a holdover for backwards compatibility. Input components now know when the Client is in Touch Screen mode and respond accordingly. 
# This script would go in the MouseClicked or MousePressed action of a Text field or Numeric Text field.

# For Integer Numeric Text field:
if system.vision.isTouchscreenMode():
event.source.intValue = system.vision.showNumericKeypad(event.source.intValue)

# For Double Numeric Text field:
if system.vision.isTouchscreenMode():
event.source.doubleValue = system.vision.showNumericKeypad(event.source.doubleValue)

# For Text field:
# Notice the str() and int() functions used to convert the text to a number and
# vice versa.
# str() and int() are built-in Jython functions
if system.vision.isTouchscreenMode():
event.source.text = str(system.vision.showNumericKeypad(int(event.source.text)))