CN114020164A - Stylus control method and device, electronic equipment and storage medium - Google Patents

Stylus control method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114020164A
CN114020164A CN202210002777.6A CN202210002777A CN114020164A CN 114020164 A CN114020164 A CN 114020164A CN 202210002777 A CN202210002777 A CN 202210002777A CN 114020164 A CN114020164 A CN 114020164A
Authority
CN
China
Prior art keywords
control
preset
target
function
stylus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210002777.6A
Other languages
Chinese (zh)
Other versions
CN114020164B (en
Inventor
谢炜航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yizhen Xuesi Education Technology Co Ltd
Original Assignee
Beijing Yizhen Xuesi Education Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yizhen Xuesi Education Technology Co Ltd filed Critical Beijing Yizhen Xuesi Education Technology Co Ltd
Priority to CN202210002777.6A priority Critical patent/CN114020164B/en
Publication of CN114020164A publication Critical patent/CN114020164A/en
Application granted granted Critical
Publication of CN114020164B publication Critical patent/CN114020164B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03545Pens or stylus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/038Control and interface arrangements therefor, e.g. drivers or device-embedded control circuitry
    • G06F3/0383Signal control means within the pointing device

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure provides a stylus control method, a stylus control device, an electronic device and a storage medium. The control method comprises the following steps: responding to a control operation of a user on a touch control pen in a target application, and acquiring a control instruction, wherein the control instruction is used for indicating to control a target function of the touch control pen in the target application; determining a target control class corresponding to the target function according to the mapping relation between each preset touch control pen function and each preset control class; and compiling codes of the target control classes according to the control instructions so as to control the target functions of the touch pen. Therefore, the function of the touch pen can be conveniently and accurately controlled in the target application by compiling the target control class corresponding to the target function of the touch pen.

Description

Stylus control method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of stylus technologies, and in particular, to a stylus control method and apparatus, an electronic device, and a storage medium.
Background
A stylus (stylus or stylus pen) is a small pen-shaped tool used to input commands to a touch-enabled device such as a tablet computer, and a user can select a document, paint, and draw by clicking a touch screen with the stylus. The mobile device with the touch pen has wide application because of simple operation and convenient use. However, the stylus function is usually carried by the operating system of the device, and due to the limitation of the operating system, most of the existing mobile devices with the stylus cannot control the stylus function of the mobile device in the application program.
Based on this, a solution is needed to conveniently and accurately control stylus functions in an application.
Disclosure of Invention
The embodiment of the disclosure provides a touch control pen control method and device, electronic equipment and a storage medium, which can conveniently and accurately control the function of a touch control pen in target application.
According to an aspect of the present disclosure, there is provided a stylus pen control method including: responding to a control operation of a user on a touch control pen in a target application, and acquiring a control instruction, wherein the control instruction is used for indicating to control a target function of the touch control pen in the target application; determining a target control class corresponding to the target function according to the mapping relation between each preset touch control pen function and each preset control class; and compiling codes of the target control classes according to the control instructions so as to control the target functions of the touch pen.
According to a second aspect of the present disclosure, there is provided a control processing apparatus of a stylus function, including: the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for responding to the control operation of a user on a touch pen in a target application and acquiring a control instruction, and the control instruction is used for indicating the control of the target function of the touch pen in the target application; the determining module is used for determining a target control class corresponding to the target function according to the mapping relation between each preset touch control pen function and each preset control class; and the compiling module is used for compiling codes of the target control classes according to the control instructions so as to control the target functions of the touch pen.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory storing a program, wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of the first aspect.
According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the method according to the first aspect.
One or more technical solutions provided in the embodiments of the present application respond to a control instruction of a user, determine a target control class according to a mapping relationship between a preset stylus function and the preset control class, and implement control over a stylus target function by compiling the target control class. Therefore, the function of the touch pen can be conveniently and accurately controlled in the target application by compiling the target control class corresponding to the target function of the touch pen.
Drawings
Further details, features and advantages of the disclosure are disclosed in the following description of exemplary embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 shows a flowchart diagram of a stylus control method according to an exemplary embodiment of the present disclosure;
FIG. 2 shows a flowchart diagram of a stylus control method according to yet another exemplary embodiment of the present disclosure;
FIG. 3 illustrates a stylus control class library diagram of a stylus according to yet another exemplary embodiment of the present disclosure;
FIG. 4 shows a flowchart diagram of a stylus control method according to yet another exemplary embodiment of the present disclosure;
FIG. 5 shows a flowchart diagram of a stylus control method according to yet another exemplary embodiment of the present disclosure;
FIG. 6 shows a schematic block diagram of a control processing device for stylus functionality according to an exemplary embodiment of the present disclosure;
FIG. 7 shows a schematic block diagram of a control processing device for stylus functionality according to another embodiment of the present disclosure; and
FIG. 8 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The terms: "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description. It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise. The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Currently, iPad + ApplePensil are mostly used as a system for a main lecture teaching tool in online education. Most of the existing mobile devices with touch pens cannot control the touch pen function of the mobile device in an application program. Such as inability to turn off stylus input, set a stylus user interface, set a delayed response, etc. in an application.
In some embodiments, the system guides or prompts the user to turn off the own touch pen function of the system in the system, and develops a set of touch pen function control system again according to the target application so as to realize convenient touch pen control. However, this approach requires the user to turn off the stylus function of the device system, which makes other applications unusable; moreover, the cost of developing a set of stylus control systems for a target application is also relatively high.
In some embodiments, the system-owned stylus functionality may be modified using an Application Programming Interface (API). Since the API provided by the system is limited and highly dependent on the system environment, the role and effect of controlling the function of the stylus in this way are very limited.
Referring to fig. 1, according to an aspect of the present disclosure, an embodiment of the present disclosure provides a stylus pen control method, including:
in step S120, in response to a control operation performed by a user on a stylus in a target application, a control instruction is obtained, where the control instruction is used to instruct to control a target function of the stylus in the target application.
When a user uses an application in an electronic device with a stylus, such as a tablet computer, the system is triggered to activate a function related to the stylus. The user may enter control operations to perform corresponding stylus functions. In response to the control operation of the user, a corresponding control instruction for instructing control of a target function of the stylus pen in the application may be acquired.
In step S140, a target control class corresponding to the target function is determined according to a mapping relationship between each preset stylus function and each preset control class.
In this embodiment, the preset control class may include at least one of a member variable and a member function.
Various functions of the equipment have corresponding control classes in the system, and the control of the functions can be realized by changing the settings of the control classes. Each kind of stylus function corresponds to a control class, for example, the color function of the stylus corresponds to a corresponding control class, and if the value of the control class (e.g., member variable) is set to green, the handwriting color of the stylus is green; if the value of such a control class (e.g., member variable) is set to red, the handwriting color of the stylus is red. And determining a target control class corresponding to the target function according to the mapping relation between the preset stylus functions and the preset control classes, namely determining the target control class needing to be modified.
In step S160, code compiling is performed on the target control class according to the control instruction, so as to control the target function of the stylus.
After the target control class corresponding to the target function is determined, code compiling processing can be executed for the target control class according to the control instruction, and then the target function of the touch pen can be controlled.
Specifically, when a teacher of online education uses a teaching application on an iPad, sometimes the control system may inadvertently trigger a handwriting-along function, so that a handwriting-along input interface appears on a touch screen of the iPad, and selection or other operations cannot be performed on the touch screen. The teacher may thus want to control the "write with hand" function of the stylus to be turned off. In response to this operation by the teacher, a control instruction for instructing to turn off the "handwriting with" function in the lecture application, which is the target function, may be acquired.
And according to a control instruction for indicating to close the 'handwriting following' function, modifying the parameter value of the target control class from 'ON' to 'OFF', thereby realizing the closing of the 'handwriting following' function.
In the method for controlling a stylus provided in this embodiment, a target control class is determined according to a control instruction of a user and mapping between each preset stylus function and each preset control class, and code compilation is performed on the target control class according to the control instruction to control the target function of the stylus. Therefore, the function of the touch pen can be conveniently and accurately controlled in the target application by modifying the target control class corresponding to the target function of the touch pen.
Referring to fig. 2, in another embodiment of the present disclosure, the determining a target control class corresponding to the target function according to a mapping relationship between each preset stylus function and each preset control class (i.e., step S140) includes:
in step S242, a mapping relationship between each preset stylus function and each preset control class is determined through debugging.
The touch device with a stylus includes a stylus control class library of the stylus in an operating system of the touch device, and the stylus control class library includes preset control classes of the stylus.
In this embodiment, the preset control class may include at least one of a member variable and a member function.
By debugging the system, the mapping relation between each preset touch control function and each preset control class in the touch control class library can be determined.
Referring to fig. 3, the stylus control class library of the stylus includes a plurality of preset control classes, wherein the preset control classes "stylus program options and setting read the overall switch control of" corresponding "along with handwriting"; presetting a control type 'touch control pen program interface' to input a user interface style corresponding to 'handwriting along' of a drawing board controller; the writing control part of the preset control type 'touch control pen program interface input element' corresponding to 'handwriting along' is provided.
In this embodiment, by changing the setting of the preset control class, the corresponding preset stylus function can be implemented. For example, for the overall ON-OFF control of "handwriting with hand", if "stylus program option and setting reading" is ON ", the" handwriting with hand "may be turned ON, and if" stylus program option and setting reading "is OFF", the "handwriting with hand" may be turned OFF.
In step S244, the preset stylus function matched with the target function is obtained according to the target function.
For example, the target function may be compared with each preset stylus function, and the preset stylus function matching the target function may be obtained.
In step S246, according to the mapping relationship between each preset stylus function and each preset control class, the preset control class having the mapping relationship with the matched preset stylus function is determined, and the preset control class is used as the target control class of the target function.
For example, when the target function is "follow handwriting" is off, "stylus program option and setting read" is the corresponding target control class.
Referring to fig. 4, in another embodiment of the present disclosure, determining a mapping relationship between each stylus function and each preset control class through debugging (i.e., step S242) includes:
in step S4421, one of the preset stylus functions is set.
Specifically, the function setting step may be performed to set one of the preset stylus functions.
In step S4422, one of the preset control classes to be verified is obtained from each preset control class, and a breakpoint is set for the preset control class to be verified.
Specifically, one preset control class to be verified can be obtained from each preset control class, and a breakpoint can be set for a member variable and/or a member function in the preset control class to be verified.
In step S4423, the preset control class to be verified at the breakpoint is debugged, and the actual function of the preset control class to be verified is determined.
Specifically, the actual stylus function of the preset control class to be verified can be determined by changing the setting of the preset control class to be verified at the breakpoint.
In step S4424, it is determined whether the actual stylus function matches the preset stylus function, if yes, step S4425 is executed, and if not, step S4422 is returned to.
Specifically, it may be determined whether the actual stylus function of the preset control class to be verified is consistent with the preset stylus function set in step S4421, if so, the verification is passed and step S4425 is performed, and if not, the step S4422 is executed again to obtain the next preset control class to be verified.
In step S4425, a mapping relationship between the preset stylus function and the preset control class to be verified is established.
Specifically, if the actual stylus function matches the preset stylus function, which represents that the verification is successful, a mapping relationship between the preset stylus function and the preset control class to be verified is established.
Aiming at different operating systems, different auxiliary development tools and debuggers exist, for example, Xcode is an application development tool provided by apple system officials, android studio is an application development tool provided by android system officials, LLDB is a debugger provided by apple system and built in Xcode, and GDB is a debugger commonly used in the industry. The auxiliary development tools and the debugger can determine the corresponding relation between the preset touch pen functions and the preset control classes in the touch pen control class library through debugging.
Breakpoints are one of the functions of a debugger that allows a program to be interrupted where it is needed, thereby facilitating its analysis. In particular, a breakpoint may be a signal that informs a debugger to cause a program to enter an interruption mode at a certain point, which does not terminate or end execution of the program, and execution may continue at any time.
Specifically, a breakpoint can be set at a preset control class to be verified in a stylus control class library of the apple system through the LLDB, so as to determine an actual stylus function corresponding to the preset control class at the breakpoint, and if the actual stylus function matches the preset stylus function, a mapping relationship between the preset stylus function and the preset control class is established.
In another embodiment of the present disclosure, the determining the actual stylus function of the preset control class by debugging the preset control class at the breakpoint (i.e., step S4422) includes:
determining the actual stylus function of the preset control class by changing the setting of the preset control class at the breakpoint.
In particular, the settings of the preset control classes at the breakpoint can be changed through the aforementioned application development tools and debugger, which can cause changes in stylus functionality. The actual stylus function of the preset control class at the breakpoint may be determined based on the change in function.
In another embodiment of the present disclosure, each preset control class in the stylus control class library may include at least one of a member variable and a member function, and the changing the setting of the preset control class at the breakpoint includes:
if the preset control class contains the member function, changing the setting of the preset control class by calling the member function (namely, a get mode);
if the preset control class contains the member variable, the setting of the preset control class is changed by modifying the member variable (namely, set mode).
In another embodiment of the present disclosure, before determining the target control class corresponding to the target function according to the mapping relationship between each preset stylus function and each preset control class (i.e., step S140), the method further includes:
and loading a touch control class library containing each preset control class into a system memory in response to a detection result that a preset input window is loaded in the user interface or in response to a detection result that the touch pen is activated.
In an embodiment, when it is detected that a predetermined input window is loaded in a user interface of the electronic device, a stylus control class library including each predetermined control class is loaded into a system memory.
For example, for an apple system, if there is an input box (i.e., an input window) on the iPad screen, regardless of whether the input box is in a web page or in a native interface, the system triggers the stylus control class library of the stylus to be loaded into the system memory in advance, so that each preset control class in the stylus control class library can be debugged.
In another embodiment, when the stylus is detected to be activated, a stylus control class library including each default control class is loaded into the system memory.
For example, for other tablet computers that are not apple systems, the stylus control class library of the stylus may be loaded into the system memory at the latest before the stylus falls on the screen, so that each preset control class in the stylus control class library may be debugged.
Furthermore, since it is not determined whether the target application loads the stylus control class library of the stylus into the system memory, it is necessary to determine whether the stylus control class library of the stylus is in the process of the target application. By determining that the stylus control class library of the stylus is in the system memory and the process of the target application, the effectiveness of subsequent operations can be ensured.
In view of this, in another embodiment of the present disclosure, the method further includes the steps of:
step S510, a responder view of the user interface of the currently running target application is acquired.
Specifically, the touch pen control class library in the system memory can be queried by using an auxiliary development tool such as Xcode (an official tool developed by apple App) or android studio (an official tool developed by android App), in combination with a dynamic debugger such as LLDB (a debugger built in Xcode provided by apple) or GDB (a debugger commonly used in the industry).
Taking Xcode + LLDB as an example, the target application can be run in Xcode first, then the user interface hierarchy relationship of the target application is captured in Xcode, and the responder view (e.g., the responder view of the input window) is obtained in the user interface hierarchy.
Step S520, querying the responder view, and determining that the stylus control class library is loaded in the process of the target application when the stylus control class library exists in the responder view.
After obtaining the responder view, all objects in the current memory and each corresponding control class library may be captured using Xcode, and if the stylus control class library can be found in each control class library, it is determined that the stylus control class library is loaded in the process of the target application, representing that there is a reference relation chain between the input window and the stylus.
In another embodiment of the present disclosure, the code compiling the target control class according to the control instruction to implement controlling a target function of the stylus (i.e., step S160) includes:
and compiling a control instruction code of the target control class according to the control instruction, the preset touch pen functions and the mapping relation among the preset control classes, and compiling the control instruction code in the target application to realize the control of the target function of the touch pen.
Alternatively, the control instruction code may be compiled by:
and under the condition that the target control class contains member variables, modifying the member variables according to the control instruction, or acquiring modified values corresponding to the member variables from other processes according to the control instruction, and modifying the member variables according to the modified values to realize the control of the target functions of the stylus.
Specifically, a modification mode (set mode) may be directly adopted for the member variable in the target application process, that is, the parameter value of the target control class is directly modified in the process of the target application according to the control instruction.
In addition, for the member variable of the cross-process, a modification method cannot be adopted, but a calling mode (get mode) is needed, namely, a modification value corresponding to the member variable is obtained from other processes, and then the member variable in the target control class is modified according to the modification value.
The two modes can modify variables of different forms corresponding to different functions of the touch pen, and control of various different functions of the touch pen is achieved.
And if the target control class comprises member functions, calling the member functions according to the control instruction so as to control the target functions of the stylus.
Specifically, since the member function cannot adopt the modification mode (set mode), a call mode (get mode) is required to realize control of the target function of the stylus.
Referring to fig. 6, an embodiment of the present disclosure provides a control processing apparatus 600 for a stylus function, including:
the obtaining module 610 is configured to obtain a control instruction in response to a control operation performed by a user on a stylus in a target application, where the control instruction is used to instruct to control a target function of the stylus in the target application.
The determining module 620 is configured to determine a target control class corresponding to the target function according to a mapping relationship between each preset stylus function and each preset control class.
The compiling module 630 is configured to compile codes of the target control classes according to the control instruction, so as to control a target function of the stylus.
Optionally, the determining module 620 is further configured to: acquiring the preset touch control pen function matched with the target function according to the target function; and determining the preset control classes having the mapping relation with the matched preset touch pen functions according to the mapping relation between the preset touch pen functions and the preset control classes, and taking the preset control classes as the target control classes corresponding to the target functions.
Optionally, the compiling module 630 is further configured to: if the target control class contains member variables, modifying the member variables according to the control instruction, or acquiring modified values corresponding to the member variables from other processes according to the control instruction, and modifying the member variables according to the modified values to realize control over the target functions of the stylus; and if the target control class contains member functions, calling the member functions according to the control instruction so as to control the target functions of the stylus.
Referring to fig. 7, a diagram of another embodiment of a stylus-enabled control processing device 600 of the present disclosure is shown. As shown in the figure, the control processing apparatus 600 of the present embodiment includes a mapping module 640 and a loading module 650 in addition to the above-mentioned obtaining module 610, determining module 620 and compiling module 630.
The mapping module 640 is configured to determine, through debugging, a mapping relationship between each preset stylus function and each preset control class.
Optionally, the mapping module 640 is further configured to: executing a function setting step to set one of preset touch control pen functions; executing a breakpoint setting step to acquire one preset control class to be verified from each preset control class and setting a breakpoint for the preset control class to be verified; executing a debugging step, debugging the preset control class to be verified at the breakpoint to determine the actual touch pen function of the preset control class to be verified; and executing a verification step, if the actual touch pen function is matched with the preset touch pen function, establishing a mapping relation between the preset touch pen function and the preset control class to be verified, and if the actual touch pen function is not matched with the preset touch pen function, returning to execute the breakpoint setting step.
Optionally, the mapping module 640 is further configured to: and determining the actual touch control pen function of the preset control class to be verified by changing the setting of the preset control class to be verified at the breakpoint.
Optionally, the preset control class to be verified comprises member functions and/or member variables; correspondingly, the mapping module is further configured to: if the preset control class to be verified comprises the member function, changing the setting of the preset control class by calling the member function; and if the preset control class to be verified contains the member variable, changing the setting of the preset control class by modifying the member variable.
The loading module 650 is configured to load, in response to a detection result that a preset input window is loaded in the user interface or in response to a detection result that the stylus is activated, a stylus control class library including each preset control class into the system memory.
Optionally, the loading module 650 is further configured to: acquiring a responder view of a user interface of a currently running target application; and inquiring the responder view, and determining that the stylus control class library is loaded in the process of the target application under the condition that the stylus control class library exists in the responder view.
In a third aspect of the present disclosure, an embodiment of the present disclosure provides an electronic device, including: a processor; and a memory storing a program, wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method according to the first aspect of the disclosure.
In a fourth aspect of the present disclosure, embodiments of the present disclosure provide a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method according to the first aspect of the present disclosure.
In a fifth aspect of the present disclosure, embodiments of the present disclosure provide a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method according to the first aspect of the present disclosure.
Referring to fig. 8, a block diagram of a structure of an electronic device 800, which may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic device is intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the electronic device 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the electronic device 800 are connected to the I/O interface 805, including: an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. The input unit 806 may be any type of device capable of inputting information to the electronic device 800, and the input unit 806 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device. Output unit 807 can be any type of device capable of presenting information and can include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. The storage unit 804 may include, but is not limited to, a magnetic disk, an optical disk. The communication unit 809 allows the electronic device 800 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, WiFi devices, WiMax devices, cellular communication devices, and/or the like.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The calculation unit 801 executes the respective methods and processes described above. For example, in some embodiments, the feature sharing modeling method as the first aspect may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto the electronic device 800 via the ROM 802 and/or the communication unit 809. In some embodiments, the computing unit 801 may be configured in any other suitable manner (e.g., by way of firmware) to perform the stylus control methods described in the various embodiments.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

Claims (11)

1. A stylus control method, comprising:
responding to a control operation of a user on a touch control pen in a target application, and acquiring a control instruction, wherein the control instruction is used for indicating to control a target function of the touch control pen in the target application;
determining a target control class corresponding to the target function according to the mapping relation between each preset touch control pen function and each preset control class;
and compiling codes of the target control classes according to the control instructions so as to control the target functions of the touch pen.
2. The method of claim 1, wherein the determining the target control class corresponding to the target function according to the mapping relationship between each preset stylus function and each preset control class comprises:
acquiring a preset touch control pen function matched with the target function according to the target function;
and determining a preset control class having a mapping relation with the matched preset stylus function according to the mapping relation between each preset stylus function and each preset control class, and taking the preset control class as the target control class corresponding to the target function.
3. The method of claim 1 or 2, wherein the method further comprises:
determining the mapping relation between each preset touch control pen function and each preset control class through debugging,
and wherein, the determining, through the debugging, a mapping relationship between each preset stylus function and each preset control class includes:
executing a function setting step to set one of preset touch control pen functions;
executing a breakpoint setting step to acquire one preset control class to be verified from each preset control class and setting a breakpoint for the preset control class to be verified;
executing a debugging step, debugging the preset control class to be verified at the breakpoint, and determining the actual touch pen function of the preset control class to be verified;
and executing verification, namely establishing a mapping relation between the preset touch pen function and the preset control class to be verified under the condition that the actual touch pen function is matched with the preset touch pen function, and returning to execute the breakpoint setting step under the condition that the actual touch pen function is not matched with the preset touch pen function.
4. The method of claim 3, wherein the debugging step comprises:
and determining the actual touch control pen function of the preset control class to be verified by changing the setting of the preset control class to be verified at the breakpoint.
5. The method of claim 4, wherein the preset control classes include member functions and/or member variables;
and wherein the changing the setting of the preset control class to be verified at the breakpoint comprises:
under the condition that the preset control class to be verified contains the member function, changing the setting of the preset control class by calling the member function;
and under the condition that the preset control class to be verified contains the member variable, changing the setting of the preset control class by modifying the member variable.
6. The method of claim 1 or 2, wherein the method further comprises:
and loading a touch control class library containing each preset control class into a system memory in response to a detection result that a preset input window is loaded in the user interface or in response to a detection result that the touch pen is activated.
7. The method of claim 6, wherein the method further comprises:
acquiring a responder view of a user interface of a currently running target application;
querying the responder view;
determining that the stylus control class library is loaded in a process of the target application if the stylus control class library exists in the responder view.
8. The method of claim 1 or 2, wherein the code compiling the target control class according to the control instruction to achieve control of a target function of the stylus comprises:
writing a control instruction code of the target control class according to the control instruction, the mapping relation among the preset touch pen functions and the preset control classes;
compiling the control instruction codes in the target application to realize control over target functions of the stylus;
wherein the control instruction code of the target control class is written in the following way:
modifying the member variable according to the control instruction under the condition that the target control class contains the member variable, or acquiring a modified value corresponding to the member variable from other processes according to the control instruction, and modifying the member variable according to the modified value;
and under the condition that the target control class contains member functions, calling the member functions according to the control instruction.
9. A control processing apparatus of a stylus function, comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for responding to the control operation of a user on a touch pen in a target application and acquiring a control instruction, and the control instruction is used for indicating the control of the target function of the touch pen in the target application;
the determining module is used for determining a target control class corresponding to the target function according to the mapping relation between each preset touch control pen function and each preset control class;
and the compiling module is used for compiling codes of the target control classes according to the control instructions so as to control the target functions of the touch pen.
10. An electronic device, comprising:
a processor; and
a memory for storing a program, wherein the program is stored in the memory,
wherein the program comprises instructions which, when executed by the processor, cause the processor to carry out the method according to any one of claims 1-8.
11. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1-8.
CN202210002777.6A 2022-01-05 2022-01-05 Stylus control method and device, electronic equipment and storage medium Active CN114020164B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210002777.6A CN114020164B (en) 2022-01-05 2022-01-05 Stylus control method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210002777.6A CN114020164B (en) 2022-01-05 2022-01-05 Stylus control method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114020164A true CN114020164A (en) 2022-02-08
CN114020164B CN114020164B (en) 2022-04-15

Family

ID=80069265

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210002777.6A Active CN114020164B (en) 2022-01-05 2022-01-05 Stylus control method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114020164B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150029162A1 (en) * 2013-07-24 2015-01-29 FiftyThree, Inc Methods and apparatus for providing universal stylus device with functionalities
CN111045566A (en) * 2019-12-11 2020-04-21 上海传英信息技术有限公司 Stylus pen, terminal, control method thereof, and computer-readable storage medium
CN111949146A (en) * 2020-08-13 2020-11-17 深圳传音控股股份有限公司 Shortcut function calling method and device for touch pen, touch pen and storage medium
CN112764561A (en) * 2021-01-22 2021-05-07 维沃移动通信有限公司 Electronic equipment control method and device and electronic equipment
CN113238649A (en) * 2021-03-15 2021-08-10 荣耀终端有限公司 Control method and device based on touch control pen
CN113741727A (en) * 2021-08-05 2021-12-03 青岛海信商用显示股份有限公司 Touch display device and control method thereof

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150029162A1 (en) * 2013-07-24 2015-01-29 FiftyThree, Inc Methods and apparatus for providing universal stylus device with functionalities
CN111045566A (en) * 2019-12-11 2020-04-21 上海传英信息技术有限公司 Stylus pen, terminal, control method thereof, and computer-readable storage medium
CN111949146A (en) * 2020-08-13 2020-11-17 深圳传音控股股份有限公司 Shortcut function calling method and device for touch pen, touch pen and storage medium
CN112764561A (en) * 2021-01-22 2021-05-07 维沃移动通信有限公司 Electronic equipment control method and device and electronic equipment
CN113238649A (en) * 2021-03-15 2021-08-10 荣耀终端有限公司 Control method and device based on touch control pen
CN113268174A (en) * 2021-03-15 2021-08-17 荣耀终端有限公司 Function control method and system
CN113741727A (en) * 2021-08-05 2021-12-03 青岛海信商用显示股份有限公司 Touch display device and control method thereof

Also Published As

Publication number Publication date
CN114020164B (en) 2022-04-15

Similar Documents

Publication Publication Date Title
US20180173614A1 (en) Technologies for device independent automated application testing
CN109034394B (en) Updating method and device of machine learning model
CN108037888B (en) Skill control method, skill control device, electronic equipment and storage medium
CN106844181B (en) Method, system and mobile terminal for recording user behavior
US9544399B2 (en) Visually depicting cloud resource utilization during execution of an application
CN103984626A (en) Method and device for generating test-case script
CN112465466B (en) Method, device, computer equipment and storage medium for executing flow task
CN108170425B (en) Program code modification method and device and terminal equipment
CN111723002A (en) Code debugging method and device, electronic equipment and storage medium
CN104063071A (en) Content input method and device
CN113934630A (en) Software testing method, device, equipment and medium based on image recognition
CN104267867A (en) Content input method and device
CN116483246A (en) Input control method and device, electronic equipment and storage medium
WO2022100033A1 (en) Method and apparatus for debugging applet, electronic device and storage medium
CN113821433A (en) Method, device, equipment, medium and product for testing cloud mobile phone application program
CN112817582A (en) Code processing method and device, computer equipment and storage medium
CN114020164B (en) Stylus control method and device, electronic equipment and storage medium
CN110248023B (en) Intelligent terminal control method, device, equipment and medium
US11550693B2 (en) Data logger for a real-time robotic control system
CN104407763A (en) Content input method and system
CN110465093B (en) Method and device for analyzing inclusion redundant resources based on Unity
CN114020623A (en) Software testing method, device, equipment and medium based on intelligent identification
CN112100018B (en) Log information generation method and related device
CN111382416B (en) Application program operation identification method and device, terminal equipment and storage medium
CN110968519A (en) Game testing method, device, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant