Global handwriting input method of handwriting pen, electronic equipment and chip system
By performing validity checks on the input hotspot of the text input control when it receives a stylus event and then activating the global handwriting input method, the problem of cumbersome stylus interaction is solved, and convenient and efficient text input is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2026-04-07
AI Technical Summary
When users interact with electronic devices using a stylus, they need to manually switch input methods, which makes the text input process cumbersome and reduces the convenience and efficiency of interaction.
When a handwriting input event is received in the input hotspot of the text input control, a validity check is performed. If the validity is passed, the global handwriting input method is activated through a pre-created input method management service, allowing the handwriting input to be used directly by the stylus.
It simplifies the handwriting input interaction process, improves the convenience and efficiency of the stylus, and enhances the user experience.
Smart Images

Figure CN121807211A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of electronic devices, and particularly relates to a global handwriting input method of a handwriting pen, an electronic device, a chip system, a computer readable storage medium and a computer program product. BACKGROUND
[0002] With the large popularity and rapid development of electronic devices such as mobile phones and tablet computers, the functions of these electronic devices are becoming more and more perfect and powerful. The handwriting pen gradually becomes an important accessory when people use electronic devices such as mobile phones and tablet computers. People often use handwriting pens to interact with electronic devices when working and learning.
[0003] In the related art, when a user interacts with an electronic device through a handwriting pen, in a scenario where text input is needed, the user needs to use the handwriting pen to operate the soft keyboard pulled up by the input method to type, or needs to manually switch the input method and then perform handwriting input through the handwriting pen. The user cannot directly use the handwriting pen to perform handwriting input, which leads to an overly complicated interaction process for text input using the handwriting pen, low interaction convenience and interaction efficiency, and affects the user experience. SUMMARY
[0004] The embodiments of the present application provide a global handwriting input method of a handwriting pen, an electronic device, a chip system, a computer readable storage medium and a computer program product, which can simplify the interaction process for text input using the handwriting pen and effectively improve the interaction convenience and interaction efficiency of the handwriting pen.
[0005] In a first aspect, the embodiments of the present application provide a global handwriting input method of a handwriting pen, applied to an electronic device associated with the handwriting pen, comprising: in response to a first handwriting pen event being received by an input hot area corresponding to a text input control, performing legality verification on global handwriting pen input of the text input control; in a case where the legality verification passes, determining an event type of a current input event through a first input method manager service (IMMS) created in advance, wherein the event type includes a handwriting pen event and a finger event; in a case where the event type of the current input event is determined to be the handwriting pen event, pulling up a global handwriting input method corresponding to the handwriting pen through the handwriting pen IMMS created in advance.
[0006] Thus, when a handwriting pen event is received in the input hot area corresponding to the text input control, the legality of the global handwriting pen input to the text input control is checked to determine whether the text input control allows handwriting pen input, and in the case that the legality check passes, i.e., the text input control allows handwriting pen input, the global handwriting input method corresponding to the handwriting pen is pulled up through the first IMMS and the handwriting pen IMMS pre-created, so as to directly perform handwriting input to the text input control through the handwriting pen. In this way, by using the handwriting pen to drop the pen in the input hot area near the text input control, the global handwriting input method corresponding to the handwriting pen is directly triggered to be pulled up, so that the user can directly perform handwriting input through the handwriting pen without manually switching the input method, which simplifies the interaction process of handwriting input through the handwriting pen, saves operation time, improves the interaction convenience and efficiency of the handwriting pen, and further improves the user experience.
[0007] In a possible implementation manner of the first aspect, the legality of the global handwriting pen input to the text input control is checked, including:
[0008] checking whether the text input control disables handwriting pen input;
[0009] in the case that the text input control disables handwriting pen input, determining that the legality check fails;
[0010] in the case that the text input control allows handwriting pen input, checking whether the global handwriting switch is turned on;
[0011] in the case that the global handwriting switch is turned on, determining that the legality check passes;
[0012] in the case that the global handwriting switch is turned off, determining that the legality check fails.
[0013] Thus, since the input properties of the text input controls in different text input scenarios can be different, some text input controls can allow the handwriting pen input, some text input controls can not allow the handwriting pen input, and a global handwriting switch can be further provided to control whether the global handwriting input method can be directly pulled up by the handwriting pen, so that the user can freely select the input method used according to the user's own use habit, therefore, when the handwriting pen event is received in the input hot area of the text input control, the legality verification of whether the text input control can perform the global handwriting input can be performed through two aspects of whether the text input control disables the handwriting pen input and whether the global handwriting switch is turned on, and in the case that the text input control allows the handwriting pen input and the global handwriting switch is turned on, it is determined that the legality verification is passed, that is, the global handwriting input method can be currently pulled up, so that the user directly performs handwriting input through the handwriting pen, thereby not only simplifying the interaction process of handwriting input through the handwriting pen, saving the operation time, improving the interaction convenience and interaction efficiency of the handwriting pen, but also matching the timing of pulling up the global handwriting with the current running scenario of the electronic device and the use demand of the user, further improving the interaction reliability and flexibility of the handwriting pen, and further improving the use experience of the user.
[0014] Optionally, in a third possible implementation manner of the first aspect, after it is determined that the legality verification fails in the case that the global handwriting switch is turned off, the method further includes:
[0015] verifying whether a default input method of the electronic device supports the handwriting pen input;
[0016] in the case that the default input method supports the handwriting pen input, pulling up the default input method through a second IMMS of the electronic device.
[0017] Thus, by verifying whether the default input method set by the user in the electronic device supports the handwriting pen input in the case that the global handwriting switch is turned off, and pulling up the default input method in the case that the default input method supports the handwriting pen input, so that the handwriting pen can directly perform handwriting input through the handwriting pen input function of the default input method, thereby not only simplifying the interaction process of handwriting input through the handwriting pen, saving the operation time, improving the interaction convenience and interaction efficiency of the handwriting pen, but also widening the application range of the global handwriting input of the handwriting pen, further improving the practicality and applicability of the global handwriting input of the handwriting pen.
[0018] Optionally, in a fourth possible implementation manner of the first aspect, the pulling up of the global handwriting input method corresponding to the handwriting pen through the handwriting pen IMMS created in advance includes:
[0019] pulling up and displaying a canvas and a toolbar corresponding to the global handwriting input method through the handwriting pen IMMS created in advance.
[0020] Therefore, since the input method in the electronic device system needs to be uniformly managed through the IMMS, the system native IMMS of the electronic device records the current system default input method, and in the case that the input method is not switched through setting, all input method interaction logics are directed to the system default input method. Therefore, in order to achieve the function of enabling the handwriting pen to write at any time even if the global handwriting input is not set as the system default input method, a separate IMMS can be created in advance to manage the global handwriting. Therefore, after the legal verification is passed, the global handwriting input method corresponding to the handwriting pen can be pulled up and the input process can be managed through the handwriting pen IMMS created in advance, and the custom window and canvas are used, so that the global handwriting function of the handwriting pen can be achieved without depending on the setting of the current system input method by the user, and the interaction convenience and interaction efficiency of the handwriting pen are improved. Moreover, through the custom window and canvas, the effect of stroke drawing is customized, and the display effect and input fluency of the handwriting input of the handwriting pen are further improved.
[0021] Optionally, in a further possible implementation manner of the first aspect, the input mode of the global handwriting input method includes a non-full-screen input mode and a full-screen input mode; in the non-full-screen input mode, the pen drop triggering area of the canvas is a corresponding area of the input hot area in the canvas; and in the full-screen input mode, the pen drop triggering area of the canvas is the entire area of the canvas.
[0022] Therefore, the non-full-screen input and the full-screen input are provided in the global handwriting input method corresponding to the handwriting pen. In the non-full-screen input mode, the user can drop the pen in the input hot area near the text input control to trigger writing, and in the full-screen input mode, the user can drop the pen at any position of the canvas to trigger writing. Before the user actively exits the full-screen writing mode or the global handwriting input method, the canvas is continuously displayed in full screen, so that the user can select a suitable input mode for handwriting input according to the actual use demand, thereby not only simplifying the interaction process of handwriting input through the handwriting pen, saving the operation time, and improving the interaction convenience and interaction efficiency of the handwriting pen, but also further improving the flexibility and practicality of the handwriting input of the handwriting pen, and further improving the user experience.
[0023] Optionally, in a further possible implementation manner of the first aspect, after the canvas and the tool bar corresponding to the global handwriting input method are pulled up and displayed through the handwriting pen IMMS created in advance, the method further includes:
[0024] in response to a second handwriting pen event in which the pen drop position is in the pen drop triggering area of the canvas, starting a handwriting process and intercepting the second handwriting pen event;
[0025] drawing a stroke in the canvas according to the second handwriting pen event, to display the writing content corresponding to the second handwriting pen event in the canvas;
[0026] in response to an end instruction of the second handwriting pen event, performing character recognition on the writing content corresponding to the second handwriting pen event to determine a character recognition result corresponding to the second handwriting pen event;
[0027] displaying the character recognition result corresponding to the second handwriting pen event in the text input control;
[0028] ending the handwriting process and resetting the state of the canvas.
[0029] Optionally, in a further possible implementation manner of the first aspect, the tool bar includes a full-screen input mode switching control; and correspondingly, after the canvas and the tool bar corresponding to the global handwriting input method are pulled up and displayed by the pre-created handwriting pen IMMS, the method further includes:
[0030] in response to a triggering operation of the handwriting pen on the full-screen input mode switching control, switching to a full-screen input mode and displaying the canvas in full screen;
[0031] receiving a third handwriting pen event with a pen drop position at any position of the canvas;
[0032] performing stroke drawing according to the third handwriting pen event in the canvas to display writing content corresponding to the third handwriting pen event in the canvas;
[0033] in response to an end instruction of the third handwriting pen event, performing character recognition on the writing content corresponding to the third handwriting pen event to determine a character recognition result corresponding to the third handwriting pen event;
[0034] displaying the character recognition result corresponding to the third handwriting pen event in the text input control.
[0035] Optionally, in a further possible implementation manner of the first aspect, after the event type of the current input event is determined by the pre-created first IMMS in the case where the legality verification passes, the method further includes:
[0036] in a case where the event type of the current input event is determined to be a finger event, pulling up a default input method of the electronic device by a second IMMS of the electronic device.
[0037] Thus, in order to achieve the function of handwriting with the stylus at any time even if the stylus is not set as the system default input method, a single IMMS can be created in advance to manage global handwriting, so that after the legal verification is passed, the first IMMS created in advance can be used to further verify whether the current input event is a stylus event, and when the current input event is a stylus event, the global handwriting input method created in advance by the stylus IMMS can be pulled up, and when the current input event is a finger event, it is determined that the user currently does not have the demand for handwriting input by the stylus, so that the default input method can be pulled up by the second IMMS of the electronic device, so that the type of the input event is re-verified by the IMMS created in advance, and the corresponding input method is pulled up according to the verification result, so as to prevent misjudgment of the actual input demand of the user, thereby further improving the stability and reliability of the global handwriting input of the stylus.
[0038] Optionally, in a further possible implementation manner of the first aspect, after the global handwriting input method corresponding to the stylus is pulled up by the stylus IMMS created in advance in the case where the event type of the current input event is determined to be a stylus event, the method further includes:
[0039] In response to an end instruction of the global handwriting input method, the global handwriting input method is exited.
[0040] Thus, by exiting the global handwriting input method when the end instruction of the global handwriting input method is acquired, the user can conveniently exit the global handwriting input method when the user no longer needs to perform handwriting input by the stylus, so as to avoid affecting the subsequent interaction of the user, thereby further improving the interaction convenience and interaction efficiency of the handwriting input by the stylus.
[0041] Optionally, in a further possible implementation manner of the first aspect, the end instruction of the global handwriting input method includes receiving a finger event.
[0042] Thus, by exiting the global handwriting input method when the finger event is received, the user can directly perform any operation on the electronic device by the finger to quickly exit the global handwriting input method when the user no longer needs to perform handwriting input by the stylus, thereby further simplifying the interaction process of the handwriting input by the stylus, saving operation time, and further improving the interaction convenience and interaction efficiency of the stylus.
[0043] In a second aspect, the embodiments of the present application provide a global handwriting input device of a handwriting pen, applied to an electronic device associated with the handwriting pen, and comprising: a first verification module, configured to perform legality verification on global handwriting pen input of a text input control in response to the text input control corresponding input hot area receiving a first handwriting pen event; a first determination module, configured to determine an event type of a current input event by a first IMMS created in advance in a case where the legality verification passes, wherein the event type comprises a handwriting pen event and a finger event; and a first pulling-up module, configured to pull up a global handwriting input method corresponding to the handwriting pen by a handwriting pen IMMS created in advance in a case where the event type of the current input event is determined as the handwriting pen event.
[0044] In this way, legality verification is performed on global handwriting pen input of a text input control when the text input control corresponding input hot area receives a handwriting pen event, so as to determine whether the text input control allows handwriting pen input, and in a case where the legality verification passes, i.e., the text input control allows handwriting pen input, a global handwriting input method corresponding to the handwriting pen is pulled up by a first IMMS and a handwriting pen IMMS created in advance, so as to directly perform handwriting input on the text input control by the handwriting pen. Thus, the global handwriting input method corresponding to the handwriting pen is directly triggered by using the handwriting pen to drop a pen on an input hot area near the text input control, so that a user can directly perform handwriting input by the handwriting pen without manually switching an input method, which simplifies an interaction process of handwriting input by the handwriting pen, saves operation time, improves interaction convenience and interaction efficiency of the handwriting pen, and further improves user experience.
[0045] In a second aspect, a possible implementation manner of the second aspect is that the first verification module comprises:
[0046] a first verification unit, configured to verify whether the text input control disables handwriting pen input;
[0047] a first determination unit, configured to determine that the legality verification fails in a case where the text input control disables handwriting pen input;
[0048] a second verification unit, configured to verify whether a global handwriting switch is turned on in a case where the text input control allows handwriting pen input;
[0049] a second determination unit, configured to determine that the legality verification passes in a case where the global handwriting switch is turned on;
[0050] a third determination unit, configured to determine that the legality verification fails in a case where the global handwriting switch is turned off.
[0051] Thus, since the input properties of the text input controls in different text input scenarios can be different, some text input controls can allow the handwriting pen input, some text input controls can not allow the handwriting pen input, and a global handwriting switch can be further provided to control whether the global handwriting input method can be directly pulled up by the handwriting pen, so that the user can freely select the input method used according to the user's own use habit, therefore, when the handwriting pen event is received in the input hot area of the text input control, the legality verification can be performed on whether the text input control can perform the global handwriting input through two aspects of whether the text input control disables the handwriting pen input and whether the global handwriting switch is turned on, and in the case that the text input control allows the handwriting pen input and the global handwriting switch is turned on, it is determined that the legality verification is passed, that is, the global handwriting input method can be currently pulled up, so that the user directly performs handwriting input through the handwriting pen, thereby not only simplifying the interaction process of handwriting input through the handwriting pen, saving the operation time, improving the interaction convenience and efficiency of the handwriting pen, but also matching the timing of pulling up the global handwriting with the current running scenario of the electronic device and the use demand of the user, further improving the interaction reliability and flexibility of the handwriting pen, and further improving the use experience of the user.
[0052] Optionally, in a third possible implementation manner of the second aspect, the first verification module further includes:
[0053] a third verification unit, configured to verify whether a default input method of the electronic device supports handwriting pen input;
[0054] a first pulling unit, configured to pull up the default input method through the second IMMS of the electronic device in the case that the default input method supports handwriting pen input.
[0055] Thus, by verifying whether the default input method set by the user in the electronic device supports handwriting pen input in the case that the global handwriting switch is turned off, and pulling up the default input method in the case that the default input method supports handwriting pen input, so that the handwriting pen can directly perform handwriting input through the handwriting pen input function of the default input method, thereby not only simplifying the interaction process of handwriting input through the handwriting pen, saving the operation time, improving the interaction convenience and efficiency of the handwriting pen, but also widening the application range of the global handwriting input of the handwriting pen, further improving the practicality and applicability of the global handwriting input of the handwriting pen.
[0056] Optionally, in a fourth possible implementation manner of the second aspect, the first pulling module includes:
[0057] a second pulling unit, configured to pull up and display the canvas and the tool bar corresponding to the global handwriting input method through the handwriting pen IMMS created in advance.
[0058] Therefore, in order to achieve the function of handwriting with the stylus at any time even if the global handwriting input is not set as the system default input method, a separate IMMS can be created in advance to manage the global handwriting input, so that after the legal verification is passed, the global handwriting input corresponding to the stylus can be pulled up and the input process can be managed by the pre-created stylus IMMS, and the custom window and canvas are used, so that the global handwriting function of the stylus can be realized without depending on the setting of the current system input method by the user, and the interaction convenience and efficiency of the stylus are improved. Moreover, through the custom window and canvas, the effect of stroke drawing is customized, and the display effect and input fluency of the handwriting input of the stylus are further improved.
[0059] Optionally, in a possible implementation manner of the second aspect, the input mode of the global handwriting input method includes a non-full-screen input mode and a full-screen input mode; in the non-full-screen input mode, the pen drop trigger area of the canvas is a corresponding area of the input hot area in the canvas; and in the full-screen input mode, the pen drop trigger area of the canvas is the entire area of the canvas.
[0060] Therefore, the non-full-screen input and the full-screen input are provided in the global handwriting input method corresponding to the stylus, the user can trigger writing by dropping the stylus in the input hot area near the text input control in the non-full-screen input mode, and the user can trigger writing by dropping the stylus at any position of the canvas in the full-screen input mode. Before the user actively exits the full-screen writing mode or the global handwriting input method, the canvas is continuously displayed in full screen, so that the user can select a suitable input mode for handwriting input according to the actual use demand, thereby not only simplifying the interaction process of handwriting input by the stylus, saving the operation time, and improving the interaction convenience and efficiency of the stylus, but also further improving the flexibility and practicality of the handwriting input of the stylus, and further improving the user experience.
[0061] Optionally, in a possible implementation manner of the second aspect, the first pulling-up module further includes:
[0062] The first opening unit is configured to start a handwriting process and intercept the second stylus event in response to the second stylus event in which the pen drop position is in the pen drop trigger area of the canvas.
[0063] The first drawing unit is configured to draw strokes in the canvas according to the second stylus event, so as to display the writing content corresponding to the second stylus event in the canvas.
[0064] The first character recognition unit is configured to perform character recognition on the writing content corresponding to the second handwriting pen event in response to an end instruction of the second handwriting pen event, to determine a character recognition result corresponding to the second handwriting pen event.
[0065] The first display unit is configured to display the character recognition result corresponding to the second handwriting pen event in the text input control.
[0066] The first reset unit is configured to end the handwriting process and reset the state of the canvas.
[0067] Optionally, in another possible implementation manner of the second aspect, the tool bar includes a full-screen input mode switching control; and correspondingly, the first pulling-up module further includes:
[0068] The first switching unit is configured to switch to a full-screen input mode and display the canvas in full screen in response to a triggering operation of the handwriting pen on the full-screen input mode switching control.
[0069] The first receiving unit is configured to receive a third handwriting pen event with a pen-down position at any position of the canvas.
[0070] The second drawing unit is configured to perform stroke drawing in the canvas according to the third handwriting pen event, to display writing content corresponding to the third handwriting pen event in the canvas.
[0071] The second character recognition unit is configured to perform character recognition on the writing content corresponding to the third handwriting pen event in response to an end instruction of the third handwriting pen event, to determine a character recognition result corresponding to the third handwriting pen event.
[0072] The second display unit is configured to display the character recognition result corresponding to the third handwriting pen event in the text input control.
[0073] Optionally, in another possible implementation manner of the second aspect, the apparatus further includes:
[0074] The second pulling-up module is configured to pull up a default input method of the electronic device through a second IMMS of the electronic device in a case where it is determined that the event type of the current input event is a finger event.
[0075] Thus, in order to achieve the function of handwriting with the stylus at any time even if the stylus is not set as the system default input method, a single IMMS is created in advance to manage global handwriting, so that after the legal verification is passed, the first IMMS created in advance is used to further verify whether the current input event is a stylus event, and the global handwriting input method is pulled up by the handwriting stylus IMMS created in advance when the current input event is a stylus event, and it is determined that the user currently has no demand for handwriting input by the stylus when the current input event is a finger event, so that the default input method is pulled up by the second IMMS of the electronic device, so that the type of the input event is verified again by the IMMS created in advance, and the corresponding input method is pulled up according to the verification result, so as to prevent misjudgment of the actual input demand of the user, thereby further improving the stability and reliability of global handwriting input of the stylus.
[0076] Optionally, in a further possible implementation manner of the second aspect, the apparatus further includes:
[0077] The first exit module is configured to exit the global handwriting input method in response to an end instruction of the global handwriting input method.
[0078] Thus, by exiting the global handwriting input method when the end instruction of the global handwriting input method is acquired, the user can conveniently exit the global handwriting input method when the user no longer needs to perform handwriting input by the stylus, thereby avoiding affecting subsequent interaction of the user, and further improving the interaction convenience and interaction efficiency of handwriting input by the stylus.
[0079] Optionally, in a further possible implementation manner of the second aspect, the end instruction of the global handwriting input method includes receiving a finger event.
[0080] Thus, by exiting the global handwriting input method when the finger event is received, the user can directly perform any operation on the electronic device by the finger to quickly exit the global handwriting input method when the user no longer needs to perform handwriting input by the stylus, thereby further simplifying the interaction process of handwriting input by the stylus, saving operation time, and further improving the interaction convenience and interaction efficiency of the stylus.
[0081] In a third aspect, an embodiment of the present application provides an electronic device, including one or more processors and a memory; the memory is coupled with the one or more processors, and the memory is configured to store computer program code including computer instructions, and the one or more processors are configured to invoke the computer instructions to enable the electronic device to perform the global handwriting input method of the stylus as described above.
[0082] In a fourth aspect, an embodiment of the present application provides a chip system applied to an electronic device, the chip system comprising one or more processors configured to invoke computer instructions to cause the electronic device to perform the global handwriting input method of the stylus as described above.
[0083] In a fifth aspect, an embodiment of the present application provides a computer readable storage medium comprising instructions which, when executed on an electronic device, cause the electronic device to perform the global handwriting input method of the stylus as described above.
[0084] In a sixth aspect, an embodiment of the present application provides a computer program product comprising a computer program which, when executed on an electronic device, causes the electronic device to perform the global handwriting input method of the stylus as described above.
[0085] The technical effects obtained by the second aspect, the third aspect, the fourth aspect, the fifth aspect and the sixth aspect described above are similar to the technical effects obtained by the corresponding technical means in the first aspect described above, and thus will not be described here again. BRIEF DESCRIPTION OF DRAWINGS
[0086] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative effort on the basis of these drawings.
[0087] Figure 1 is a flowchart of the global handwriting input method of the stylus provided by an embodiment of the present application;
[0088] Figure 2 is a schematic diagram of a search interface of an electronic device provided by an embodiment of the present application;
[0089] Figure 3 is a schematic diagram of an input hot area corresponding to a text input control provided by an embodiment of the present application;
[0090] Figure 4 is a schematic diagram of an input hot area receiving a stylus event provided by an embodiment of the present application;
[0091] Figure 5 is a process schematic diagram of performing legality verification on global stylus input of a text input control provided by an embodiment of the present application;
[0092] Figure 6is a flowchart of a process for determining an event type of a current input event of a pull-up input method according to an embodiment of the present application;
[0093] Figure 7 is a flowchart of a process for a global handwriting input method to perform handwriting input according to an embodiment of the present application;
[0094] Figure 8 is an interface diagram of a pull-up global input method according to an embodiment of the present application;
[0095] Figure 9 is an interface diagram of a non-full-screen input mode according to an embodiment of the present application;
[0096] Figure 10 is an interface diagram of a full-screen input mode according to an embodiment of the present application;
[0097] Figure 11 is an interface diagram of a process for displaying a handwriting recognition result in a text input control according to an embodiment of the present application;
[0098] Figure 12 is an interface diagram of another process for displaying a handwriting recognition result in a text input control according to an embodiment of the present application;
[0099] Figure 13 is a whole framework diagram of a global handwriting input method of a handwriting pen according to an embodiment of the present application;
[0100] Figure 14 is a whole timing diagram of a global handwriting input method of a handwriting pen according to an embodiment of the present application;
[0101] Figure 15 is a software architecture diagram of a global handwriting input method of a handwriting pen according to an embodiment of the present application;
[0102] Figure 16 is a structure diagram of a global handwriting input device of a handwriting pen according to an embodiment of the present application;
[0103] Figure 17 is a structure diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0104] The global handwriting input method, device, electronic device, chip system, storage medium and computer program of the handwriting pen according to the present application are described in detail below with reference to the accompanying drawings.
[0105] Reference is made to Figure 1 , Figure 1is a flowchart of a global handwriting input method of a handwriting pen provided by an embodiment of the present application. The method is applied to an electronic device associated with the handwriting pen. The method can include all or part of the following contents:
[0106] In step 101, in response to the input hot area corresponding to the text input control receiving a first handwriting pen event, legality verification is performed on the global handwriting pen input of the text input control.
[0107] It should be noted that the global handwriting input method of the handwriting pen provided by the embodiment of the present application can be executed by the global handwriting input device of the handwriting pen provided by the embodiment of the present application. The global handwriting input device of the handwriting pen provided by the embodiment of the present application can be configured in any electronic device that can interact with the handwriting pen to execute the global handwriting input method of the handwriting pen provided by the embodiment of the present application. For example, the global handwriting input device of the handwriting pen provided by the embodiment of the present application can be configured in a tablet computer that can interact with the handwriting pen to implement the global handwriting input of the handwriting pen.
[0108] The text input control can be any control that can perform text input in the electronic device. For example, a search box in a search application, a text input box in a chat application, a text input box in an office application, and the like. The embodiment of the present application does not limit this.
[0109] The input hot area corresponding to the text input control can be a range of area that can trigger text input in the text input control. That is, the user can trigger the electronic device to pull up the input method by using a finger or a handwriting pen to drop the pen in the input hot area corresponding to the text input control, so that the user can input text content in the text input control through the pulled-up input method.
[0110] For example, as shown in Figure 2 , it is a schematic diagram of a search interface of an electronic device provided by the embodiment of the present application. The search box 201 is a text input control. The input hot area corresponding to the text input control can be the area inside the search box 201. Alternatively, the input hot area corresponding to the text input control can be larger than the display area corresponding to the text input control. For example, the input hot area corresponding to the search box 201 can also be the area as shown in Figure 3 .
[0111] It should be noted that the above examples are only exemplary and should not be considered as a limitation of the present application. In actual use, the range of the input hot area corresponding to the text input control is related to the properties of the text input control itself and the functions of the electronic device. The embodiment of the present application does not limit this.
[0112] The first handwriting pen event can be a triggering event of a handwriting pen falling in an input hot area corresponding to the text input control before the input method is pulled up. For example, the first handwriting pen event can be a click operation, a double-click operation, or a long press operation of the handwriting pen at any position in the input hot area corresponding to the text input control, but is not limited thereto.
[0113] It should be noted that the types of the first handwriting pen event listed above are exemplary and should not be considered as a limitation of the present application. In actual use, the first handwriting pen event can include any operation of the handwriting pen in the input hot area corresponding to the text input control, and the embodiments of the present application do not limit this.
[0114] In the embodiments of the present application, when any type of interactive operation is received in the input hot area corresponding to the text input control, it is determined whether the interactive operation is initiated by a finger or a handwriting pen. If it is determined that the interactive operation is initiated by a finger, it is determined that the input hot area corresponding to the text input control currently does not receive the first handwriting pen event. If it is determined that the interactive operation is initiated by a handwriting pen, it is determined that the input hot area corresponding to the text input control currently receives the first handwriting pen event. When the input hot area corresponding to the text input control receives the first handwriting pen event, it is determined that the current user has a demand for text input in the text input control by the handwriting pen, and thus the legality of global handwriting pen input of the text input control is verified to determine whether the text input control allows the user to perform global handwriting input by the handwriting pen.
[0115] For example, as shown in FIG. 2, when the user clicks any position in the input hot area range by the handwriting pen, it is determined that the input hot area corresponding to the search box 201 receives the first handwriting pen event. Figure 4
[0116] As a possible implementation, the input hot area of the handwriting pen can be set through a view of the text input control. When the input hot area receives the first handwriting pen event, a handwriting input initialization tool (HandwritingInitiator) can be used to verify the legality of whether the global handwriting input by the handwriting pen can be started.
[0117] It should be noted that the text input control view can determine whether the event of falling in the input hot area is a finger event or a handwriting pen event by using an existing scheme, and the embodiments of the present application do not limit this.
[0118] Further, as the input properties of the text input control in different text input scenarios can be different, some text input controls can allow handwriting pen input, some text input controls can not allow handwriting pen input, and a global handwriting switch can also be provided to control whether the global handwriting input method can be directly pulled up by the handwriting pen, so that the user can freely select the input method used according to his own use habit, therefore, when the handwriting pen event is received in the input hot area of the text input control, the legality verification of whether the text input control can perform global handwriting input can be performed from two aspects of whether the text input control disables handwriting pen input and whether the global handwriting switch is turned on, and in the case that the text input control allows handwriting pen input and the global handwriting switch is turned on, it is determined that the legality verification passes, that is, the global handwriting input method can be pulled up at present, so that the user directly performs handwriting input through the handwriting pen, thereby not only simplifying the interaction process of handwriting input through the handwriting pen, saving the operation time, improving the interaction convenience and efficiency of the handwriting pen, but also matching the timing of pulling up the global handwriting with the current running scenario of the electronic device and the use demand of the user, further improving the interaction reliability and flexibility of the handwriting pen, and further improving the use experience of the user. That is, in a possible implementation manner of the embodiment of the present application, the step 101 can include:
[0119] verifying whether the text input control disables handwriting pen input;
[0120] in the case that the text input control disables handwriting pen input, determining that the legality verification fails;
[0121] in the case that the text input control allows handwriting pen input, verifying whether the global handwriting switch is turned on;
[0122] in the case that the global handwriting switch is turned on, determining that the legality verification passes;
[0123] in the case that the global handwriting switch is turned off, determining that the legality verification fails.
[0124] The global handwriting switch can be used to indicate whether the global handwriting input method corresponding to the handwriting pen is allowed to be used by the electronic device. When the global handwriting switch is turned on, the global handwriting input method can be pulled up by the handwriting pen falling on the input hot area; when the global handwriting switch is turned off, the global handwriting input method cannot be pulled up.
[0125] One possible implementation is to provide a global handwriting switch in the electronic device's settings menu, allowing users to freely choose to turn the global handwriting switch on or off according to their actual input method usage needs. As an example, the global handwriting switch could be automatically turned on when the stylus is successfully connected to the electronic device, displaying a message: "The global handwriting switch is now on by default and will override your input method's stylus input function. Please turn off the global handwriting switch if not needed." Users can manually turn off the global handwriting switch when not in use. Furthermore, the global handwriting switch can remain on as long as the user does not actively turn it off while the stylus is connected to the electronic device.
[0126] As one possible implementation, since some text input controls may disable stylus input, handwriting input cannot be performed on these controls using a stylus. Therefore, when the stylus touches the input area of the text input control, it can be verified whether stylus input is disabled. For example... Figure 5 As shown, after the view determines that the input hotspot corresponding to the text input control has received the first stylus event, it can notify the handwriting input initialization tool to receive the first stylus event. This allows the handwriting input initialization tool to obtain the attribute information of the text input control to determine whether the text input control has disabled stylus input. When it is determined that the text input control has disabled stylus input, it can be determined that the global stylus input validity check of the text input control has failed, meaning that handwriting input cannot be performed using a stylus at present, and the check result can be returned to the view. At this time, the default input method of the electronic device can also be activated, allowing the user to type using the default input method; alternatively, a prompt message such as "Handwriting input is not currently supported" can be output; or, while activating the default input method, a prompt message such as "Handwriting input is not currently supported" can be output, etc.
[0127] Once it is determined that the text input control allows stylus input, the global handwriting switch can be further verified using the handwriting input initialization tool. Specifically, a notification can be sent to the input method manager (IMM) in the input method management framework to obtain the global handwriting switch's on / off status from the IMM. If the global handwriting switch is confirmed to be on, the validity verification of the global stylus input of the text input control is confirmed to be successful; if the global handwriting switch is confirmed to be off, the validity verification of the global stylus input of the text input control is confirmed to be unsuccessful.
[0128] As one possible implementation, when the global handwriting switch is determined to be off, the default input method of the electronic device can be activated, allowing the user to input text by typing using the default input method.
[0129] As a possible implementation, in order to realize the global handwriting input of the stylus as much as possible, when the global handwriting switch is closed, the handwriting input of the stylus can also be realized through the default input method when the default input method supports the stylus function, so that when the global handwriting switch is closed, it can be checked whether the default input method set by the user in the electronic device supports the stylus input, and in the case that the default input method supports the stylus input, the default input method is pulled up, so that the stylus can directly perform handwriting input through the stylus input function of the default input method, thereby not only simplifying the interaction process of handwriting input through the stylus, saving operation time, improving the interaction convenience and interaction efficiency of the stylus, but also widening the application range of the global handwriting input of the stylus, and further improving the practicability and applicability of the global handwriting input of the stylus. That is, in a possible implementation of the embodiment of the present application, after the legality check fails in the case that the global handwriting switch is closed, the above-mentioned can further include:
[0130] checking whether the default input method of the electronic device supports the stylus input;
[0131] In the case that the default input method supports the stylus input, the default input method is pulled up through the second IMMS of the electronic device.
[0132] The default input method can be an input method set by the user or a system default input method used when the electronic device is factory shipped.
[0133] The second IMMS can be a system native IMMS of the electronic device.
[0134] As a possible implementation, in the case that the text input control does not disable the stylus input and the global handwriting switch is not turned on, the default input method can be used to attempt to realize the handwriting input of the stylus. Therefore, in this case, it can be judged whether the default input method of the electronic device supports the stylus function; if the default input method supports the stylus function, the default input method can be managed through the system native second IMMS, and the stylus function of the default input method is pulled up to realize the handwriting input of the stylus through the default input method, thereby widening the application range of the global handwriting input of the stylus, and further improving the practicability and applicability of the global handwriting input of the stylus.
[0135] Step 102, in the case that the legality check passes, the event type of the current input event is determined through the first IMMS created in advance, wherein the event type includes a stylus event and a finger event.
[0136] The first IMMS pre-created can refer to a separate input method management framework created to enable handwriting input at any time, even if the global handwriting input method is not set as the system default input method.
[0137] The current input event can refer to the first pen event.
[0138] In this embodiment, since the input methods within the electronic device system need to be uniformly managed through IMMS, the system's native IMMS (i.e., the second IMMS in this embodiment) records the current system default input method. Without switching input methods through settings, all input method interaction logic will point to the system default input method. Therefore, to achieve the ability to enable handwriting input at any time even if global handwriting input is not set as the system default input method, a separate IMMS can be pre-created to manage global handwriting and perform logic branching at appropriate times. After the legality verification passes, the handwriting input initialization tool can notify the pre-created IMMS to activate the input method. The pre-created IMMS then determines the event type of the current input event that activates the input method, identifying whether it is a finger event or a stylus event. This allows for further verification of the input event type through the pre-created IMMS, and the corresponding input method is activated based on the verification result to prevent misjudgment of the user's actual input needs, thereby further improving the stability and reliability of global handwriting input.
[0139] Step 103: If the event type of the current input event is determined to be a stylus event, the global handwriting input method corresponding to the stylus is activated through the pre-created stylus IMMS.
[0140] Among them, the pre-created stylus IMMS can be a pre-created IMMS used to manage the global handwriting input method separately.
[0141] As one possible implementation, if the event type of the current input event is a finger event, the default input method of the electronic device can be activated through the second IMMS of the electronic device; if the event type of the current input event is a stylus event, a pre-created stylus IMMS can be launched, and the global handwriting input method can be managed separately in the stylus IMMS.
[0142] As an example, such as Figure 6As shown, after the legality verification passes, the handwriting input initialization tool can notify the pre-created first IMMS to pull up the input method through the startStylusHandwriting method, and judge the event type of the current input event of the pulled-up input method through the startInputOrWindowGainedFocus method in the pre-created first IMMS; if the event type of the current input event is a finger event, the second IMMS logic (i.e., the system native IMMS) can be entered, and the default input method is pulled up; if the event type of the current input event is a stylus event, the pre-created stylus IMMS can be started, and the global handwriting input method is pulled up.
[0143] Further, since the input method in the electronic device system needs to be uniformly managed through the IMMS, the system native IMMS of the electronic device records the current system default input method, and all input method interaction logics are directed to the system default input method without input method switching through setting, so as to achieve the function of handwriting with the stylus at any time even if the global handwriting input is not set as the system default input method. A separate IMMS can be pre-created to manage the global handwriting, so that after the legality verification passes, the pre-created stylus IMMS can be used to pull up the global handwriting input method corresponding to the stylus and manage the input process, and a custom window and canvas are used, so that the global handwriting function of the stylus can be achieved without relying on the setting of the current system input method by the user, the interaction convenience and efficiency of the stylus are improved, and through the custom window and canvas, the effect of stroke drawing is customized, and the smoothness and flexibility of the stylus handwriting input are further improved. That is, in a possible implementation manner of the embodiment of the application, the step 103 can include:
[0144] The canvas and the toolbar corresponding to the global handwriting input method are pulled up and displayed through the pre-created stylus IMMS.
[0145] As one possible implementation, when the conditions for launching the global handwriting input method are met, the pre-created stylus IMMS can notify the input method invoking program (InputMethodInvoker) corresponding to the global handwriting input method to begin initializing the handwriting window via the `canStartStylusHandwriting()` method. The input method invoking program can initialize the handwriting window corresponding to the global handwriting input method via the `maybeCreateAndInitInkWindow()` method, and then execute the `onPrepareStylusHandwriting()` method; for example... Figure 7 As shown, when the input method calling program executes the `onPrepareStylusHandwriting()` method, the global handwriting input method application initializes the canvas; then, the input method calling program executes the `onStartStylusHandwriting()` method, which is in progress. During the execution of `onStartStylusHandwriting()`, the global handwriting input method application raises its canvas and toolbar; subsequently, the input method calling program hides the system's native handwriting window (InkWindow), thus achieving the raising and display of the global handwriting input method's canvas and toolbar. Figure 8 The image shows a schematic of the interface after the global input method is activated. When the global handwriting input method is activated, its toolbar is explicitly displayed on the interface. The toolbar contains multiple operation controls (such as a full-screen input mode switch control and an Enter key control). The canvas area is the entire display area of the interface, and is implicitly displayed. Figure 8 As shown, you can use a stylus to write within the canvas area. Figure 8 The "Hello!" in the image is text created by handwriting on the canvas using a stylus.
[0146] Therefore, by pre-creating a first IMMS and a stylus IMMS to manage the global handwriting input method and customizing the handwriting window and canvas, the effects of stroke drawing can be customized, such as the thickness, color, responsiveness, and stroke animation of the strokes. This not only enables the global handwriting function of the stylus without relying on the user's current system input method settings, improving the convenience and efficiency of the stylus's interaction, but also further enhances the display effect and input smoothness of the stylus's handwriting input by customizing the window and canvas to achieve the effect of stroke drawing.
[0147] Furthermore, the global handwriting input method corresponding to the stylus can provide two input modes: non-full-screen input and full-screen input. In non-full-screen input mode, users can trigger writing by placing a pen on the input hotspot near the text input control. In full-screen input mode, users can trigger writing by placing a pen at any position on the canvas. The canvas remains fully displayed until the user actively exits the full-screen writing mode or the global handwriting input method, allowing users to choose the appropriate input mode for handwriting input according to their actual needs. This not only simplifies the interaction process of handwriting input through the stylus, saves operation time, and improves the convenience and efficiency of the stylus's interaction, but also further enhances the flexibility and practicality of handwriting input, thus improving the user experience. In one possible implementation of this application embodiment, the input modes of the aforementioned global handwriting input method may include non-full-screen input mode and full-screen input mode; in non-full-screen input mode, the pen-triggering area on the canvas can be the corresponding area of the input hotspot on the canvas; in full-screen input mode, the pen-triggering area on the canvas can be the entire area of the canvas.
[0148] Among them, the non-full-screen input mode refers to the input mode in which you can only start writing in a certain area of the canvas.
[0149] Full-screen input mode refers to an input mode where you can start writing in the entire area of the canvas.
[0150] The pen-triggering area of the canvas can refer to the area where the stylus can be triggered to start writing after it touches the canvas.
[0151] by Figure 9 For example, suppose the input hotspot corresponding to the text input control is as follows: Figure 9 As shown, in non-full-screen input mode, the pen-touching trigger area on the canvas is the area within the input hot zone. That is, the stylus will only begin writing and displaying the writing content on the canvas if it begins to touch the canvas within the input hot zone. If the stylus begins to touch the canvas outside the input hot zone, the writing operation will not be responded to, and the writing strokes will not be displayed on the canvas. It should be noted that in non-full-screen input mode, as long as the stylus touches the canvas within the input hot zone, it can write throughout the entire canvas area and display the writing on the canvas until it is lifted. Figure 9 As shown, since the starting position of stroke 1 is within the input hot zone, it can still be written effectively even if stroke 1 exceeds the range of the input hot zone.
[0152] In full-screen input mode, the entire canvas area is solely for pen input triggering; that is, writing can be triggered by placing the stylus anywhere on the canvas, without needing to start writing within the corresponding input hotspot of the text input control. Figure 10For example, in the full-screen input mode, the canvas can be displayed in full screen as shown in Figure 10 and the user can write on the canvas at any position. For example, "Hello!" as shown in Figure 10 , even if the pen-down positions of each stroke are not in the input hot area of the text input control, the writing can be performed normally.
[0153] As a possible implementation, in the non-full-screen input mode of the global handwriting input method, the writing input process of the handwriting pen can be implemented in the following manner:
[0154] In response to the second handwriting pen event in which the pen-down position is in the pen-down triggering area of the canvas, a handwriting process is started and the second handwriting pen event is intercepted;
[0155] The second handwriting pen event is used to draw strokes in the canvas to display the writing content corresponding to the second handwriting pen event in the canvas;
[0156] In response to the end instruction of the second handwriting pen event, the writing content corresponding to the second handwriting pen event is subjected to character recognition to determine the character recognition result corresponding to the second handwriting pen event;
[0157] The character recognition result corresponding to the second handwriting pen event is displayed in the text input control;
[0158] The handwriting process is ended and the state of the canvas is reset.
[0159] The second handwriting pen event can be a writing event triggered by the handwriting pen in the canvas area in the non-full-screen input mode after the global handwriting input method is invoked.
[0160] The end instruction of the second handwriting pen event can include triggering the enter control in the tool bar, the writing pause time being greater than a preset time, etc., but is not limited thereto.
[0161] For example, the preset time can be 500 ms, so that when the writing pause time of the handwriting pen is greater than 500 ms, it is determined that the end instruction of the second handwriting pen event is obtained, and the writing content corresponding to the second handwriting pen event is displayed in the text input control.
[0162] As an example, in the non-full-screen input mode, if the second handwriting pen event in which the pen-down position is in the pen-down triggering area of the canvas is obtained, a handwriting process is started and the second handwriting pen event is intercepted, and then the second handwriting pen event is used to draw strokes in the canvas to display the writing content corresponding to the second handwriting pen event in the canvas, as shown in Figure 8The "Hello!" shown is the display effect after stroke drawing of the second handwriting pen event. After that, when the end instruction of the second handwriting pen event is obtained, it is determined that the user has completed some writing, and then the writing content corresponding to the second handwriting pen event can be recognized and the text recognition result can be displayed in the text input control. For example, the writing content "Hello!" is recognized and the text recognition result is displayed in the text input control as shown in Figure 8 Figure 11 After the text recognition result is displayed in the text input control, the state of the canvas can be reset to the state before writing to prepare for receiving the next second handwriting pen event.
[0163] As a possible implementation, the tool bar can include a full-screen input mode switching control. In response, in the full-screen input mode of the global handwriting input method, the handwriting pen writing input process can be implemented as follows:
[0164] In response to the triggering operation of the handwriting pen on the full-screen input mode switching control, the full-screen input mode is switched to, and the canvas is displayed full screen;
[0165] A third handwriting pen event is received, in which the pen drop position is at any position on the canvas.
[0166] According to the third handwriting pen event, stroke drawing is performed in the canvas to display the writing content corresponding to the third handwriting pen event in the canvas.
[0167] In response to the end instruction of the third handwriting pen event, the writing content corresponding to the third handwriting pen event is recognized to determine the text recognition result corresponding to the third handwriting pen event.
[0168] The text recognition result corresponding to the third handwriting pen event is displayed in the text input control.
[0169] The third handwriting pen event can be a writing event triggered by a handwriting pen within the canvas area range in the full-screen input mode after the global handwriting input method is pulled up.
[0170] The end instruction of the third handwriting pen event can include triggering the enter control in the tool bar, the writing pause duration being greater than a preset duration, etc., but is not limited thereto.
[0171] For example, the preset duration can be 500ms, so when the writing pause duration of the handwriting pen is greater than 500ms, it is determined that the end instruction of the third handwriting pen event is obtained, and the writing content corresponding to the third handwriting pen event can be displayed in the text input control.
[0172] As an example, a full-screen input mode switching control can be provided in the tool bar, so that when the global handwriting input method is in a non-full-screen input mode, clicking the full-screen input mode switching control can switch to a full-screen input mode; when the global handwriting input method is in a full-screen input mode, clicking the full-screen input mode switching control can switch to a non-full-screen input mode. For example, in the interface shown in Figure 8 , clicking the full-screen input mode switching control can switch to the interface shown in Figure 10 , and in the interface shown in Figure 10 , clicking the full-screen input mode switching control can switch to the interface shown in Figure 8 . After switching to the full-screen input mode, the third stylus handwriting event of the pen drop position at any position of the canvas can be continuously received, and stroke drawing is performed in the canvas according to the third stylus handwriting event, so as to display the writing content corresponding to the third stylus handwriting event in the canvas, such as Figure 10 . After that, when the end instruction of the third stylus handwriting event is obtained, it is determined that the user has completed some writing, and the writing content corresponding to the third stylus handwriting event is subjected to character recognition, and the character recognition result is displayed in the text input control. For example, the interface after the writing content Figure 10 is subjected to character recognition and the character recognition result is displayed in the text input control is as shown in Figure 12 . After the character recognition result is displayed in the text input control, the canvas is still displayed full screen and the handwriting pen input is continuously received until the user actively exits the full-screen input mode or actively exits the global handwriting input method.
[0173] As an example, as shown in Figure 7 , after the canvas and the tool bar are pulled up, the input method calling program executes the onStylusHandwritingMotionEvent() method, when the input method calling program executes the onStylusHandwritingMotionEvent() method, the global handwriting input method application receives the handwriting pen event through the canvas and performs stroke drawing and character recognition; then the input method calling program executes the handwriting pen handwriting end (onFinishStylusHandwriting()) method, when the input method calling program executes the onFinishStylusHandwriting() method, the global handwriting input method application hides the canvas and transmits the character recognition result to the text input control.
[0174] Further, the global handwriting input method can be exited when the end instruction of the global handwriting input method is acquired, so that the user can conveniently exit the global handwriting input method when handwriting input through the stylus is no longer needed, and the subsequent interaction of the user is avoided, thereby further improving the interaction convenience and efficiency of the stylus handwriting input. That is, in a possible implementation manner of the embodiment of the present application, after the step 103, the method can further include:
[0175] The global handwriting input method is exited in response to the end instruction of the global handwriting input method.
[0176] As a possible implementation manner, the end instruction of the global handwriting input method can be a return instruction commonly used by the electronic device, such as leftward swiping or rightward swiping from the flat edge of the electronic device, so that the end instruction of the global handwriting input method can be acquired when the return instruction of the electronic device is acquired, and the global handwriting input method can be exited through the pre-created stylus IMMS, and the canvas and the toolbar of the global handwriting input method are hidden.
[0177] As a possible implementation manner, an exit control can be provided in the toolbar of the global handwriting input method, so that the end instruction of the global handwriting input method can be acquired when a triggering operation on the exit control in the toolbar is acquired, and the global handwriting input method can be exited through the pre-created stylus IMMS, and the canvas and the toolbar of the global handwriting input method are hidden.
[0178] As a possible implementation manner, the end instruction of the global handwriting input method can also include a received finger event, so that as long as a finger event occurring in the screen of the electronic device is received, it is considered that the user currently does not have a handwriting demand through the stylus, so that the end instruction of the global handwriting input method can be acquired, and the global handwriting input method can be exited through the pre-created stylus IMMS, and the canvas and the toolbar of the global handwriting input method are hidden.
[0179] In this way, the global handwriting input method is exited when the finger event is received, so that when the user no longer needs to perform handwriting input through the stylus, the global handwriting input method can be quickly exited by directly performing any operation on the electronic device through the finger, thereby further simplifying the interaction process of the stylus handwriting input, saving the operation time, and further improving the interaction convenience and efficiency of the stylus.
[0180] The handwriting pen global handwriting input method provided by the embodiment of the present application includes the following steps: when a handwriting pen event is received in an input hot area corresponding to a text input control, legality verification is performed on global handwriting pen input of the text input control to determine whether the text input control allows handwriting pen input; and in the case that the legality verification is passed, i.e. in the case that the text input control allows handwriting pen input, a global handwriting input method corresponding to the handwriting pen is pulled up through a first IMMS and a handwriting pen IMMS created in advance, so as to directly perform handwriting input on the text input control through the handwriting pen. Thus, the global handwriting input method corresponding to the handwriting pen is directly triggered by using the handwriting pen to drop the pen in the input hot area near the text input control, so that the user can directly perform handwriting input through the handwriting pen without manually switching the input method, the interactive process of handwriting input through the handwriting pen is simplified, the operation time is saved, the interactive convenience and efficiency of the handwriting pen are improved, and the user experience is improved.
[0181] Figure 13 The overall framework diagram of the handwriting pen global handwriting input method provided by the embodiment of the present application is shown in Figure 13 The overall process of the handwriting pen global handwriting input method of the embodiment of the present application is explained as follows:
[0182] In the overall framework of the handwriting pen global handwriting input method of the embodiment of the present application, three modules, i.e. a view, an input method management framework and a global handwriting input method, are included. The view communicates with the input method management framework to pull up the input method according to the handwriting pen event detected by the view, and the input method management framework is used to manage the global handwriting input method. The view detects the handwriting pen drop in the text input control through a handwriting input initialization tool, and continues to determine whether the text input control disables handwriting pen input when it is determined that the handwriting pen drop is in the input hot area of the text input control. The handwriting input initialization tool judges whether the global handwriting switch is turned on, and the global handwriting input method is pulled up when the global handwriting switch is turned on and the input method management framework determines that the input event type is a handwriting pen, i.e. the canvas and the tool bar of the global handwriting input method can be pulled up. In the non-full-screen input mode, the global handwriting input method can start a handwriting process and intercept the handwriting pen event, then send the handwriting pen event to the canvas, and then perform stroke drawing and character recognition, and submit the character recognition result to the text input control, and end the handwriting process. After the full-screen handwriting mode switching control in the tool bar is clicked, the full-screen canvas can be pulled up and exist continuously, and then the handwriting pen event is received, stroke drawing and character recognition are performed, and the character recognition result is submitted to the text input control.
[0183] Figure 14This is an overall timing diagram of a global handwriting input method for a stylus provided in an embodiment of this application, with reference to... Figure 14 The overall process of the global handwriting input method of the stylus in this application embodiment will be explained as follows:
[0184] First, the handwriting input initialization tool detects the pen drop through the onTouchEvent() method, and when the pen drop is detected, it determines whether the global handwriting input method needs to be triggered through the shouldTriggerStylusHandwritingForView() method, including determining whether the pen drop is in the hot area, whether the pen drop is a stylus event, and whether the text input control disables stylus input. In the case where the pen drop is in the hot area, the pen drop is a stylus event, and the text input control does not disable the default input method, the view calls the isStylusHandwritingAvailable() method to send a verification request to the input method manager to determine whether the default input method supports stylus input, and the input method manager returns the judgment result of whether the global handwriting switch is on by calling the isStylusHandwritingAvailableAsUser() method. If the global handwriting switch is on, return true directly, and trigger the global handwriting input method. If the global handwriting switch is not on, execute the logic of the default input method. Then, the handwriting input initialization tool determines the event drop point (i.e. the text input control where the stylus drops) through the findBestCandidateView() method to get the view that triggers handwriting. Then the handwriting input initialization tool sends a start handwriting instruction to the view through the startHandwriting() method, and the view sends a start stylus handwriting input instruction to the input method manager through the startStylusHandwriting(view) method. Then the input method manager sends a start stylus handwriting instruction to the input method global invoker (InputMethodmanagerGlobalInvoker) through the startStylusHandwriting(InputMethodClient) method. Then the input method global invoker sends a start stylus handwriting instruction to the first IMMS created in advance through the startStylusHandwriting(InputMethodClient) method. Then the first IMMS created in advance determines whether the global handwriting switch is on again, and sends a start stylus handwriting instruction to the stylus IMMS created in advance through the startStylusHandwriting(InputMethodClient) method when the global handwriting switch is on, and executes the logic of the default input method when the global handwriting switch is off. Then the stylus IMMS created in advance sends a can start stylus handwriting input instruction to the input method invoker (InputMethodInvoker) through the canStartStylusHandwriting() method.Afterwards, the input method calling program can initialize the handwriting window through the method maybeCreateAndInitInkWindow(), and initialize the canvas through the method onPrepareStylusHandwriting(), and then pull up the canvas and the toolbar through the method onStartStylusHandwriting(). Afterwards, the input method calling program returns the method onStylusHandwritingReady() to the pre-created stylus IMMS, to inform that the global handwriting input method is ready, and can proceed to write. Afterwards, the pre-created stylus IMMS can initialize the handwriting process through the method startHandwritingSession(), and start handwriting through the method startStylusHandwriting(). After the handwriting process is finished, the input method calling program executes the method finishStylusHandwriting() to end handwriting, and hides the handwriting window through the method mInkWindow.hide(), and then executes the method onFinishStylusHandwriting() to indicate that the handwriting is finished; afterwards, the pre-created stylus IMMS is informed to reset the canvas through the method resetStylusHandwriting(), and then the pre-created stylus IMMS executes the method scheduleResetStylusHandwriting() to end the handwriting and reset the canvas state.
[0185] Figure 15 The software architecture diagram of the global handwriting input method of the stylus provided by an embodiment of the present application is a layered architecture, which divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, they are the application layer, the application framework layer, the Android runtime and the system layer, and the kernel layer. Since the global handwriting input method of the stylus of the embodiment of the present application mainly involves the interaction of the framework layer and the application layer, the application layer and the framework layer are described in detail. Figure 15Only the application layer and the framework layer are shown. The framework layer includes a control module, an input method management framework, and an input method module, and the application layer includes an input method application. The control module includes a text input control and a handwriting input initialization tool. When the text input control obtains a touch event, the handwriting input initialization tool determines the event type and the drop point, and returns the results to the text input control. When the event type is a handwriting pen event and the text input control does not disable handwriting pen input, the text input control notifies the input method management framework to start pulling up the input method through the view of the text input control. The input method management framework includes an input method manager, a pre-created first IMMS, a pre-created handwriting pen IMMS, and a second IMMS (i.e., a native IMMS). After receiving a notification of starting handwriting pen input, the input method manager can notify the pre-created first IMMS to check the state of the global handwriting switch, and when it is determined that the global handwriting switch is on, the pre-created handwriting pen IMMS is used to pull up the global handwriting input method. When the global handwriting switch is off, the native logic is entered, i.e., the second IMMS is used to pull up the default input method. After it is determined that the global handwriting input method can be pulled up, the input method management framework can notify the input method module to pull up the global handwriting input method, so that the input method module can sequentially initialize the handwriting window, prepare handwriting pen input, start handwriting pen input, receive handwriting pen events, and end handwriting when a receiving instruction is received. Correspondingly, in the application layer, when the input method module initializes the handwriting window, the input method application initializes the canvas; when the input method module starts handwriting pen input, the input method application displays the canvas; when the input method module receives handwriting pen events, the input method application performs stroke and character recognition and outputs the recognition results; when the input method module determines to end handwriting, the input method application resets the canvas state; when the user clicks the full-screen input mode switching control in the toolbar that displays the canvas, the input method application enters the full-screen input mode and displays the full-screen canvas, and then performs stroke and character recognition and outputs the recognition results when handwriting pen events are received. Other specific interaction processes between the modules can be referred to the detailed description of the above embodiments, which will not be described here.
[0186] It should be noted that Figure 13-15 Other specific implementation processes and principles of the above embodiments can be referred to the detailed description of the above embodiments, which will not be described here.
[0187] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution. The execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0188] Corresponding to the handwriting pen global handwriting input method described in the above embodiments, Figure 16A structural block diagram of the global handwriting input device of the handwriting pen is shown, and only parts related to the embodiments of the present application are shown for ease of illustration.
[0189] With reference to Figure 16 The device 1600 is applied to an electronic device associated with the handwriting pen, and includes:
[0190] The first verification module 1601 is configured to, in response to the first handwriting pen event being received by the input hot area corresponding to the text input control, perform legality verification on the global handwriting pen input of the text input control.
[0191] The first determination module 1602 is configured to, in the case that the legality verification passes, determine the event type of the current input event by using the first IMMS created in advance, wherein the event type includes the handwriting pen event and the finger event.
[0192] The first pulling-up module 1603 is configured to, in the case that the event type of the current input event is determined to be the handwriting pen event, pull up the global handwriting input method corresponding to the handwriting pen by using the handwriting pen IMMS created in advance.
[0193] In actual use, the global handwriting input device of the handwriting pen provided in the embodiments of the present application can be configured in any electronic device to perform the global handwriting input method of the handwriting pen.
[0194] The global handwriting input device of the handwriting pen provided in the embodiments of the present application performs legality verification on the global handwriting pen input of the text input control when the handwriting pen event is received in the input hot area corresponding to the text input control, to determine whether the text input control allows handwriting pen input, and in the case that the legality verification passes, i.e., in the case that the text input control allows handwriting pen input, the global handwriting input method corresponding to the handwriting pen is pulled up by using the first IMMS and the handwriting pen IMMS created in advance, so as to directly perform handwriting input on the text input control by using the handwriting pen. Thus, the global handwriting input method corresponding to the handwriting pen is directly triggered by using the handwriting pen to fall on the input hot area near the text input control, so that the user can directly perform handwriting input by using the handwriting pen without manually switching the input method, the interactive process of handwriting input by using the handwriting pen is simplified, the operation time is saved, the interactive convenience and the interactive efficiency of the handwriting pen are improved, and thus the user experience is improved.
[0195] In a possible implementation manner of the present application, the first verification module 1601 includes:
[0196] The first verification unit is configured to verify whether the text input control disables handwriting pen input.
[0197] The first determining unit is configured to determine that the legality verification fails when the text input control disables the stylus input.
[0198] The second verifying unit is configured to verify whether a global stylus switch is turned on when the text input control enables the stylus input.
[0199] The second determining unit is configured to determine that the legality verification passes when the global stylus switch is turned on.
[0200] The third determining unit is configured to determine that the legality verification fails when the global stylus switch is turned off.
[0201] Further, in another possible implementation manner of the present application, the first verifying module 1601 further includes:
[0202] The third verifying unit is configured to verify whether a default input method of the electronic device supports the stylus input.
[0203] The first pulling unit is configured to pull up the default input method through a second IMMS of the electronic device when the default input method supports the stylus input.
[0204] Further, in another possible implementation manner of the present application, the first pulling module 1603 includes:
[0205] The second pulling unit is configured to pull up and display a canvas and a toolbar corresponding to the global stylus input method through a pre-created stylus IMMS.
[0206] Further, in another possible implementation manner of the present application, the input mode of the global stylus input method includes a non-full-screen input mode and a full-screen input mode; in the non-full-screen input mode, a pen drop triggering area of the canvas is a corresponding area of an input hot area in the canvas; and in the full-screen input mode, the pen drop triggering area of the canvas is the whole area of the canvas.
[0207] Further, in another possible implementation manner of the present application, the first pulling module 1603 further includes:
[0208] The first opening unit is configured to, in response to a second stylus event in which a pen drop position is in the pen drop triggering area of the canvas, open a stylus flow and intercept the second stylus event.
[0209] The first drawing unit is configured to draw strokes in the canvas according to the second stylus event, so as to display writing content corresponding to the second stylus event in the canvas.
[0210] The first character recognition unit is configured to perform character recognition on the writing content corresponding to the second handwriting pen event in response to an end instruction of the second handwriting pen event, to determine a character recognition result corresponding to the second handwriting pen event.
[0211] The first display unit is configured to display the character recognition result corresponding to the second handwriting pen event in the text input control.
[0212] The first reset unit is configured to end the handwriting process and reset the state of the canvas.
[0213] Further, in another possible implementation of the present application, the tool bar includes a full-screen input mode switching control; correspondingly, the first pulling-up module 1603 further includes:
[0214] The first switching unit is configured to switch to a full-screen input mode and display the canvas in full screen in response to a triggering operation of the handwriting pen on the full-screen input mode switching control.
[0215] The first receiving unit is configured to receive a third handwriting pen event with a pen-down position at any position of the canvas.
[0216] The second drawing unit is configured to perform stroke drawing in the canvas according to the third handwriting pen event, to display writing content corresponding to the third handwriting pen event in the canvas.
[0217] The second character recognition unit is configured to perform character recognition on the writing content corresponding to the third handwriting pen event in response to an end instruction of the third handwriting pen event, to determine a character recognition result corresponding to the third handwriting pen event.
[0218] The second display unit is configured to display the character recognition result corresponding to the third handwriting pen event in the text input control.
[0219] Further, in another possible implementation of the present application, the apparatus 1600 further includes:
[0220] The second pulling-up module is configured to pull up a default input method of the electronic device through a second IMMS of the electronic device, in a case where it is determined that the event type of the current input event is a finger event.
[0221] Further, in another possible implementation of the present application, the apparatus 1600 further includes:
[0222] The first exiting module is configured to exit the global handwriting input method in response to an end instruction of the global handwriting input method.
[0223] Further, in another possible implementation of the present application, the end instruction of the global handwriting input method includes receiving a finger event.
[0224] It should be noted that the information interaction, execution process and the like between the above apparatuses / units are based on the same concept as the method embodiments of the present application, and specific functions and brought technical effects can be referred to the method embodiments part, which will not be repeated here.
[0225] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or software. In addition, the specific name of each functional unit and module is only for easy distinction, and does not limit the protection scope of the present application. The specific working process of the unit and module in the system can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0226] In order to realize the above-mentioned embodiments, the present application further provides an electronic device.
[0227] Figure 17 The structural schematic diagram of the electronic device of one embodiment of the present application.
[0228] Referring to Figure 17 The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a loudspeaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0229] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0230] The processor 110 can include one or more processing units, such as: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.
[0231] Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of instruction fetching and instruction execution.
[0232] The memory can also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory. Avoiding repeated access, reducing the waiting time of the processor 110, thus improving the efficiency of the system.
[0233] In some embodiments, the processor 110 can include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0234] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a limitation on the structure of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.
[0235] The charging management module 140 is configured to receive a charging input from a charger. The charger can be a wireless charger or a wired charger.
[0236] The power management module 141 is configured to connect the battery 142 and the charging management module 140 and the processor 110.
[0237] The wireless communication function of the electronic device 100 can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.
[0238] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals.
[0239] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100.
[0240] The wireless communication module 160 can provide solutions for wireless communication, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), and the like, which are applied to the electronic device 100.
[0241] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, and the like. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0242] The display screen 194 is used to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 can include 1 or N display screens 194, and N is an integer greater than 1.
[0243] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor, and the like.
[0244] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, music, video, and the like files are saved in the external memory card.
[0245] The internal memory 121 can be used to store computer executable program codes including instructions. The processor 110 performs various functional applications and data processing of the electronic device 100 by executing the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required by at least one function (such as a sound playing function, an image playing function, etc.), etc. The data storage area can store data (such as audio data, a phone book, etc.) created by the electronic device 100 during use, etc. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0246] The electronic device 100 can realize audio functions such as music playing, recording, etc. through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc.
[0247] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser.
[0248] The key 190 includes a power-on key, a volume key, etc. The key 190 can be a mechanical key or a touch key. The electronic device 100 can receive a key input and generate a key signal input related to the user settings and function control of the electronic device 100.
[0249] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, such as the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as digital versatile disc (DVD)) or semiconductor media (such as solid state disk (SSD)) and the like.
[0250] It should be noted that the implementation process and technical principles of the electronic device of the present embodiment are described above in the explanation of the global handwriting input method of the handwriting pen of the present embodiment, which will not be repeated here.
[0251] The present embodiment also provides a chip system applied to an electronic device, the chip system including one or more processors, the one or more processors being configured to invoke computer instructions to enable the electronic device to implement the steps in the above various method embodiments.
[0252] The present embodiment also provides a computer readable storage medium including instructions, when the instructions are run on an electronic device, enabling the electronic device to implement the steps in the above various method embodiments.
[0253] The present embodiment also provides a computer program product including a computer program, when the computer program is run on an electronic device, enabling the electronic device to implement the steps in the above various method embodiments.
[0254] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the present application can implement all or part of the processes in the above-mentioned embodiment methods through a computer program to instruct related hardware to complete, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the device / equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk and the like. In some jurisdictions, according to legislation and patent practice, the computer readable medium can not be an electrical carrier signal and a telecommunication signal.
[0255] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0256] In the above embodiments, specific details such as specific system structures, techniques, etc. are presented for the purpose of illustration, not for the purpose of limitation, so as to thoroughly understand the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits and methods are omitted to avoid unnecessary details that hinder the description of the present application.
[0257] It should be understood that when used in the specification and the appended claims of the present application, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or sets thereof.
[0258] It should also be understood that the term "and / or" used in the specification and the appended claims of the present application means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0259] As used in the specification and the appended claims, the term "if' can be interpreted as meaning "when" or "upon" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if it is determined" or "if [the described condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [the described condition or event]" or "in response to detecting [the described condition or event]" depending on the context.
[0260] In addition, the terms "first", "second", "third", etc. as used in the description of the specification and the appended claims are only used to differentiate between descriptions, and cannot be understood as indicating or implying relative importance.
[0261] Reference in the specification to "one embodiment" or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase "in one embodiment" or "in some embodiments" in various places in the specification are not necessarily all referring to the same embodiment, although it can. The terms "comprising", "including", "having" and their variants, as used in the specification, mean "including but not limited to", unless otherwise specified.
[0262] Those of ordinary skill in the art can understand that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be realized by electronic hardware, or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solutions. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the application.
[0263] In the embodiments provided in the present application, it should be understood that the disclosed apparatus / equipment and methods can be implemented in other ways. For example, the apparatus / equipment embodiments described above are merely illustrative, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0264] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may also be distributed to multiple network units. Part or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.
[0265] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A global handwriting input method for a stylus, characterized in that, The method, applied to an electronic device associated with the stylus, includes: In response to the first stylus event being received by the input hotspot corresponding to the text input control, the validity of the global stylus input of the text input control is verified. If the validity verification passes, the event type of the current input event is determined through the pre-created first input method management service IMMS, wherein the event type includes stylus events and finger events; If the event type of the current input event is determined to be the stylus event, the global handwriting input method corresponding to the stylus is activated through the pre-created stylus IMMS.
2. The method as described in claim 1, characterized in that, The global stylus input validation for the text input control includes: Verify whether the text input control has stylus input disabled; If the text input control disables stylus input, the validity check is determined to have failed. If the text input control allows stylus input, verify whether the global handwriting switch is turned on; With the global handwriting switch enabled, the validity check is confirmed to be successful. If the global handwriting switch is turned off, the validity check is determined to have failed.
3. The method as described in claim 2, characterized in that, After determining that the validity check has failed when the global handwriting switch is off, the method further includes: Verify whether the default input method of the electronic device supports stylus input; When the default input method supports the stylus input, the default input method is activated via the second IMMS of the electronic device.
4. The method according to any one of claims 1-3, characterized in that, The step of activating the global handwriting input method corresponding to the stylus via a pre-created stylus IMMS includes: The pre-created stylus IMMS is used to pull up and display the canvas and toolbar corresponding to the global handwriting input method.
5. The method as described in claim 4, characterized in that, The input modes of the global handwriting input method include a non-full-screen input mode and a full-screen input mode; in the non-full-screen input mode, the pen-triggering area of the canvas is the corresponding area of the input hot zone in the canvas; In the full-screen input mode, the pen-triggering area of the canvas is the entire area of the canvas.
6. The method as described in claim 5, characterized in that, After the pre-created stylus IMMS is used to pull up and display the canvas and toolbar corresponding to the global handwriting input method, the method further includes: In response to a second stylus event where the pen stroke is located in the pen stroke trigger area of the canvas, a handwriting process is initiated and the second stylus event is intercepted. Draw strokes on the canvas according to the second stylus event, so as to display the writing content corresponding to the second stylus event on the canvas; In response to the end command of the second stylus event, the written content corresponding to the second stylus event is subjected to character recognition to determine the character recognition result corresponding to the second stylus event; The text recognition result corresponding to the second stylus event is displayed in the text input control; End the handwriting process and reset the state of the canvas.
7. The method as described in claim 5, characterized in that, The toolbar includes a full-screen input mode switching control. After the pre-created stylus IMMS is used to pull up and display the canvas and toolbar corresponding to the global handwriting input method, it also includes: In response to the stylus's trigger operation on the full-screen input mode switching control, the system switches to the full-screen input mode and displays the canvas in full screen. Receive a third stylus event where the pen stroke is placed at any position on the canvas; Strokes are drawn on the canvas according to the third stylus event, so as to display the writing content corresponding to the third stylus event on the canvas; In response to the end command of the third stylus event, the written content corresponding to the third stylus event is subjected to character recognition to determine the character recognition result corresponding to the third stylus event; The text recognition result corresponding to the third stylus event is displayed in the text input control.
8. The method according to any one of claims 1-7, characterized in that, After determining the event type of the current input event through a pre-created first IMMS if the validity check passes, the process further includes: If the event type of the current input event is determined to be the finger event, the default input method of the electronic device is activated through the second IMMS of the electronic device.
9. The method according to any one of claims 1-8, characterized in that, When the event type of the current input event is determined to be the stylus event, after activating the global handwriting input method corresponding to the stylus through the pre-created stylus IMMS, the method further includes: In response to the termination command of the global handwriting input method, exit the global handwriting input method.
10. The method as described in claim 9, characterized in that, The termination command for the global handwriting input method includes receiving a finger event.
11. An electronic device, characterized in that, The electronic device includes: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, and the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-10.
12. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-10.
14. A computer program product, characterized in that, Includes a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1-10.