tencent cloud

Tencent Cloud Super App as a Service

Release Notes and Announcements
Announcement: Tencent Cloud Mini Program Platform Renamed to Tencent Cloud Super App as a Service on January 2, 2025
Console Updates
Android SDK Updates
iOS SDK Updates
Flutter SDK Updates
IDE Updates
Base Library Updates
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Pay-As-You-Go Billing
Renewal Guide
Service Suspension Instructions
Getting Started
Plan Management
Overview
Console Account Management
Storage Configuration
Acceleration Configuration
Branding Configurations
Platform Features
Console Login
Users and Permission System
Mini Program Management
Mini Game Management
Superapp Management
Commercialization
Platform Management
User Management
Team Management
Operations Management
Security Center
Code Integration Guide
Getting Demo and SDK
Android
iOS
Flutter
Superapp Server
GUID Generation Rules
Mini Program Development Guide
Mini Program Introduction and Development Environment
Mini Program Code Composition
Guide
Framework
Components
API
Server Backend
JS SDK
Base Library
IDE Operation Instructions
Mini Game Development Guide
Guide
API
Server Backend
Practice Tutorial
Mini Program Login Practical Tutorial
Mini Program Subscription Message Practical Tutorial
Payment Practical Tutorial
Ad Integration Practical Tutorial
Mini Game Subscription Message Practical Tutorial
API Documentation
History
Introduction
API Category
Making API Requests
Operation Management APIs
User Management APIs
Team Management APIs
Sensitive API-Related APIs
Role Management APIs
Platform Management APIs
Other Console APIs
Mini Program or Mini Game APIs
Management-Sensitive APIs
Global Domain Management APIs
Superapp APIs
Data Types
Agreements
Service Level Agreement
Data Processing and Security Agreement
SDK Privacy Policy Module
SDK Data Processing and Security Agreement Module

Keyboard

PDF
Focus Mode
Font Size
Last updated: 2025-07-04 16:53:19

updateKeyboard

This API is called using wx.updateKeyboard(Object object).
Feature description:Updates the content in the keyboard input box. This API only takes effect when the keyboard is already displayed.
Parameter and description: Object object.
Property
Type
Default value
‍Required
Description
value
string
-
True
The current value in the keyboard input box.
success
function
-
False
Callback function for successful API calls.
fail
function
-
False
Callback function for failed API calls.
complete
function
-
False
Callback function executed after API call ends (regardless of success or failure).

showKeyboard

This API is called using wx.showKeyboard(Object object).
Feature description:Displays the keyboard.
Parameter and description: Object object.
Property
Type
Default value
‍Required
Description
defaultValue
string
-
True
Default value displayed in the keyboard input box.
maxLength
number
-
True
Maximum length of text in the keyboard.
multiple
boolean
-
True
Whether the input is multiline.
confirmHold
boolean
-
True
Whether the keyboard remains displayed when the user clicks Done.
confirmType
string
-
True
The type of the Done button in the lower right corner of the keyboard. It only affects the text content of the button.
type
string
text
False
The type of the keyboard.
success
function
-
False
Callback function for successful API calls.
fail
function
-
False
Callback function for failed API calls.
complete
function
-
False
Callback function executed after API call ends (regardless of success or failure).
Valid values for confirmType:
Value
Description
done
Complete
next
Next
search
Search
go
Go
send
Send
type for confirmType:
Value
Description
text
Text input keyboard
number
Number input keyboard
digit
Numeric keyboard with decimal point

onKeyboardInput

This API is called using wx.onKeyboardInput(function listener).
Feature description:Listens for keyboard input event.
Parameter and description: function listener. The function that handles keyboard input event. Parameters are as follows:
Property
Type
Description
value
string
The current value of the keyboard input.

onKeyboardHeightChange

This API is called using wx.onKeyboardHeightChange(function listener).
Feature description:Listens for keyboard height change event.
Parameter and description: function listener. The function that handles keyboard height change event. Parameters are as follows:
listener parameter: Object res.
Property
Type
Description
height
number
Keyboard height.
Example:
wx.onKeyboardHeightChange(res => {
console.log(res.height)
})

onKeyboardConfirm

This API is called using wx.onKeyboardConfirm(function listener).
Feature description:Listens for the event where the user taps the Done button on the keyboard.
Parameter and description: function listener. The function that handles the Done button click event. Parameters are as follows:
Property
Type
Description
value
string
The current value of the keyboard input.

onKeyboardComplete

This API is called using wx.onKeyboardComplete(function listener).
Feature description:Listens for the event when the keyboard is hidden.
Parameter and description: function listener. The function that handles the keyboard hide event. Parameters are as follows:
Property
Type
Description
value
string
The current value of the keyboard input.

offKeyboardInput

The API is called using wx.offKeyboardInput(function listener).
Feature description:Removes the listener for keyboard input event.
Parameter and description: function listener. The function that was passed to onKeyboardInput. If not provided, all listeners will be removed.
Example:
const listener = function (res) { console.log(res) }

wx.onKeyboardInput(listener)
wx.offKeyboardInput(listener) // Must pass the same function object used in onKeyboardInput

offKeyboardHeightChange

This API is called using wx.offKeyboardHeightChange(function listener).
Feature description:Removes the listener for keyboard height change event.
Parameter and description: function listener. The function that was passed to onKeyboardHeightChange. If not provided, all listeners will be removed.
Example:
const listener = function (res) { console.log(res) }

wx.onKeyboardHeightChange(listener)
wx.offKeyboardHeightChange(listener) // Must pass the same function object used in onKeyboardHeight

offKeyboardConfirm

This API is called using wx.offKeyboardConfirm(function listener).
Feature description:Removes the listener for the event when the user taps the Done button on the keyboard.
Parameter and description: function listener. The function that was passed to onKeyboardConfirm. If not provided, all listeners will be removed.
Example:
const listener = function (res) { console.log(res) }

wx.onKeyboardConfirm(listener)
wx.offKeyboardConfirm(listener) // Must pass the same function object used in onKeyboardConfirm

offKeyboardComplete

This API is called using wx.offKeyboardComplete(function listener).
Feature description:Removes the listener for the event when the keyboard is hidden.
Parameter and description: function listener. The function that was passed to onKeyboardComplete. If not provided, all listeners will be removed.
Example:
const listener = function (res) { console.log(res) }

wx.onKeyboardComplete(listener)
wx.offKeyboardComplete(listener) // Must pass the same function object used in onKeyboardComplete

hideKeyboard

This API is called using wx.hideKeyboard(Object object).
Feature description:Hides the keyboard.
Parameter and description:Object object.
Property
Type
Default value
‍Required
Description
success
function
-
False
Callback function for successful API calls.
fail
function
-
False
Callback function for failed API calls.
complete
function
-
False
Callback function executed after API call ends (regardless of success or failure).
Example:
wx.hideKeyboard({
complete: res => {
console.log('hideKeyboard res', res)
}
})



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback