Control method, handwriting pen, device, electronic equipment and storage medium

CN119440273APending Publication Date: 2025-02-14BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310952488.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In the prior art, when supporting the screen projection of electronic devices of other operating systems, physical laser pens and digital laser pens are unavailable, resulting in poor user experience.

Method used

By setting physical buttons on the stylus and combining a processing module and a wireless transmission module, remote control operations of electronic devices are realized, including virtual laser display and remote shooting.

Benefits of technology

It realizes that virtual laser function and remote shooting control are provided without relying on physical laser pens, improving the user's screen projection demonstration and remote shooting experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440273A_ABST
    Figure CN119440273A_ABST
Patent Text Reader

Abstract

The invention relates to a control method, a handwriting pen, a device, electronic equipment and a storage medium. The control method comprises the following steps: receiving a key event sent by a handwriting pen; determining a pressing type according to the key pressing event; determining a control operation corresponding to the pressing type; executing the control operation; wherein different pressing types correspond to different control operations. According to the control method, remote control operation on the electronic equipment can be achieved through the keys on the handwriting pen, diversity of the control operation can be achieved through the pressing types of the keys, in addition, the control operation is not limited by an operation system and a projection mode, and the use experience of a user can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a control method, a stylus, a device, an electronic device and a storage medium. Background Art

[0002] Common peripheral input devices for electronic devices include laser pens and styluses. Laser pens can point to any place on the projected image to assist in presentation, while styluses can input into electronic devices through handwriting mode. Laser pens mainly come in two forms: physical lasers and digital lasers. Physical lasers emit real light and shine it onto the screen of the projector, while digital lasers simulate lasers by displaying light spots on the display. The handwriting mode of the stylus mainly implements input operations through screen touch.

[0003] As users' demands for user experience gradually increase, there is a need to continuously improve peripheral input devices and electronic devices. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present disclosure provides a control method, a stylus, a device, an electronic device and a storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a control method is provided, the method comprising:

[0006] Receive key events sent by the stylus;

[0007] Determine a pressing type according to the key event;

[0008] Determining a control operation corresponding to the pressing type;

[0009] executing the control operation;

[0010] Among them, different pressing types correspond to different control operations.

[0011] In an exemplary embodiment, determining the control operation corresponding to the pressing type includes:

[0012] Determine a control operation corresponding to the pressing type according to at least one of the following parameters of the foreground application and the pressing type:

[0013] Application type;

[0014] The function of the current interface;

[0015] The running status of the function of the current interface.

[0016] In an exemplary embodiment, when the application types of the foreground application are different, the same press type corresponds to different control operations; and / or when the functions of the current page of the foreground application are different, the same press type corresponds to different control operations.

[0017] In an exemplary embodiment, when the pressing type is the first type, the control operation corresponding to the first type is: performing a drawing operation on the display interface.

[0018] In an exemplary embodiment, performing a drawing operation on a display interface includes: performing a drawing operation on the display interface in a current drawing mode or a default drawing mode; wherein the current drawing mode is a drawing mode after switching the drawing mode; or, the current drawing mode is an initial drawing mode when the drawing mode has not been switched.

[0019] In an exemplary embodiment, the method further comprises: receiving a mouse movement event sent by the stylus;

[0020] The performing of the drawing operation on the display interface includes: performing the drawing operation on the display interface according to the product information of the stylus pen and the mouse movement event.

[0021] In an exemplary embodiment, performing a drawing operation on a display interface according to the product information of the stylus pen and the mouse movement event includes:

[0022] Determining, according to the product information of the stylus pen, that the stylus pen has a virtual laser function;

[0023] Modify the event type of the mouse movement event from a mouse cursor type to a virtual laser type;

[0024] A drawing operation is performed on the display interface according to the mouse movement event.

[0025] In an exemplary embodiment, performing a drawing operation on a display interface according to the mouse movement event includes:

[0026] Obtaining position movement information in the mouse movement event;

[0027] Invoking laser cursor processing logic corresponding to the virtual laser type;

[0028] A drawing operation is performed on the display interface according to the position movement information through laser cursor processing logic.

[0029] In an exemplary embodiment, performing a drawing operation on a display interface according to the position movement information includes:

[0030] In the drawing window, calling the laser sight, and using the laser sight to draw according to the position movement information;

[0031] Wherein, the laser field of view supports drawing a cursor position or drawing a cursor trajectory.

[0032] In an exemplary embodiment, when the pressing type is the second type, the control operation corresponding to the second type is: switching the drawing mode.

[0033] In an exemplary embodiment, the drawing mode is a first mode or a second mode; wherein the first mode is a mode for drawing a cursor position, and the second mode is a mode for drawing a cursor track.

[0034] In an exemplary embodiment, when the pressing type is the third type and the current drawing mode is the second mode, the control operation corresponding to the third type is: clearing the drawing traces in the second mode, wherein the second mode is a mode for drawing cursor tracks.

[0035] In an exemplary embodiment, when the program type of the application program running in the foreground is a shooting type and the function of the current interface of the application program running in the foreground is a photo taking function, the control operation is: single shooting or continuous shooting.

[0036] In an exemplary embodiment, when the pressing type is the fourth type, the control operation corresponding to the fourth type is single tap; or

[0037] When the pressing type is the fifth type, the control operation corresponding to the fifth type is continuous shooting;

[0038] Among them, the fourth type and the fifth type are different.

[0039] In an exemplary embodiment, when the pressing type is a long pressing type, the control operation is: starting continuous shooting at the start time of the key event, and stopping continuous shooting at the end time of the key event.

[0040] In an exemplary embodiment, when the program type of the application program running in the foreground is a shooting type and the function of the current interface of the application program running in the foreground is a video recording function,

[0041] The running state of the function of the current interface is that the video recording has not started, and when the pressing type is the sixth type, the control operation is to start the video recording;

[0042] When the running state of the function of the current interface is that recording has started, and the pressing type is the seventh type, the control operation is to stop recording;

[0043] The sixth type and the seventh type are the same or different.

[0044] In an exemplary embodiment, the program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a recording function, the running state of the function of the current interface is that recording has not started, and when the pressing type is a long pressing type, the control operation is: start recording at the start time of the key event, and stop recording at the end time of the key event.

[0045] According to a second aspect of an embodiment of the present disclosure, there is provided a stylus pen, comprising a pen body, including: a first physical button arranged on the pen body, a processing module and a wireless transmission module;

[0046] The first physical button is used to: receive a pressing input operation;

[0047] The processing module is used to: generate a key event according to the pressing input operation;

[0048] The wireless transmission module is used to send the key event.

[0049] In an exemplary embodiment, the stylus pen further includes at least one of a second physical button and a third physical button disposed on the pen body;

[0050] Among them, the second physical button is used for the screenshot function, and the third physical button is used for the shorthand function.

[0051] In an exemplary embodiment, the stylus further comprises: a displacement sensor electrically connected to the processing module;

[0052] The displacement sensor is used to: collect displacement sensing data;

[0053] The processing module is used to: generate a mouse movement event according to the displacement sensing data;

[0054] The wireless transmission module is used to send the mouse movement event.

[0055] In an exemplary embodiment, the processing module is further configured to: generate a mouse movement event according to the displacement sensing data when the pressing type of the pressing input operation is a first type.

[0056] According to a third aspect of an embodiment of the present disclosure, a control method using the stylus is provided, including:

[0057] receiving a pressing input operation on the first physical key;

[0058] Generate a key event according to the pressing input operation;

[0059] Send the key event.

[0060] In an exemplary embodiment, the control method further includes:

[0061] Collect displacement sensor data;

[0062] Generate a mouse movement event according to the displacement sensing data;

[0063] Sends the mouse move event.

[0064] In an exemplary embodiment, generating a mouse movement event according to the displacement sensing data includes:

[0065] When the pressing type of the pressing input operation is a first type, a mouse movement event is generated according to the displacement sensing data.

[0066] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0067] A receiving module, configured to receive a key event sent by the stylus;

[0068] The processing module is configured to determine a pressing type according to the key event; determine a control operation corresponding to the pressing type, and execute the control operation corresponding to the pressing type; wherein different pressing types correspond to different control operations.

[0069] According to a fifth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0070] processor;

[0071] a memory for storing processor-executable instructions;

[0072] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure, or to execute the method as described in the third aspect of the embodiment of the present disclosure.

[0073] According to the sixth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect of the embodiment of the present disclosure, or to execute the method described in the third aspect of the embodiment of the present disclosure.

[0074] The above method disclosed in the present invention has the following beneficial effects: realizing remote control operation controlled by a stylus pen. On the one hand, by modifying the framework layer of the operating system, other operating systems (such as Android) other than the operating system that matches the virtual laser pen (such as Windows / MAC) can also realize the virtual laser function, so that virtual laser display can be realized without the help of a laser pen; it overcomes the problem that both physical laser pens and digital laser pens cannot be used when projecting the screen to a large screen or through a projector through electronic devices that support other operating systems (such as Android), improves the office efficiency of users who use electronic devices that support other operating systems (such as Android), and improves the user experience of screen projection demonstration. On the other hand, realizing remote shooting controlled by a stylus pen can improve the user experience of remote shooting. On the other hand, different remote control operations can be realized through different pressing types, which can achieve diversity in remote control operations.

[0075] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0077] Figure 1 is a schematic diagram of a stylus according to an exemplary embodiment;

[0078] Figure 2 is a schematic diagram of a stylus according to an exemplary embodiment;

[0079] Figure 3 is a schematic diagram of a stylus according to an exemplary embodiment;

[0080] Figure 4 is a flow chart of a control method according to an exemplary embodiment;

[0081] Figure 5 is a flow chart of a control method according to an exemplary embodiment;

[0082] Figure 6 is a flow chart of key event transmission according to an exemplary embodiment;

[0083] Fig. 7A is a schematic diagram showing a drawing cursor position according to an exemplary embodiment;

[0084] Figure 7B is a schematic diagram of drawing a cursor track according to an exemplary embodiment;

[0085] Figure 7C is a schematic diagram of a fourth operation according to an exemplary embodiment;

[0086] Fig.7D is a schematic diagram of starting video recording according to an exemplary embodiment;

[0087] Fig. 7E is a schematic diagram of ending a video recording according to an exemplary embodiment;

[0088] Figure 8 is a flow chart of a control method according to an exemplary embodiment;

[0089] Fig. 9 is a flow chart of transmitting a mouse movement event according to an exemplary embodiment;

[0090] Fig.10 is a flow chart of a control method according to an exemplary embodiment;

[0091] Fig.11 is a flow chart of a control method according to an exemplary embodiment;

[0092] Fig.12 is a flow chart of a control method according to an exemplary embodiment;

[0093] Fig.13 is a flow chart of a control method according to an exemplary embodiment;

[0094] Fig.14 is a block diagram of an electronic device according to an exemplary embodiment;

[0095] Fig.15 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0096] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0097] A laser pen uses physical lasers, and its disadvantages include: it needs to use a projector. Because the physical laser of the laser pen will be absorbed by the display screen, the physical laser cannot be displayed on the display screen, and the display effect is poor, so the laser pen needs to be connected to the projector and operated on the projected screen of the projector.

[0098] Another laser pointer uses a digital laser, which has the following disadvantages: additional software needs to be installed to display the light spot, and it is only supported on operating systems (such as Windows / MAC).

[0099] When using a stylus that only supports handwriting function, it is impossible to remotely control the electronic device during projection.

[0100] Therefore, when an electronic device uses an operating system other than an operating system (such as an Android operating system) (such as Windows / MAC) and projects the screen to a larger screen, the laser pen using a physical laser, the laser pen using a digital laser, and the stylus pen that only supports handwriting function cannot complete the function of visual indication.

[0101] In an exemplary embodiment of the present disclosure, a new physical button is provided on the stylus.

[0102] In one embodiment, Figure 1 As shown, the body of the stylus pen includes a physical button 101 for receiving a press input operation to implement remote control operations on electronic devices. The physical button 101 can be named a focus button, a smart button, a remote button, a remote control button, or the like.

[0103] Figure 1 The physical button 101 is arranged on the pen body near the pen cap end. The position of the first physical button 101 on the pen body is not limited to Figure 1 In the case shown, except Figure 1 The position near the pen cap end is shown, and the first physical button 101 can also be set on the pen body near the pen tip, or in the middle of the pen body, or in other possible positions on the pen body.

[0104] In one embodiment, Figure 2 As shown, the body of the stylus pen includes three physical buttons, which include: a first physical button 201, a second physical button 202, and a third physical button 203; wherein the first physical button 201 is used to receive a press input operation to implement remote control operations on the electronic device, the second physical button 202 is used for a screenshot function, and the third physical button 203 is used for a shorthand function, or the second physical button 202 is used for a shorthand function, and the third physical button 203 is used for a screenshot function.

[0105] Figure 2 The three physical buttons are arranged on the pen body near the pen cap end. The positions of the three physical buttons on the pen body are not limited to Figure 2 In the case shown, except Figure 2The three physical buttons can be arranged at the position near the pen tip, the middle position, or other possible positions on the pen body. The three physical buttons can also be arranged at the position near the pen tip, the middle position, and the position near the pen cap on the pen body. In short, the three physical buttons can be arranged at various possible positions on the pen body. When the stylus has multiple sides, some of the three physical buttons and other physical buttons can be arranged at different sides of the stylus. For example, the three physical buttons are arranged at three different sides of the stylus.

[0106] In some possible implementations, the body of the stylus pen includes two physical buttons, and the two physical buttons include: a first physical button 201 and a second physical button 202, or the two physical buttons include: a first physical button 201 and a third physical button 203. The two physical buttons can be set at a position close to the pen cap end of the pen body, or at a middle position on the pen body, or at other possible positions on the pen body. The two physical buttons can also be respectively set at two positions of the position close to the pen tip, the middle position, and the position close to the pen cap end on the pen body. In short, the two physical buttons can be set at various possible positions on the pen body. When the stylus pen has multiple sides, one physical button and the other physical button of the two physical buttons can be respectively set at different sides of the stylus pen. For example, the two physical buttons are respectively set at two different sides of the stylus pen.

[0107] In some possible implementations, a processing module 204 and a wireless transmission module 205 are further provided in the body of the stylus. The first physical key 201 is used to receive a press input operation; the processing module 204 is used to generate a key event according to the press input operation; and the wireless transmission module 205 is used to send a key event. The processing module 204 may be a central processing module, for example, the processing module 204 is a central processing chip; the wireless transmission module 205 may be a short-range wireless communication module, for example, the wireless transmission module 205 may be a high-fidelity wireless communication (Wireless Fidelity, Wi-Fi) module, a Bluetooth module, an infrared module, a near field communication (Near Field Communication, NFC) module, a ZigBee module, or other short-range communication modules.

[0108] In some possible implementations, such as Figure 3 As shown, a displacement sensor 206 is also provided in the body of the stylus pen for collecting displacement sensing data. The displacement sensor may include a gyroscope and / or a gravity sensor, so that the stylus pen can be equivalent to a mouse device (also called an air mouse device) for the electronic device.

[0109] In some possible implementations, the processing module 204 is used to generate a mouse movement event according to the displacement sensing data; and the wireless transmission module 205 is used to send the mouse movement event.

[0110] In some possible implementations, the processing module 204 is further configured to: when the pressing type of the pressing input operation is the first type, generate a mouse movement event according to the displacement sensing data.

[0111] In some possible implementations, the processing module 204, the wireless transmission module 205 and the displacement sensor 206 are all disposed inside the stylus, and their distribution locations are not limited to Figure 3 The positions shown can be set at various possible positions inside the stylus.

[0112] In the above embodiment, the stylus pen has the function of remotely controlling the electronic device in addition to the handwriting input function. The remote control function can be to assist the electronic device in realizing a virtual laser show, which can be called the stylus pen having a virtual laser function. The remote control function can also be to control the shooting of the electronic device, which can be called the stylus pen having a remote shooting control function.

[0113] In an exemplary embodiment of the present disclosure, a control method is provided, which is applied to a stylus. In some possible embodiments, the stylus can be paired with an electronic device for connection, and the paired connection can be a wireless connection or a wired connection. Figure 4 is a flow chart of a control method according to an exemplary embodiment. Figure 4 As shown, the following steps are included:

[0114] Step S401, receiving a pressing input operation.

[0115] In some possible implementations, the press input operation is a press input operation on a first physical button on the stylus.

[0116] Step S402: Generate a key event according to the pressing input operation.

[0117] In some possible implementations, different key events are generated according to the pressing type of the pressing input operation.

[0118] For example, when the press input operation is a long press, a key event with a press type of a long press is generated;

[0119] For another example, when the pressing input operation is a single click, a key event with a pressing type of single click is generated;

[0120] For another example, when the pressing input operation is a double-click, a key event with a pressing type of double-click is generated.

[0121] For another example, when the pressing input operation is triple-clicking, a key event with a pressing type of triple-clicking is generated.

[0122] The pressing type can also be a combo of more than three times.

[0123] Step S403: Send a key event.

[0124] In some possible implementations, the key events are sent via a wireless connection between the stylus pen and the electronic device.

[0125] Optionally, the wireless connection may be a short-distance communication connection, for example, a Wi-Fi connection, a Bluetooth connection, an infrared connection, an NFC connection, or a ZigBee connection.

[0126] In some possible implementations, the key events are used to remotely control the electronic device to perform control operations.

[0127] In some possible implementations, the stylus further collects displacement sensing data, generates a mouse movement event according to the displacement sensing data, and sends the mouse movement event.

[0128] Optionally, the stylus continuously sends mouse movement events, so that the electronic device can obtain the mouse movement events at any time and apply the mouse movement events to other reasonable aspects.

[0129] Optionally, the stylus generates a mouse movement event and sends the mouse movement event according to the displacement sensing data only when the pressing type of the pressing input operation is the first type, which can save the power consumption of the stylus.

[0130] In this embodiment, the remote control operation of the electronic device is realized through the physical buttons on the stylus, so that the stylus has both handwriting input function and remote control function, which expands the function of the stylus, increases the richness of the function of the stylus, improves the work efficiency of the user in using the electronic device, and enables the electronic device to be better used in various different scenarios, especially in the projection and shooting scenarios, and is also conducive to helping the electronic device reduce the number of peripheral input devices.

[0131] On the one hand, it can assist electronic devices in realizing virtual laser display. It can be said that the stylus has a virtual laser function, which assists electronic devices in completing the visual indication function of the virtual laser and can enhance the user's experience of screen projection demonstration.

[0132] On the other hand, the shooting of the electronic device can be controlled, which can be called the stylus having a remote shooting control function, which assists the electronic device to complete the remote shooting control and can enhance the user's remote shooting experience.

[0133] On the other hand, by corresponding different remote control operations to different pressing types of physical buttons, the diversity of remote control operations on the electronic device can be achieved.

[0134] In an exemplary embodiment of the present disclosure, a control method is provided, which is applied to an electronic device. In some possible embodiments, the electronic device is a mobile phone device or a tablet device with a terminal operating system, and the terminal operating system is an Android operating system or an IOS operating system. The electronic device can be connected to a display device or a projection device through a wired connection or a wireless connection. Figure 5 is a flow chart of a control method according to an exemplary embodiment. Figure 5 As shown, the following steps are included:

[0135] Step S501: receiving a key event sent by a stylus.

[0136] In some possible implementations, the key events sent by the stylus are received via a wireless connection.

[0137] Optionally, the wireless connection may be a short-distance communication connection, for example, a Wi-Fi connection, a Bluetooth connection, an infrared connection, an NFC connection, or a ZigBee connection.

[0138] In some possible implementations, the key events sent by the stylus are received via a wired connection.

[0139] In some possible implementations, the electronic device receives a key event sent by the stylus when playing a presentation file on a display screen.

[0140] Optionally, the presentation file may be a type of multimedia file.

[0141] For example, a presentation file can be a text file, an image file, or a video file.

[0142] The format of the text file can be: text file (TXT) format, presentation (PowerPoint, PPT) format, Microsoft Word file format, portable document format (PDF) format, etc.

[0143] The format of the image file may be: graphics interchange format (GIF), joint photographic experts group (JPEG) format, portable network graphics (PNG) format, etc.

[0144] The format of the video file can be: Audio Video Interleaved (AVI) format, Moving Picture Expert Group (MPEG) format, Flash Video (FLV) format, Windows Media Video (WMV) format, RealMedia variable bit rate (RMVB) format, etc.

[0145] In some possible embodiments, the electronic device receives a key event sent by the stylus when displaying an interface of a shooting type application on a display screen. For example, the shooting type application may be a camera application.

[0146] In some possible implementations, when the software framework layer (eg, Framwork layer) of the electronic device implements step S501, Figure 6 As shown, the InputReader module detects the input event and passes the input event to the InputDispatcher module, and the InputDispatcher module recognizes the input event as a key event.

[0147] Step S502: determine the pressing type according to the key event.

[0148] In some possible embodiments, different key events correspond to different pressing types.

[0149] In some possible implementations, when the software framework layer (i.e., the Framwork layer) of the electronic device implements step S501, Figure 6 As shown, after the InputDispatcher module recognizes the key event, it sends the key event to the PhoneWindowManager module, and the PhoneWindowManager module sends the key event to the LaserPointerController module. The LaserPointerController module obtains the state information of the key event, which includes the pressing type of the key event.

[0150] Step S503: determine the control operation corresponding to the pressing type.

[0151] In some possible implementations, different pressing types correspond to different control operations.

[0152] There are many ways to determine the control operation corresponding to the pressing type in step S503, and five determination methods are described below.

[0153] The first way to determine:

[0154] In some possible implementations, when the electronic device only runs non-shooting type applications, or when the program type of the application running in the foreground is non-shooting type, when the pressing type is the first type, the control operation corresponding to the pressing type is determined to be the first operation, and the first operation is: performing a drawing operation on the display interface.

[0155] In one example, the first type is long press, and the first operation is: performing a drawing operation on the display interface during the long press. Optionally, the first operation is: starting the drawing operation at the start time of the key event corresponding to the long press; and stopping the drawing operation at the end time of the key event corresponding to the long press.

[0156] In some possible implementations, performing a drawing operation on the display interface includes: performing a drawing operation on the display interface in a current drawing mode or a default drawing mode.

[0157] Optionally, the drawing mode is a first mode, a second mode or a third mode, wherein the first mode is a mode for drawing a cursor position, the second mode is a mode for drawing a cursor track, and the third mode is a drawing mode other than the first mode and the second mode for assisting demonstration. Optionally, the first mode may be called a laser mode, and the second mode may be called a brush mode.

[0158] Optionally, when drawing in the first mode, an icon may be displayed at the current cursor position on the display interface. The icon may be a different pattern. The pattern may be as follows: Fig. 7A The red origin 701 shown simulates a laser point, and may also be an arrow, a regular shape, or an irregular personalized shape.

[0159] Optionally, when drawing in the second mode, the following may be displayed on the display interface: Figure 7B The brush trace 702 shown includes the historical track of the cursor.

[0160] In some possible implementations, the current drawing mode is an initial drawing mode when the drawing mode has not been switched.

[0161] For example, the current drawing mode is the initial drawing mode after the electronic device is turned on or restarted and a connection is established with the stylus for the first time.

[0162] In some possible implementations, the current drawing mode is the drawing mode after the drawing mode is switched.

[0163] For example: after the electronic device switches from the first mode to the second mode, the current drawing mode is the second mode.

[0164] In some possible implementations, a default drawing mode may be preset in the electronic device, and the user may modify the default drawing mode as needed. The default drawing mode may be the first mode, the second mode, or the third mode.

[0165] In some possible implementations, when the first type is a long press, the first operation includes not only: performing a drawing operation on the display interface, but also: setting the virtual laser function to an on state at the start time of the key event, and setting the virtual laser function to an off state at the end time of the key event.

[0166] Optionally, when the virtual laser function is turned on, first indication information is displayed on the display interface, and the first indication information is used to indicate that the virtual laser function is turned on. For example, the display interface includes an indicator light, and when the color of the indicator light is a first color, it indicates that the virtual laser function is turned on.

[0167] When the virtual laser function is in the off state, the second indication information is displayed on the display interface, and the second indication information is used to indicate that the virtual laser function is turned on. For example, the display interface includes an indicator light, and when the color of the indicator light is the second color, it indicates that the virtual laser function is turned off.

[0168] The second way to determine:

[0169] In some possible implementations, when the electronic device only runs non-shooting type applications, or when the program type of the application running in the foreground is non-shooting type, when the pressing type is the second type, the control operation corresponding to the pressing type is determined to be the second operation, and the second operation is: switching the drawing mode.

[0170] In one example, the second type is a single click.

[0171] In some possible implementations, the drawing mode is a first mode or a second mode, wherein the first mode is a mode for drawing a cursor position, and the second mode is a mode for drawing a cursor track.

[0172] Optionally, before receiving the press event, when a drawing mode has been turned on, the switching of the drawing mode in the second operation is: switching from the current drawing mode to another drawing mode.

[0173] For example, when the current drawing mode is the first mode and the pressing type is the second type, the second operation is: switching from the first mode to the second mode.

[0174] Optionally, before receiving the pressing event, when no drawing mode is enabled, the switching of the drawing mode in the second operation is: enabling a drawing mode, which may be a default drawing mode.

[0175] For example, the default drawing mode is the second mode. Before receiving the press event, when no drawing mode is enabled, and when the press type is the second type, the second operation is to enable the second mode.

[0176] The third way to determine:

[0177] In some possible implementations, when the pressing type is the third type and the current drawing mode is the second mode, the control operation corresponding to the third type is the third operation, and the third operation is: clearing the drawing traces in the second mode, wherein the second mode is a mode for drawing cursor tracks.

[0178] The fourth way to determine:

[0179] In some possible implementations, in a scenario where the program type of the application running in the foreground is a shooting type, and the function of the current interface of the application running in the foreground is a photo taking function, the control operation is determined to be the fourth operation, and the fourth operation is: single shooting, or continuous shooting.

[0180] In some possible embodiments, single shooting can be replaced by: single shooting, shooting a single picture, shooting a picture. Continuous shooting can be replaced by: continuous shooting, shooting multiple pictures continuously, shooting continuously at a first time interval, shooting multiple pictures continuously at a first time interval. The first time interval is a default value in the shooting type application in the electronic device, and the user can adjust the value according to the use needs.

[0181] In some possible implementations, when the program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a photo taking function, and the pressing type is the fourth type, the control operation is determined to be a single shot. The fourth type may be a single click, or a double click.

[0182] The program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a photo taking function, and when the pressing type is the fifth type, the control operation is determined to be continuous shooting. The fifth type is different from the fourth type.

[0183] For example: when the fourth type is single click, the fifth type is double click. Figure 7C As shown in FIG, single-clicking the stylus button performs a single-shot operation, and double-clicking the stylus button performs a continuous-shot operation. The fourth type is double-clicking, and the fifth type is single-clicking. Figure 7C As shown, double-click the stylus button to perform a single-shot operation, and single-click the stylus button to perform a continuous-shot operation.

[0184] In some possible implementations, in a scenario where the program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a photo taking function, and when the pressing type is a long pressing type, the control operation is determined as: starting continuous shooting at the start time of the key event and stopping continuous shooting at the end time of the key event.

[0185] In this embodiment, the user can control the duration of continuous shooting by long pressing. When more photos need to be taken, the user can control the duration of long pressing to be longer, such as 3 seconds, 5 seconds or 10 seconds. When fewer photos need to be taken, the user can control the duration of long pressing to be shorter, such as 1 second or 2 seconds. This can meet the needs of users to control the duration of continuous shooting as needed.

[0186] The fifth way to determine:

[0187] In some possible embodiments, when the program type of the application running in the foreground is a shooting type, and the function of the current interface of the application running in the foreground is a recording function, the running status of the function of the current interface is that the recording has not started, and when the pressing type is the sixth type, the control operation is determined to be: start recording.

[0188] In one example, the sixth type is a single click or a double click.

[0189] In some possible embodiments, when the program type of the application running in the foreground is a shooting type, and the function of the current interface of the application running in the foreground is a recording function, the running status of the function of the current interface is that the recording has not started, and when the pressing type is the seventh type, the control operation is: stop recording.

[0190] Optionally, the seventh type is the same as the sixth type; for example, when the sixth type is single click, Fig.7D As shown, click the stylus button to start recording. The seventh type is also single click. Fig. 7E As shown in the figure, during the video recording, click the button of the stylus pen to stop the video recording.

[0191] Optionally, the seventh type is different from the sixth type; for example, when the sixth type is single click, Fig.7D As shown, single-click the stylus button to start recording. The seventh type is double-clicking. Fig. 7E As shown in the figure, during the video recording, double-click the button of the stylus to stop the video recording.

[0192] In some possible implementations, when the program type of the application running in the foreground is a shooting type, and the function of the current interface of the application running in the foreground is a recording function, the running status of the function of the current interface is that the recording has not started, and when the pressing type is a long pressing type, the recording starts at the start time of the key event and stops at the end time of the key event.

[0193] In this embodiment, the user can control the duration of the video by long pressing. When a longer video needs to be recorded, the user can control the duration of the long press to be longer, such as 3 seconds, 5 seconds or 10 seconds. When a shorter video needs to be recorded, the user can control the duration of the long press to be shorter, such as 1 second or 2 seconds. This can meet the user's need to control the recording duration as needed.

[0194] Step S504, executing control operation.

[0195] In some possible embodiments, the control operation in step S503 and step S504 is to perform a drawing operation in the second mode, and after step S504, the method further includes: when a touch operation on the display screen is received, clearing the drawing track in the second mode in response to the touch operation.

[0196] In the disclosed embodiments, remote control operations controlled by a stylus pen are implemented. On the one hand, by modifying the framework layer of the operating system, other operating systems (such as Android) other than the operating system that matches the virtual laser pen (such as Windows / MAC) can also implement the virtual laser function, so that virtual laser display can be achieved without the help of a laser pen; the problem that both physical laser pens and digital laser pens cannot be used when projecting the screen to a large screen or through a projector through electronic devices that support other operating systems (such as Android) is overcome, thereby improving the office efficiency of users who use electronic devices that support other operating systems (such as Android) and improving the user experience of screen projection demonstrations. On the other hand, remote shooting controlled by a stylus pen can improve the user experience of remote shooting. On the other hand, different remote control operations can be achieved through different press types, which can achieve diversity in remote control operations.

[0197] In an exemplary embodiment of the present disclosure, a control method is provided, which is applied to an electronic device. Figure 8 is a flow chart of a control method according to an exemplary embodiment. Figure 8 As shown, the control method includes:

[0198] Step S801, receiving a key event sent by a stylus.

[0199] Step S801 is identical to step S501 and will not be described again.

[0200] Step S802: Determine the pressing type according to the key event.

[0201] The content of step S802 is the same as that of step S502 and will not be repeated here.

[0202] Step S803: determine the control operation corresponding to the pressing type.

[0203] Step S803 is identical to step S503 and will not be described again.

[0204] Step S804, executing control operation.

[0205] The content of the control operation executed in step S804 includes the content of the control operation executed in step S504.

[0206] The control method further includes: in the process from step S801 to step S804, step S805 is executed in parallel with step S801 to step S804, and step S805 is: receiving a mouse movement event sent by the stylus.

[0207] Optionally, in step S805, the mouse movement event sent by the stylus is continuously received at a second time interval.

[0208] In some possible embodiments, steps S501 to S504 are executed in a first process, and step S805 is executed in a second process, wherein the first process and the second process are executed in parallel.

[0209] In step S804, when the executed control operation is the first operation (the first operation is executing a drawing operation on the display interface), executing a drawing operation on the display interface includes: executing a drawing operation on the display interface according to the product information of the stylus pen and the mouse movement event.

[0210] In one embodiment, a drawing operation is performed on a display interface according to product information of a stylus pen and a mouse movement event, including the following steps S1, S2, and S3, wherein:

[0211] Step S1: According to the product information of the stylus pen, it is determined that the stylus pen has a virtual laser function.

[0212] In one embodiment, the product information of the stylus pen includes information such as the device manufacturer and the product number that can uniquely identify the stylus pen. A condition for determining that the stylus pen has a virtual laser function is preconfigured in the electronic device, and the condition is that the product information indicates that the device manufacturer is a known manufacturer, and the product number is greater than a set value. After the electronic device obtains the product information of the stylus pen, if the product information meets the preset conditions, it is determined that the stylus pen has a virtual laser function, otherwise, it is determined that the stylus pen does not have a virtual laser function.

[0213] It should be noted that after determining that the stylus pen has a virtual laser function, the virtual laser function can be turned on in the setting function control of the electronic device. Optionally, a switch button for turning on the virtual laser function of the stylus pen is set in the system setting of the electronic device.

[0214] Step S2: modifying the event type of the mouse movement event from the mouse cursor type to the virtual laser type;

[0215] In some embodiments, Fig. 9 is a flow chart of transmitting a mouse movement event according to an exemplary embodiment. Fig. 9 As shown, in the software framework layer of the electronic device, the InputReader module monitors input events, and when the input event is identified as a mouse movement event, the mouse movement event is sent to the CursorInputMapper module. The movement information in the mouse movement event is obtained through the CursorInputMapper module, and the movement information includes: the event type of the mouse movement event, the real-time position of the cursor, the display mode of the cursor, etc., wherein the display mode of the cursor includes the fade-in (fade) and the fade-out (unfade) of the cursor, etc. The PointerController module changes the event type of the mouse movement event in the movement information from the mouse cursor type to the virtual laser type, and then sends the movement information to the LaserPointerController module.

[0216] Step S3: Execute a drawing operation on the display interface according to the mouse movement event.

[0217] In some embodiments, step 3 comprises:

[0218] Step S3-1: Obtain the position movement information in the mouse movement event.

[0219] Step S3-2: calling the laser cursor processing logic corresponding to the virtual laser type, and performing a drawing operation on the display interface according to the position movement information through the laser cursor processing logic.

[0220] In some possible embodiments, when the current drawing mode is the first mode, each time a new mouse movement event is received, the position movement information of the mouse movement event is determined, and a laser point is displayed at a position corresponding to the position movement information on the display interface. Thus, only one laser point is displayed on the display interface, and the laser point is the laser point corresponding to the position movement information of the latest mouse movement event, and the position of the laser point keeps changing as new mouse movement events are continuously received.

[0221] In some possible implementations, when the current drawing mode is the second mode, each time a new mouse movement event is received, the position movement information of the mouse movement event is determined and recorded, and a corresponding position sequence on the display interface is determined according to each recorded position movement information, and a track line is drawn on the position sequence to form a brush trace. Thus, as new mouse movement events are continuously received, the track line is continuously extended, and the brush traces are continuously increased.

[0222] In some possible implementations, performing a drawing operation on the display interface according to the position movement information in step S3-2 includes: in the drawing window, calling a laser view (LaserView), and using the laser view to draw according to the position movement information. Optionally, the laser view supports drawing a cursor position, or drawing a cursor trajectory.

[0223] In one example, in the software framework layer of the electronic device, a laser view is created in advance, that is, a custom view is encapsulated, for example: the custom view is called the laser view (LaserView), and the laser view (LaserView) provides a first interface for drawing the cursor position, and a second interface for drawing the cursor trajectory. A drawing window is created through the WindowManager module. When the PointerController module changes the event type of the mouse movement event from the mouse cursor type to the virtual laser type, the pointer control of the drawing window is called to display the pointer display of the set virtual laser type in the drawing window. When the drawing window receives a call request for the pointer control of the PointerController module, the laser view is used as the root view (root View), whereby a drawing control appears on the display interface of the electronic device. When performing a drawing operation, the first interface or the second interface of the laser view is called, so that the laser view (LaserView) completes the drawing operation according to the position movement information of the mouse movement event, and the drawing result can be displayed on the display interface.

[0224] In the above embodiment, mouse movement events are received in real time during the remote control process, that is, mouse movement events can be obtained at any time. When executing the first operation, the first operation is completed according to the mouse movement events. When executing other operations, the mouse movement events can also be applied to other reasonable aspects.

[0225] In an exemplary embodiment of the present disclosure, a control method is provided, which is applied to an electronic device. Fig.10 is a flow chart of a control method according to an exemplary embodiment. Fig.10 As shown, the control method includes:

[0226] Step S1001, receiving a key event sent by a stylus.

[0227] The content of step S1001 is the same as that of step S501 and will not be repeated here.

[0228] Step S1002: Determine, according to the key event, that the pressing type is the first type.

[0229] The content of determining the pressing type as the first type according to the key event in step S1002 is the same as the content of determining the pressing type as the first type according to the key event in step S502, and will not be repeated here.

[0230] Step S1003: determine whether the pressing type corresponds to the first operation.

[0231] The content of determining that the pressing type corresponds to the first control operation in step S1003 is the same as the content of determining that the pressing type corresponds to the first control operation in step S503, and will not be repeated here.

[0232] Step S1004, executing the first operation.

[0233] The content of the first operation performed in step S1004 is the same as the content of the first operation performed in step S704, and will not be repeated here.

[0234] The control method further includes: in the process from step S1002 to step S1004, step S1005 is executed in parallel with step S1002 to step S1004, and step S1005 is: receiving a mouse movement event sent by the stylus.

[0235] In the above embodiment, the mouse movement event can be received only when the first operation is required, which matches the way in which the stylus pen sends the mouse movement event.

[0236] In an exemplary embodiment of the present disclosure, a control method is provided, which is applied to an electronic device. Fig.11 is a flow chart of a control method according to an exemplary embodiment. Fig.11 As shown, the following steps are included:

[0237] Step S1101, receiving a key event sent by a stylus.

[0238] The content of step S1101 is the same as that of step S501 and will not be repeated here.

[0239] Step S1102, determining the pressing type according to the key event.

[0240] The content of step S1102 is the same as that of step S502 and will not be repeated here.

[0241] Step S1103, determining the control operation corresponding to the pressing type according to at least one of the following parameters of the foreground application and the pressing type: application type, function of the current interface, and running status of the function of the current interface.

[0242] In an example, the application type of the foreground application is a shooting type or a non-shooting type.

[0243] When the foreground application is a shooting application, its application type is a shooting type. For example, the shooting application can be a photo application, a video application, or a camera application. Among them, the camera application includes a photo function and a video function.

[0244] Non-shooting type applications are other applications except shooting applications, for example, non-shooting type applications include: PPT application, Microsoft Word application, PDF application, image display application, video display application.

[0245] In some possible embodiments, when the application types of the foreground application are different, the same press type corresponds to different control operations; and / or when the functions of the current page of the foreground application are different, the same press type corresponds to different control operations.

[0246] There are many ways to determine the control operation corresponding to the pressing type in step S1103, and five determination methods are described below.

[0247] The first way to determine:

[0248] When it is determined that the program type of the application program running in the foreground is a non-shooting type and the pressing type is a first type, it is determined that the control operation corresponding to the pressing type is a first operation, and the first operation is: performing a drawing operation on the display interface.

[0249] The contents of the first type and the first operation in step S1103 are the same as those of the first type and the first operation in step S503, and are not described again here.

[0250] The second way to determine:

[0251] When it is determined that the program type of the application program running in the foreground is a non-shooting type and the pressing type is a second type, it is determined that the control operation corresponding to the pressing type is a second operation, and the second operation is: switching the drawing mode.

[0252] The content of the second type and the second operation in step S1103 is the same as the content of the second type and the second operation in step S503, and will not be repeated here.

[0253] The third way to determine:

[0254] When the pressing type is determined to be the third type and the current drawing mode is the second mode, the control operation corresponding to the third type is determined to be the third operation, and the third operation is: clearing the drawing traces in the second mode, wherein the second mode is a mode for drawing cursor tracks.

[0255] The fourth way to determine:

[0256] When it is determined that the program type of the application running in the foreground is a shooting type and the function of the current interface of the application running in the foreground is a photo taking function, the control operation is determined to be a fourth operation, and the fourth operation is: single shooting or continuous shooting.

[0257] In some possible embodiments, when it is determined that the program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a photo taking function, and the pressing type is the fourth type, the control operation is determined to be a single shot.

[0258] In some possible embodiments, when it is determined that the program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a photo taking function, and the pressing type is the fifth type, it is determined that the control operation is continuous shooting.

[0259] In some possible embodiments, when it is determined that the program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a photo taking function, and the pressing type is a long pressing type, the control operation is determined as: starting continuous shooting at the start time of the key event and stopping continuous shooting at the end time of the key event.

[0260] The content of the fourth operation in step S1103 is the same as that in step S503 and will not be repeated here.

[0261] The fifth way to determine:

[0262] In some possible embodiments, it is determined that the program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a recording function, the running status of the function of the current interface is that the recording has not started, and when the pressing type is the sixth type, the control operation is determined to be: start recording.

[0263] In some possible embodiments, it is determined that the program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a recording function, the running status of the function of the current interface is that recording has started, and when the pressing type is the seventh type, the control operation is determined to be: stop recording.

[0264] In some possible implementations, it is determined that the program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a recording function, the running status of the function of the current interface is that recording has not started, and when the pressing type is a long pressing type, the control operation is determined as: starting recording at the start time of the key event and stopping recording at the end time of the key event.

[0265] Step S1104, executing control operation.

[0266] In some possible implementations, the control method further includes: during step S1101 to step S1104, continuously receiving mouse movement events sent by the stylus.

[0267] In some possible implementations, the control method further includes: when it is determined in step S1103 that the control operation is the first operation, during the process from step S1103 to step S1104, continuously receiving the mouse movement event sent by the stylus.

[0268] In the above embodiment, after the pressing type is determined, the control operation corresponding to the pressing type is determined according to at least one parameter of the foreground application. When at least one parameter of the foreground application is different, different control operations are performed on the same pressing type, so that the user can perform different operations on different applications, especially the user can use the same pressing operation to perform different operations on different applications, thereby improving the user's usage experience.

[0269] In an exemplary embodiment of the present disclosure, a control method is provided, which is applied to an electronic device. Fig.12 is a flow chart of a control method according to an exemplary embodiment. Fig.12 As shown, the control method includes:

[0270] Step S1201, receiving a key event sent by a stylus.

[0271] The content of step S1201 is the same as that of step S501 and will not be repeated here.

[0272] Step S1202, determining the pressing type according to the key event.

[0273] Step S1202 is identical to step S502 and will not be described in detail herein.

[0274] Step S1203: determine the application type of the foreground application.

[0275] Step S1204: when the application type of the foreground application is a shooting type, a control operation corresponding to the pressing type is determined according to at least one of the function of the current interface and the running state of the function of the current interface and the pressing type.

[0276] In some possible implementations, the application type of the shooting type is a shooting application. For example, the shooting application may be a photo application, a video application, or a camera application. The camera application includes a photo function and a video function.

[0277] In some possible implementations, determining a control operation corresponding to a pressing type according to at least one of a function of a current interface and an operating state of the function of the current interface and a pressing type includes:

[0278] According to the program type of the application program running in the foreground being a shooting type, and the function of the current interface of the application program running in the foreground being a photo taking function, the control operation is determined to be a third operation, and the third operation is: single shooting, or continuous shooting.

[0279] The content of the third operation in this embodiment is the same as the content of the third operation in the third determination method in step S503, and will not be repeated here.

[0280] In some possible embodiments, determining a control operation corresponding to the pressing type according to at least one of a function of the current interface and an operating state of the function of the current interface and the pressing type includes:

[0281] According to the program type of the application running in the foreground being a shooting type, the function of the current interface of the application running in the foreground being a recording function, the running status of the function of the current interface being that recording has not started, and when the pressing type is the sixth type, the control operation is determined to be: start recording.

[0282] and / or

[0283] According to the program type of the application running in the foreground being the shooting type, the function of the current interface of the application running in the foreground being the recording function, the running status of the function of the current interface being that the recording has not started, and when the pressing type is the seventh type, the control operation is determined to be: stop recording.

[0284] In some possible embodiments, determining the control operation corresponding to the pressing type according to at least one of the function of the current interface and the running state of the function of the current interface and the pressing type includes:

[0285] According to the program type of the application running in the foreground being a shooting type, the function of the current interface of the application running in the foreground being a recording function, the running status of the function of the current interface being that recording has not started, and the pressing type being a long pressing type, the control operation corresponding to the pressing type is determined as: starting recording at the start time of the key event and stopping recording at the end time of the key event.

[0286] Step S1205: when the application type of the foreground application is a non-shooting type, a control operation corresponding to the pressing type is determined according to the pressing type.

[0287] In some possible implementations, non-shooting type applications are other applications except shooting applications, for example, non-shooting type applications are: PPT application, Microsoft Word application, PDF application, image display application, video display application.

[0288] In some possible implementations, when the pressing type is the first type, the control operation corresponding to the pressing type is determined to be the first operation, and the first operation is: performing a drawing operation on the display interface.

[0289] The contents about the first type and the first operation in this embodiment are the same as the contents about the first type and the first operation in the first determination method in step S503, and are not repeated here.

[0290] In some possible implementations, when the pressing type is the second type, the control operation corresponding to the pressing type is determined to be the second operation, and the second operation is: switching the drawing mode.

[0291] The contents about the second type and the second operation in this embodiment are the same as the contents about the second type and the second operation in the second determination method in step S503, and are not repeated here.

[0292] In an exemplary embodiment of the present disclosure, a control method is provided, which can be applied to a scene where the current application type is not a shooting type. The control method includes:

[0293] Step 1: The stylus detects a single-click pressing operation on a first physical key (which may be called a focus key), and sends a first pressing event of a single-click pressing type to the electronic device.

[0294] Among them, single click corresponds to the second operation.

[0295] Step 2: The electronic device receives the first pressing event, and according to the pressing type being a single click, determines and executes the control operation corresponding to the first pressing event: turns on the second mode (or brush mode).

[0296] In one embodiment, since the drawing mode before receiving the first press event is the first mode, after receiving the first press event, the first mode is switched to the second mode, thereby starting the second mode.

[0297] In one embodiment, since no drawing mode has been enabled before the first press event is received, the second mode is the default drawing mode, and therefore the second mode is enabled after the first press event is received.

[0298] Step 3: The stylus receives a long press operation on the first physical key (which may be called the focus key), and sends a second press event of a long press type to the electronic device.

[0299] Among them, long pressing corresponds to the first operation.

[0300] Step 4: the electronic device receives the second pressing event, and according to the pressing type being a long press, determines and executes the control operation corresponding to the second pressing event: drawing on the display interface. Since the current drawing mode is the second mode, a cursor track is drawn on the display interface.

[0301] Step 5: When the second pressing event ends, the electronic device stops drawing the cursor track on the display interface.

[0302] Step 6: The stylus receives a double-click pressing operation on the first physical key (which may be referred to as the focus key), and sends a third pressing event of a long press type to the electronic device.

[0303] Among them, double clicking corresponds to the third operation.

[0304] Step 7: The electronic device receives the third pressing event, and according to the pressing type being a double click, determines and executes the control operation corresponding to the second pressing event: clearing the drawing traces in the second mode.

[0305] In an exemplary embodiment of the present disclosure, a control method is provided, which is applied to an electronic device. Fig.13 is a flow chart of a control method according to an exemplary embodiment. Fig.13 As shown, the following steps are included:

[0306] Step S1301, receiving a pressing input operation on the stylus, generating a key event according to the pressing input operation, and sending the key event to the electronic device;

[0307] Step S1302, the electronic device receives a key event via wireless communication;

[0308] Step S1303, sending the key event to the Input driver;

[0309] Step S1304, the Input driver writes the key event to the Input event node;

[0310] Step S1305, the InputReader module assembles and synthesizes the key events;

[0311] Step S1306, the InputDispatcher module requests the PhoneWindowManager module (policy) to intercept the physical key events;

[0312] Step S1307, the PhoneWindowManager module requests the LaserPointerController module to process the key event;

[0313] Step S1308, the LaserPointerController module judges the physical key event and determines the pressing type;

[0314] If the pressing type is a long press, execute step S1310 to step S1312; if the pressing type is a short press, execute step S1309.

[0315] Step S1309, switch the drawing mode and end the process.

[0316] Step S1310, in the current drawing mode, executing a drawing operation;

[0317] Step S1311, if the current drawing mode is a mode for drawing the cursor position, request the LaserView module to draw the laser according to the mouse movement event;

[0318] Step S1312: If the current drawing mode is a mode for drawing cursor tracks, request the LaserView module to draw brush traces according to the mouse movement event.

[0319] In an exemplary embodiment of the present disclosure, an electronic device is provided. Fig.14 is a block diagram of an electronic device according to an exemplary embodiment. Fig.14 As shown, including:

[0320] The receiving module 1401 is configured to receive a key event sent by the stylus;

[0321] The processing module 1402 is configured to determine a pressing type according to a key event; determine a control operation corresponding to the pressing type, and execute the control operation, wherein different pressing types correspond to different control operations.

[0322] In some possible implementations, the processing module 1402 is further configured to determine the control operation corresponding to the pressing type using the following method:

[0323] Determine a control operation corresponding to the pressing type according to at least one of the following parameters of the foreground application and the pressing type:

[0324] Application type;

[0325] The function of the current interface;

[0326] The running status of the function of the current interface.

[0327] In some possible implementations, when the application types of the foreground application are different, the same press type corresponds to different control operations; and / or when the functions of the current page of the foreground application are different, the same press type corresponds to different control operations.

[0328] In some possible implementations, when the pressing type is the first type, the control operation corresponding to the first type is: performing a drawing operation on the display interface.

[0329] In some possible implementations, the processing module 1402 is further configured to perform a drawing operation on the display interface in a current drawing mode or a default drawing mode;

[0330] The current drawing mode is the drawing mode after the drawing mode is switched; or

[0331] The current drawing mode is an initial drawing mode when the drawing mode has not been switched.

[0332] In some possible implementations, the receiving module 1401 is further configured to receive a mouse movement event sent by the stylus;

[0333] The processing module 1402 is further configured to perform a drawing operation on the display interface according to the product information of the stylus pen and the mouse movement event.

[0334] In some possible implementations, the processing module 1402 is further configured to perform a drawing operation on the display interface according to the product information of the stylus pen and the mouse movement event using the following method:

[0335] Determining, according to the product information of the stylus pen, that the stylus pen has a virtual laser function;

[0336] Modify the event type of the mouse movement event from a mouse cursor type to a virtual laser type;

[0337] A drawing operation is performed on the display interface according to the mouse movement event.

[0338] In some possible implementations, the processing module 1402 is further configured to use the following method to perform a drawing operation on the display interface according to the mouse movement event, including:

[0339] Obtaining position movement information in the mouse movement event;

[0340] Invoking laser cursor processing logic corresponding to the virtual laser type;

[0341] The drawing operation is performed on the display interface according to the position movement information through the laser cursor processing logic.

[0342] In some possible implementations, the processing module 1402 is further configured to perform a drawing operation on the display interface according to the position movement information using the following method:

[0343] In the drawing window, calling the laser sight, and using the laser sight to draw according to the position movement information;

[0344] Wherein, the laser field of view supports drawing a cursor position or drawing a cursor trajectory.

[0345] In some possible implementations, when the pressing type is the second type, the control operation corresponding to the second type is: switching the drawing mode.

[0346] In some possible implementations, the drawing mode is a first mode or a second mode; wherein the first mode is a mode for drawing a cursor position, and the second mode is a mode for drawing a cursor track.

[0347] In some possible implementations, when the pressing type is the third type and the current drawing mode is the second mode, the control operation corresponding to the third type is: clearing the drawing traces in the second mode, wherein the second mode is a mode for drawing cursor tracks.

[0348] In some possible implementations, when the program type of the application running in the foreground is a shooting type and the function of the current interface of the application running in the foreground is a photo taking function, the control operation is: single shooting, or continuous shooting.

[0349] In some possible implementations, when the pressing type is the fourth type, the control operation corresponding to the fourth type is a single tap; or

[0350] When the pressing type is the fifth type, the control operation corresponding to the fifth type is continuous shooting;

[0351] Among them, the fourth type and the fifth type are different.

[0352] In some possible implementations, the processing module 1402 is further configured to: when the pressing type is a long pressing type, determine the control operation as: starting continuous shooting at the start time of the key event and stopping continuous shooting at the end time of the key event.

[0353] In some possible implementations, when the program type of the application program running in the foreground is a shooting type and the function of the current interface of the application program running in the foreground is a video recording function,

[0354] The running state of the function of the current interface is that the video recording has not started, and when the pressing type is the sixth type, the control operation is to start the video recording;

[0355] When the running state of the function of the current interface is that recording has started, and the pressing type is the seventh type, the control operation is to stop recording;

[0356] The sixth type and the seventh type are the same or different.

[0357] In some possible implementations, the program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a recording function, the running state of the function of the current interface is that recording has not started, and when the pressing type is a long pressing type, the control operation is: start recording at the start time of the key event, and stop recording at the end time of the key event.

[0358] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0359] Fig.15 is a block diagram of an electronic device 1500 according to an exemplary embodiment.

[0360] Reference Fig.15 , the electronic device 1500 may include one or more of the following components: a processing component 1502 , a memory 1504 , a power component 1506 , a multimedia component 1508 , an audio component 1510 , an input / output (I / O) interface 1512 , a sensor component 1514 , and a communication component 1516 .

[0361] The processing component 1502 generally controls the overall operation of the electronic device 1500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1502 may include one or more processors 1520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1502 may include one or more modules to facilitate the interaction between the processing component 1502 and other components. For example, the processing component 1502 may include a multimedia module to facilitate the interaction between the multimedia component 1508 and the processing component 1502.

[0362] The memory 1504 is configured to store various types of data to support operations on the electronic device 1500. Examples of such data include instructions for any application or method operating on the electronic device 1500, contact data, phone book data, messages, pictures, videos, etc. The memory 1504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0363] The power supply component 1506 provides power to the various components of the electronic device 1500. The power supply component 1506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1500.

[0364] The multimedia component 1508 includes a screen that provides an output interface between the electronic device 1500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1508 includes a front camera and / or a rear camera. When the electronic device 1500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0365] The audio component 1510 is configured to output and / or input audio signals. For example, the audio component 1510 includes a microphone (MIC), and when the electronic device 1500 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1504 or sent via the communication component 1516. In some embodiments, the audio component 1510 also includes a speaker for outputting audio signals.

[0366] I / O interface 1512 provides an interface between processing component 1502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0367] The sensor assembly 1514 includes one or more sensors for providing various aspects of status assessment for the electronic device 1500. For example, the sensor assembly 1514 can detect the open / closed state of the electronic device 1500, the relative positioning of components, such as the display and keypad of the electronic device 1500, and the sensor assembly 1514 can also detect the position change of the electronic device 1500 or a component of the electronic device 1500, the presence or absence of user contact with the electronic device 1500, the orientation or acceleration / deceleration of the electronic device 1500, and the temperature change of the electronic device 1500. The sensor assembly 1514 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1514 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0368] The communication component 1516 is configured to facilitate wired or wireless communication between the electronic device 1500 and other devices. The electronic device 1500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0369] In an exemplary embodiment, the electronic device 1500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0370] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1504 including instructions, and the instructions can be executed by a processor 1520 of the electronic device 1500 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0371] A non-temporary computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a control method, the method including any one of the above-mentioned control methods.

[0372] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0373] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A control method, characterized in that: The method comprises: Receive key events sent by the stylus; Determine a pressing type according to the key event; Determining a control operation corresponding to the pressing type; executing the control operation; Among them, different pressing types correspond to different control operations.

2. The control method according to claim 1, characterized in that: The determining the control operation corresponding to the pressing type includes: Determine a control operation corresponding to the pressing type according to at least one of the following parameters of the foreground application and the pressing type: Application type; Functions of the current interface; The running status of the function of the current interface.

3. The control method according to claim 2, characterized in that: When the application types of the foreground application are different, the same pressing type corresponds to different control operations; and / or When the functions of the current page of the foreground application are different, the same pressing type corresponds to different control operations.

4. The control method according to any one of claims 1 to 3, characterized in that: When the pressing type is the first type, the control operation corresponding to the first type is: performing a drawing operation on the display interface.

5. The control method according to claim 4, characterized in that: The performing of the drawing operation on the display interface includes: performing the drawing operation on the display interface in a current drawing mode or a default drawing mode; The current drawing mode is the drawing mode after the drawing mode is switched; or The current drawing mode is an initial drawing mode when the drawing mode has not been switched.

6. The control method according to claim 4, characterized in that: The method further comprises: receiving a mouse movement event sent by the stylus; The performing of the drawing operation on the display interface includes: A drawing operation is performed on a display interface according to the product information of the stylus pen and the mouse movement event.

7. The control method according to claim 6, characterized in that: The performing a drawing operation on a display interface according to the product information of the stylus pen and the mouse movement event includes: Determining, according to the product information of the stylus pen, that the stylus pen has a virtual laser function; Modify the event type of the mouse movement event from a mouse cursor type to a virtual laser type; A drawing operation is performed on the display interface according to the mouse movement event.

8. The control method according to claim 7, characterized in that: The performing a drawing operation on the display interface according to the mouse movement event includes: Obtaining position movement information in the mouse movement event; Invoking laser cursor processing logic corresponding to the virtual laser type; The drawing operation is performed on the display interface according to the position movement information through the laser cursor processing logic.

9. The control method according to claim 8, characterized in that: The performing a drawing operation on the display interface according to the position movement information includes: In the drawing window, calling the laser sight, and using the laser sight to draw according to the position movement information; Wherein, the laser field of view supports drawing a cursor position or drawing a cursor trajectory.

10. The control method according to any one of claims 1 to 3, characterized in that: When the pressing type is the second type, the control operation corresponding to the second type is: switching the drawing mode.

11. The control method according to claim 10, characterized in that: The drawing mode is a first mode or a second mode; wherein the first mode is a mode for drawing a cursor position, and the second mode is a mode for drawing a cursor track.

12. The control method according to any one of claims 1 to 3, characterized in that: When the pressing type is the third type and the current drawing mode is the second mode, the control operation corresponding to the third type is: clearing the drawing traces in the second mode, wherein the second mode is a mode for drawing a cursor track.

13. The control method according to claim 2, characterized in that: When the program type of the application program running in the foreground is a shooting type and the function of the current interface of the application program running in the foreground is a photo taking function, the control operation is: single shooting or continuous shooting.

14. The control method according to claim 13, characterized in that: When the pressing type is the fourth type, the control operation corresponding to the fourth type is single tap; or When the pressing type is the fifth type, the control operation corresponding to the fifth type is continuous shooting; Among them, the fourth type and the fifth type are different.

15. The control method according to claim 13, characterized in that: When the pressing type is a long pressing type, the control operation is: starting continuous shooting at the start time of the key event, and stopping continuous shooting at the end time of the key event.

16. The control method according to claim 2, characterized in that: When the program type of the application program running in the foreground is a shooting type and the function of the current interface of the application program running in the foreground is a video recording function, The running state of the function of the current interface is that the video recording has not started, and when the pressing type is the sixth type, the control operation is to start the video recording; When the running state of the function of the current interface is that recording has started, and the pressing type is the seventh type, the control operation is to stop recording; The sixth type and the seventh type are the same or different.

17. The control method according to claim 2, characterized in that: The program type of the application running in the foreground is a shooting type, the function of the current interface of the application running in the foreground is a recording function, the running status of the function of the current interface is that recording has not started, and when the pressing type is a long pressing type, the control operation is: start recording at the start time of the key event and stop recording at the end time of the key event.

18. A stylus pen, comprising a pen body, characterized in that: include: A first physical button, a processing module and a wireless transmission module are arranged on the pen body; The first physical button is used to: receive a pressing input operation; The processing module is used to: generate a key event according to the pressing input operation; The wireless transmission module is used to send the key event.

19. The stylus pen according to claim 18, characterized in that: The stylus pen further includes at least one of a second physical button and a third physical button disposed on the pen body; Among them, the second physical button is used for the screenshot function, and the third physical button is used for the shorthand function.

20. The stylus pen according to claim 18 or 19, characterized in that: The stylus pen further comprises: a displacement sensor electrically connected to the processing module; The displacement sensor is used to: collect displacement sensing data; The processing module is used to: generate a mouse movement event according to the displacement sensing data; The wireless transmission module is used to send the mouse movement event.

21. The stylus pen according to claim 20, characterized in that: The processing module is further configured to generate a mouse movement event according to the displacement sensing data when the pressing type of the pressing input operation is a first type.

22. A control method using the stylus pen according to any one of claims 18 to 21, characterized in that: include: receiving a pressing input operation on the first physical key; Generate a key event according to the pressing input operation; Send the key event.

23. The control method according to claim 22, characterized in that: The control method further comprises: Collect displacement sensor data; Generate a mouse movement event according to the displacement sensing data; Sends the mouse move event.

24. The control method according to claim 23, characterized in that: Generating a mouse movement event according to the displacement sensing data includes: When the pressing type of the pressing input operation is a first type, a mouse movement event is generated according to the displacement sensing data.

25. An electronic device, characterized in that: include: A receiving module, configured to receive a key event sent by the stylus; The processing module is configured to determine a pressing type according to the key event, determine a control operation corresponding to the pressing type, and execute the control operation; wherein different pressing types correspond to different control operations.

26. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 17, or to execute the method according to any one of claims 22 to 24.

27. A non-transitory computer-readable storage medium, characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 17, or execute the method as claimed in any one of claims 22 to 24.

Citation Information

Cited By

  • Electronic pen and information processing system

    CN121255035A