[0050] Example 2
[0051] In order to simplify the process of copy and paste and improve the user experience of copy and paste, the embodiment of the present invention provides a method of copy and paste, see figure 2 , The method includes:
[0052] 201: Determine whether the text editing page is activated according to the function status bit in the program,
[0053] If yes, go to step 203;
[0054] If not, go to step 202;
[0055] Those skilled in the art can know that the function status bit of the program has two states: on and off. By judging the function status bit, the current program status can be known.
[0056] 202: Activate the text editing page;
[0057] 203: In the activated state of the text editing page, save the selected target data to the copy stack;
[0058] Among them, the selection of target data is generally specified by the user, using frame selection, etc. The selected content can be text, pictures, etc., for example, when selecting, the user can use the CTRL+C key combination to send the selected target data To select the target data.
[0059] Among them, the size of the copy stack can be specified by the user or can be set by the system according to the memory size of the system. Generally speaking, the size of the copy stack is smaller than the memory of the system. When the selected target data is larger than the capacity of the copy stack, the larger part overflow.
[0060] It should be noted that the saving is specifically to determine whether there is a saved copy text in the copy stack, if it is, save the selected target data in the address above the saved copy text, if not, select the selected target data The target data is saved to the bottom of the stack.
[0061] Steps 201 to 203 are the process of copying, and the following is the process of pasting. The two processes are in sequence, but not necessarily consecutive.
[0062] 204: Receive an instruction to paste text;
[0063] The instruction for pasting text includes the specific location of the pasted text, and also includes specific replacement methods such as upward replacement or downward replacement. The specific location can be marked by the user with a cursor. The instruction can come from a mouse click event or scroll event, or from a keyboard event.
[0064] 205: Determine whether the number of stored copied texts in the copy stack is greater than one,
[0065] If yes, go to step 206b;
[0066] If not, go to step 206a;
[0067] 206a: Paste the copied text in the copy stack to the position specified by the instruction, and end;
[0068] 206b: Paste the first copied text in the copy stack to the position specified by the instruction;
[0069] It should be noted that when it is determined that the content to be pasted has been copied to the copy stack, when the number of copied texts stored in the copy stack is not more than one, it means that the copied text stored in the copy stack is one, then the copy The text is pasted to the position specified by the instruction, and the first copied text is the desired copy text at this time; when the number of stored copied texts in the copy stack is greater than one, it means that there is more than one copy text stored in the copy stack, then Paste the first copied text to the location specified by the instruction as the basis for the subsequent steps.
[0070] When pasting the copied text, you can use highlighting, color, or underline to mark the pasted copied text for the user's preview.
[0071] 207: When the number of stored copied texts in the copy stack is greater than one, the copied text in the copy stack is used to replace a pasted copy one by one according to the monitored mouse event;
[0072] When the monitored mouse event is an event of the scroll wheel scrolling upward, from the bottom of the stack to the top of the stack, replace the last copied text with the copied text in the copy stack one by one;
[0073] When the monitored mouse event is an event of the scroll wheel scrolling down, the copied text in the copy stack is replaced one by one with the copied text in the copy stack from the top of the stack to the bottom of the stack.
[0074] The above-mentioned steps are achieved by monitoring mouse events. In the embodiment of the present invention, operations can also be performed according to keyboard events, such as up, down, left, and right keys.
[0075] It should be noted that steps 206b-207 are a process of selecting and pasting copied text. In actual operation, it can also play a role as a preview. When the preview effect or the pasted copied text does not meet the needs of the user, The paste can be cancelled according to the user's instruction. This function can be realized by shortcut keys, for example, you can set to cancel the pasted copied text when the ESC key is triggered.
[0076] 208: End when the copied text pasted in the selected position is the copied text specified by the instruction.
[0077] The above steps 206 to 208 are the process of pasting the copied text selected by the user through the instant preview method, for example, see image 3 with Figure 4 As shown, "This is the pasted text segment 1" and "Attention, this is the pasted text segment 2" are saved in the copy stack. When the paste instruction is received, the first copy text "This is the pasted text segment" 1" is copied to the specified position and marked with the highlighting method. When the mouse wheel is monitored to scroll down, replace "this is the pasted text segment 1" with the next copied text "Attention, this is the pasted text segment 2" , By scrolling the mouse up and down, the switch of the pasted text is realized, and a preview effect is formed. If the pasted text meets the needs of the user, then continue to perform other operations to consider that the text has been pasted. If the pasted text does not meet the needs of the user and needs to be deleted, you can cancel the pasting by pressing the "Esc" button.
[0078] Step 207-Step 208 may also be: when the number of stored copied texts in the copy stack is greater than one, display all copied texts in the copy stack according to the instruction; select the copied text specified by the instruction in the copy stack, and use the specified The copied text replaces the first copied text that is pasted. That is, a menu containing all copied text in the copy stack is created. The menu displays all copied text in the order from the top of the stack to the bottom of the stack. When the user's mouse click event is monitored, a certain copied text clicked by the mouse is completely pasted to Specify the position, if it is monitored that the ESC button is triggered or the mouse clicks outside the menu, the text paste at that position will be cancelled. The list selection is similar to the instant preview in step 206-step 208, but it provides intuitive selectivity, by providing a floating selection menu in the paste position for you to select the paste content. The above-mentioned steps are achieved by monitoring mouse events. In the embodiment of the present invention, operations can also be performed according to keyboard events, such as up, down, left, and right keys.
[0079] For example, see Figure 5 As shown, "This is the paste text segment 1" and "Attention, this is the paste text segment 2" are saved in the copy stack. When the paste instruction is received, the menu containing the copied text is displayed. When the user's mouse is monitored When you click "This is Paste Text Segment 1", paste "This is Paste Text Segment 1" to the specified position.
[0080] It should be noted that the mouse event in the embodiment of the present invention may be a wheel scroll event or a mouse click event. In the embodiment of the present invention, the selection of copied text in the copy stack may also be indicated by the arrow keys on the keyboard.
[0081] Paste the first copied text in the copy stack, and then preview the paste situation according to the instruction to replace the specified copy text, and process the pasted copied text according to the preview result, forming an intuitive preview and The application effect greatly reduces the time, and the effect will be more obvious with the increase of the amount of posts, reducing the switching between texts, simplifying the process of copying and pasting, and improving the user experience of copying and pasting.