Keyboard calling method and device, computer device and storage medium
By using bridging technology and real-time monitoring, a custom soft keyboard can be invoked within a webpage embedded in the Android TV app client. This solves the problem of the webpage input box not recognizing focus and enables a low-cost keyboard invocation method.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA PING AN LIFE INSURANCE CO LTD
- Filing Date
- 2022-01-14
- Publication Date
- 2026-04-14
AI Technical Summary
When embedding a webpage's input box within an app client on Android TV, existing technology cannot recognize the focus, causing the custom keyboard to fail to appear and preventing character input.
The communication between the client and the embedded webpage is achieved through bridging technology. The state of the input control is monitored in real time, and a custom soft keyboard is brought up when the client receives a focus event, so that the key characters are passed to the webpage control.
This feature enables the invocation of a custom soft keyboard within a webpage input box on Android TV, resolving the issue of the keyboard not being accessible. Furthermore, it only requires development on the app client side, eliminating the need for additional webpage development and resulting in low development costs.
Smart Images

Figure CN114397968B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, computer device, and storage medium for keyboard invocation. Background Technology
[0002] Android mobile smart devices offer multiple input channels, typically categorized into two types: native client components and web components. The former relies on the native system for direct focus monitoring, thus allowing for relatively robust system compatibility. The latter, web components, however, rely on the system's WebView component for focus monitoring. Furthermore, the proliferation of web frameworks makes focus recognition less accurate than native system components.
[0003] Currently, most custom keyboards within mobile apps only adapt to the app's native input fields. For example, on Android TV, there's no compatibility handling for input fields embedded in web pages within the app. Whether it's the native system input method or a third-party input method like Sogou, the input fields on the webpage hosted within the app cannot be recognized by the webpage when they encounter a custom soft keyboard. Consequently, events like focus input cannot be processed, preventing the keyboard from being accessed when characters need to be entered via an input method on the webpage hosted within the app. There is currently no good solution to this technical problem. Summary of the Invention
[0004] This invention provides a method, apparatus, computer device, and storage medium for invoking a keyboard, to solve the technical problem that the embedded webpage cannot bring up the soft keyboard in an application or client with an embedded webpage.
[0005] A keyboard invocation method, including:
[0006] Communication between the client and a webpage embedded in the client is achieved through bridging technology; the webpage is configured with input controls.
[0007] Real-time monitoring of all input controls configured on the webpage;
[0008] When the state of the input control is detected to be that the input control has gained focus, the focus event and the corresponding control ID of the input control are sent back to the client.
[0009] The client receives the focus event and the corresponding input control ID, and then calls up the pre-configured custom soft keyboard.
[0010] The keystrokes received by the custom soft keyboard are transmitted to the input control corresponding to the control ID in the webpage via the bridging technology and then displayed.
[0011] A keyboard recall device, comprising:
[0012] A communication module is used to enable communication between a client and a webpage embedded in the client via bridging technology, wherein the webpage is configured with input controls;
[0013] The monitoring module is used to monitor all input controls configured in the webpage in real time.
[0014] The feedback module is used to listen for the state of the input control and when the input control has gained focus, send the focus event and the corresponding control ID of the input control back to the client.
[0015] The event receiving module is used by the client to receive the focus event and the control ID of the corresponding input control, and to call up the pre-configured custom soft keyboard;
[0016] The transmission module is used to transmit the key characters received by the custom soft keyboard to the input control corresponding to the control ID in the webpage through the bridging technology and display them.
[0017] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the keyboard invocation method described above.
[0018] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described keyboard invocation method.
[0019] The keyboard invocation method, apparatus, computer device, and storage medium proposed in this application first achieve communication between the client and the webpage embedded in the client through bridging technology, enabling communication between the client and the browser embedded in the client. Then, it monitors all input-enabled controls configured in the embedded webpage in real time. When the state of an input-enabled control is detected as focused, the focus event and the corresponding control ID of the input-enabled control are sent back to the client. When the client receives the focus event and the corresponding control ID, a pre-configured custom soft keyboard is invoked, allowing the user to input characters by clicking. The key characters received by the custom soft keyboard are transmitted to the input-enabled control corresponding to the control ID in the webpage through the bridging technology and displayed. This fundamentally solves the problem of the custom keyboard not being able to be invoked when compatible with webpage input, a problem particularly evident on Android TV devices. Furthermore, the solution proposed in this application only requires development on the App client, without the need for additional development on the webpage embedded in the App client. Therefore, the keyboard invocation method is more agile and universal, with lower development costs. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of an application environment for a keyboard invocation method according to an embodiment of the present invention;
[0022] Figure 2 This is a flowchart of a keyboard invocation method according to an embodiment of the present invention;
[0023] Figure 3 This is a schematic diagram of the keyboard calling device in one embodiment of the present invention;
[0024] Figure 4 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] The keyboard invocation method provided in this application can be applied to, for example... Figure 1 In this application environment, the computer device communicates with the server via a network. This computer device can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be a standalone server or a server cluster consisting of multiple servers.
[0027] In one embodiment, to address the technical problem that the soft keyboard cannot be invoked in an application or client with an embedded webpage, and to enable the soft keyboard within the APP client to be invoked when character input is required via an input method in a webpage hosted within the APP client, the method is applied to a mobile terminal, wherein the mobile terminal has a client installed, and the client has an embedded webpage, such as... Figure 2 As shown, this embodiment provides a method for invoking the keyboard, which is applied to... Figure 1 The following steps, S101 to S105, are used as an example of computer equipment.
[0028] S101. Communication between the client and a webpage embedded in the client is achieved through bridging technology, wherein the webpage is configured with input controls.
[0029] It is understood that the input controls include text boxes, password boxes, input boxes, and other places that require the keyboard to be invoked for the user to input characters.
[0030] In one embodiment, the bridging technology is, for example, JavaScript bridging technology, and the step of enabling communication between the client and a webpage embedded in the client via the bridging technology includes:
[0031] Configure the embedded webpage (browser) to allow JavaScript (hereinafter referred to as JS) technology;
[0032] Based on the user's input, a client class and its methods are generated in the embedded webpage for invocation.
[0033] The client invokes the webpage through the generated client class and its methods to achieve data transfer between the client and the webpage.
[0034] The user includes a programmer, the mobile terminal class is such as webview, the mobile terminal class has a method such as loadUrl, and the parameter of the loadUrl method is js.
[0035] According to one application scenario of this embodiment:
[0036] Configure the WebView to allow JavaScript technology when loading the webpage;
[0037] The mobile-side classes and methods are generated within the WebView that loads the webpage. Specifically, this is done by adding the `@JavascriptInterface` annotation to the methods in the defined classes, indicating that the methods can be called by the webpage.
[0038] Mobile devices use webview.loadUrl(js) to access web pages.
[0039] In this approach, custom JavaScript is loaded into the webpage using WebView.
[0040] The JavaScript content includes:
[0041] a. Set focus listeners and click event listeners for all input controls on the webpage;
[0042] b. Inform the client natively when an input control gains focus or is clicked, and transmit the current input value and the current control ID.
[0043] Understandably, control IDs are used to distinguish different controls.
[0044] S102. Monitor all input controls configured in the webpage in real time.
[0045] The real-time monitoring of the input control includes, but is not limited to, when the input control gains focus, when the input control loses focus, or when the input control is clicked.
[0046] S103. When the state of the input control is detected as the input control has gained focus, the focus event and the corresponding control ID of the input control are sent back to the client.
[0047] In one embodiment, the step of posting the focus event back to the client further includes:
[0048] The focus event is returned to the client via the JavascriptInterface entity interface class. JavascriptInterface is an interface provided by the JS engine and is an important component of the Android system's H5 framework. Returning the focus event to the client via JavascriptInterface ensures the stability of communication between the webpage and the client.
[0049] S104. The client receives the focus event and the corresponding input control ID, and calls up the pre-configured custom soft keyboard.
[0050] In one embodiment, after real-time monitoring of all input-enabled controls configured in the webpage, the method further includes:
[0051] When the client receives the focus event, it disables the pop-up of the client's native system soft keyboard.
[0052] This embodiment ensures that the system soft keyboard will not interfere with input events prematurely by blocking the pop-up of the client's native system soft keyboard when a focus event is received, thus enabling the custom soft keyboard to be used normally to handle the corresponding input events.
[0053] In one embodiment, when the state of the input control is detected as a focus loss event, the method further includes:
[0054] The focus loss event is sent back to the client.
[0055] When the client receives the focus loss event, it hides the custom soft keyboard.
[0056] S105. The key characters received by the custom soft keyboard are transmitted to the input control corresponding to the control ID in the webpage through the bridging technology and displayed.
[0057] In one embodiment, the step of transmitting the key characters received by the custom soft keyboard to the inputtable control corresponding to the control ID in the webpage via the bridging technology and displaying it includes:
[0058] When the state of the input control is detected to be that the input control has gained focus, the control ID of the corresponding input control, the position of the focus cursor, and the string content that the input control has already presented are obtained;
[0059] The control ID of the input control is sent back to the client.
[0060] The input keystrokes are received via the custom soft keyboard;
[0061] The received keystrokes are sent back to the input control corresponding to the control ID;
[0062] Based on the position of the focus cursor and the string content already displayed by the input control, the key characters are concatenated to the position of the focus cursor;
[0063] The input control obtains its input content based on the presented string content and the concatenated key characters.
[0064] Understandably, this process requires setting the value of the input control, which corresponds to "gaining focus," "entering content," and "cursor position." Furthermore, different values can be preset to represent different things; for example, 0 can be set to "gaining focus," 1 to "entering content," and 2 to "cursor position."
[0065] The keyboard invocation method proposed in this embodiment first establishes communication between the client and the webpage embedded in the client through bridging technology, enabling communication between the client and the browser embedded in the client. Then, it monitors all input-enabled controls configured in the embedded webpage in real time. When the state of an input-enabled control is detected as having focus, the focus event and the corresponding control ID of the input-enabled control are sent back to the client. When the client receives the focus event and the corresponding control ID, it invokes a pre-configured custom soft keyboard for the user to input characters by clicking. The key characters received by the custom soft keyboard are then transmitted to the input-enabled control corresponding to the control ID in the webpage through the bridging technology and displayed. This fundamentally solves the problem of the custom keyboard not being able to be invoked when compatible with webpage input, a problem particularly evident on Android TV devices. Furthermore, the solution proposed in this application only requires development on the App client, without the need for additional development on the webpage embedded in the App client. Therefore, this keyboard invocation method is more agile and universal, with lower development costs.
[0066] Optionally, to further improve the compatibility of the keyboard invocation, if the webpage embedded in the APP client includes a webpage with a Vue binding framework, the method further includes:
[0067] When the state of the input control is detected as the input control receiving focus, the pre-written input event is obtained through JavaScript;
[0068] The Event is passed as a parameter to the dispatchEvent function. By calling the dispatchEvent function through a control object with the specified control ID, the input control can display the input content.
[0069] Understandably, the input content displayed by this input control includes the string content that has already been entered and displayed, as well as the concatenated key characters that are in the input state.
[0070] This embodiment performs special processing on web pages, including those bound to Vue frameworks, within the APP client. This allows the input boxes of the original Vue-bound framework web pages to display the entered characters even if they do not have the function of displaying the characters entered. By pre-writing the input's Event event and calling the dispatchEvent function, the input can be dispatched, thereby enabling the input controls of the Vue-bound framework web pages to display the entered content and improving the compatibility of the keyboard's calling methods.
[0071] As TV applications become increasingly diverse, the web pages they support offer faster deployment compared to native applications, leading to a growing need for scenarios requiring compatibility with web keyboard input events. In this context, this application addresses this issue by focusing on the app client and leveraging JavaScript bridging technology to provide a stable and reliable solution. This application fundamentally solves the problem of custom keyboards failing to activate when compatible with web input, especially on Android TV systems. Furthermore, it requires only app-side development, eliminating the need for additional web-side development, making its implementation more agile and versatile.
[0072] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0073] In one embodiment, a keyboard recall device is provided, which corresponds one-to-one with the keyboard recall methods described in the above embodiments. The keyboard recall device can be located on a mobile terminal, which has a client installed, and the client embeds a webpage, such as... Figure 3 As shown, the keyboard recall device 100 includes a communication module 11, a listening module 12, a feedback module 13, an event receiving module 14, and a transmission module 15. Detailed descriptions of each functional module are as follows:
[0074] Communication module 11 is used to enable communication between a client and a webpage embedded in the client via bridging technology, wherein the webpage is configured with input controls;
[0075] The listening module 12 is used to monitor all input controls configured in the webpage in real time.
[0076] The feedback module 13 is used to listen for the state of the input control and when the input control is focused, send the focus event and the corresponding control ID of the input control back to the client.
[0077] Event receiving module 14 is used by the client to receive the focus event and the control ID of the corresponding input control, and to call up the pre-configured custom soft keyboard;
[0078] The transmission module 15 is used to transmit the key characters received by the custom soft keyboard to the input control corresponding to the control ID in the webpage through the bridging technology and display them.
[0079] In one embodiment, the communication module 11 includes:
[0080] A configuration unit for configuring JavaScript technology to be enabled in the embedded webpage;
[0081] The method generation unit is used to generate a client class for invocation and a method of the client class in the embedded webpage based on user input.
[0082] The invocation unit is used by the client to invoke the webpage through the generated client class and the methods of the client class, so as to realize data transfer between the client and the webpage.
[0083] The user includes a programmer, the mobile application class is such as WebView, the mobile application class has a method such as LoadUrl, and the parameter of the LoadUrl method is JavaScript. The JavaScript content includes:
[0084] a. Set focus listeners and click event listeners for all input controls on the webpage;
[0085] b. Inform the client natively when an input control gains focus or is clicked, and transmit the current input value and the current control ID.
[0086] Understandably, control IDs are used to distinguish different controls.
[0087] In one embodiment, the postback module 13 is specifically used to post back the focus event to the client via the JavascriptInterface entity interface class.
[0088] JavascriptInterface is an interface provided by the JS engine and is an important component of the Android system's loading of the H5 framework. By using JavascriptInterface to send focus events back to the client, the stability of communication between the webpage and the client can be guaranteed.
[0089] In one embodiment, the keyboard recall device 100 further includes:
[0090] A blocking module is used to block the pop-up of the client's native system soft keyboard when the client receives the event of gaining focus.
[0091] This embodiment uses a blocking module to block the pop-up of the client's native system soft keyboard when a focus event is received. This ensures that the system soft keyboard will not interfere with input events in advance, thus enabling the custom soft keyboard to be used normally to handle the corresponding input events.
[0092] In one embodiment, the feedback module 13 is further configured to send the focus loss event back to the client when the state of the input control is detected as a focus loss event;
[0093] The keyboard recall device 100 also includes:
[0094] A hidden module is used by the client to receive the focus loss event and hide the custom soft keyboard.
[0095] In one embodiment, the transmission module 15 specifically includes:
[0096] The acquisition unit is used to listen for the state of the input control and when the input control is focused, to acquire the control ID of the corresponding input control, the position of the focus cursor, and the string content already presented by the input control.
[0097] The first feedback unit is used to send the control ID of the input control back to the client;
[0098] A receiving unit is used to receive keystrokes input via the custom soft keyboard;
[0099] The second feedback unit is used to send the received key characters back to the input control corresponding to the control ID;
[0100] The splicing unit is used to splice the key characters to the position of the focus cursor based on the position of the focus cursor and the string content already presented by the input control;
[0101] The presentation unit is used to obtain the input content of the input control based on the presented string content and the concatenated key characters.
[0102] In one embodiment, to further improve the compatibility of the keyboard invocation, when the webpage embedded in the client includes a webpage with a Vue binding framework, the keyboard invocation device 100 further includes:
[0103] The event acquisition module is used to listen for the state of the input control when the input control has gained focus, and then obtain the pre-written input event through JavaScript.
[0104] The function call module is used to pass the Event as a parameter to the dispatchEvent function, and call the dispatchEvent function by specifying the control ID of the control object, so that the input control can display the input content.
[0105] Understandably, the input content displayed by this input control includes the string content that has already been entered and displayed, as well as the concatenated key characters that are in the input state.
[0106] This embodiment performs special processing on web pages, including those bound to Vue frameworks, within the APP client. This allows the input boxes of the original Vue-bound framework web pages to display the entered characters even if they do not have the function of displaying the characters entered. By pre-writing the input's Event event and calling the dispatchEvent function, the input can be dispatched, thereby enabling the input controls of the Vue-bound framework web pages to display the entered content and improving the compatibility of the keyboard's calling methods.
[0107] The terms "first" and "second" in the above-mentioned modules / units are only used to distinguish different modules / units and are not intended to specify which module / unit has a higher priority or any other limiting meaning. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products, or devices. The module divisions appearing in this application are merely logical divisions; in actual applications, different division methods may be used.
[0108] Specific limitations regarding the keyboard invocation device can be found in the limitations on the keyboard invocation method described above, and will not be repeated here. Each module in the aforementioned keyboard invocation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can invoke and execute the operations corresponding to each module.
[0109] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes storage media and internal memory. The storage media includes non-volatile and / or volatile storage media, storing the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements a keyboard invocation method.
[0110] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the keyboard invocation method described in the above embodiment, for example... Figure 2 The steps 101 to 105 shown, as well as other extensions and related steps of the method, are examples. Alternatively, when the processor executes a computer program, it implements the functions of each module / unit of the keyboard calling device in the above embodiments, for example... Figure 3 The functions of modules 11 to 15 are shown. To avoid repetition, they will not be described again here.
[0111] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the computer device, connecting various parts of the computer device via various interfaces and lines.
[0112] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, video data, etc.).
[0113] The memory can be integrated into the processor or it can be set up separately from the processor.
[0114] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements the steps of the keyboard invocation method described in the above embodiment, for example... Figure 2 The steps 101 to 105 shown, as well as other extensions and related steps of the method, are examples. Alternatively, when a computer program is executed by a processor, it implements the functions of each module / unit of the keyboard calling device in the above embodiments, for example... Figure 3 The functions of modules 11 to 15 are shown. To avoid repetition, they will not be described again here.
[0115] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile and / or volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0116] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0117] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for invoking a keyboard, the method being applied to a mobile terminal, the mobile terminal having a client installed, the client having a webpage embedded therein, characterized in that, The method includes: Communication between the client and a webpage embedded in the client is achieved through bridging technology; the webpage is configured with input controls. Real-time monitoring of all input controls configured on the webpage; When the state of the input control is detected as the input control has gained focus, the control ID of the corresponding input control, the position of the focus cursor, and the string content already displayed by the input control are obtained, and the focus event and the control ID of the corresponding input control are sent back to the client. The client receives the focus event and the corresponding input control ID, and then calls up the pre-configured custom soft keyboard. Based on the position of the focus cursor and the string content already displayed by the input control, the key characters are concatenated to the position of the focus cursor to obtain the input content of the input control; The keystrokes received by the custom soft keyboard are transmitted to the input control corresponding to the control ID in the webpage via the bridging technology and then displayed.
2. The keyboard invocation method according to claim 1, characterized in that, The steps for enabling communication between the client and the webpage embedded in the client via bridging technology include: Configure the embedded webpage to allow JavaScript technology; Based on the user's input, a client class and its methods are generated in the embedded webpage for invocation. The client invokes the webpage through the generated client class and its methods to achieve data transfer between the client and the webpage.
3. The keyboard invocation method according to claim 1, characterized in that, The event of gaining focus is sent back to the client, including: The event that gains focus is posted back to the client via the JavascriptInterface entity interface class.
4. The keyboard invocation method according to claim 1, characterized in that, After real-time monitoring of all input controls configured on the webpage, the method further includes: When the client receives the focus event, it disables the pop-up of the client's native system soft keyboard.
5. The keyboard invocation method according to claim 1, characterized in that, When the state of the input control is detected as a focus loss event, the method further includes: The focus loss event is sent back to the client. The client receives the focus loss event and hides the custom soft keyboard.
6. The keyboard invocation method according to claim 1, characterized in that, The step of transmitting the keystrokes received by the custom soft keyboard to the inputtable control corresponding to the control ID in the webpage via the bridging technology and displaying it includes: The control ID of the input control is sent back to the client. The input keystrokes are received via the custom soft keyboard; The received keystrokes are sent back to the input control corresponding to the control ID; Based on the position of the focus cursor and the string content already displayed by the input control, the key characters are concatenated to the position of the focus cursor; The input control obtains its input content based on the presented string content and the concatenated key characters.
7. The keyboard invocation method according to claim 1, characterized in that, When the webpage embedded in the client includes a webpage bound to a Vue framework, the method further includes: When the state of the input control is detected as the input control receiving focus, the pre-written input event is obtained through JavaScript; The Event is passed as a parameter to the dispatchEvent function, and the dispatchEvent function is called by the control object with the specified control ID.
8. A keyboard recall device, characterized in that, include: A communication module is used to enable communication between a client and a webpage embedded in the client via bridging technology, wherein the webpage is configured with input controls; The monitoring module is used to monitor all input controls configured in the webpage in real time. The feedback module is used to listen for the state of the input control and when the input control has gained focus, obtain the control ID of the corresponding input control, the position of the focus cursor and the string content that the input control has presented, and send the focus event and the control ID of the corresponding input control back to the client. The event receiving module is used by the client to receive the focus event and the control ID of the corresponding input control, and to call up the pre-configured custom soft keyboard; Based on the position of the focus cursor and the string content already displayed by the input control, the key characters are concatenated to the position of the focus cursor to obtain the input content of the input control; The transmission module is used to transmit the key characters received by the custom soft keyboard to the input control corresponding to the control ID in the webpage through the bridging technology and display them.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the keyboard invocation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the keyboard invocation method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Webpage input method and device for mobile terminal device
CN103902057A