Full-screen window processing method and device, computer device and readable storage medium
By enabling a separate thread in the full-screen window process to disable hotkey combinations and block function keys, the problem of full-screen windows not being able to be forcibly covered under the Linux operating system is solved, achieving effective coverage of full-screen windows and optimization of performance resources.
Patent Information
- Application Number
- CN202110811981.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-19
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2041-07-19
AI Technical Summary
Under the Linux operating system, existing full-screen windows cannot achieve forced full-screen coverage and are easily killed by hotkey combinations and function keys.
In the process of the full-screen window, start an independent worker thread, disable preset hotkey combinations and block preset function keys, capture user keystroke events by registering a keyboard hook, judge and intercept preset function key operations, and turn off the blocking function after the full-screen window completes the preset task.
Ensure effective coverage of full-screen windows, prevent users from killing processes using hotkey combinations and function keys, reduce performance resource waste, and improve the accuracy of coverage control and user experience.
Smart Images

Figure CN115640082B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of full-screen window processing, and in particular to a full-screen window processing method and device, a computer device and a readable storage medium. BACKGROUND
[0002] In a system login scenario, a full-screen window is often used to cover the current interface based on security requirements, and the current interface is displayed after further verification in the full-screen window. In the prior art, the function of the Qt full-screen window is usually called to achieve the above effect. However, the inventors have found that in the Linux operating system, a system login window can be reopened by using some hot key combinations, such as: ctrl+alt+fn, fn is f1~f9, and then the full-screen window process is found and killed. Alternatively, the current window can be exited by using function keys, such as the ESC key and the DEL key, and the corresponding full-screen window process is killed. Therefore, the full-screen window in the prior art cannot achieve the purpose of forced full-screen coverage in the Linux operating system.
[0003] Therefore, how to implement full-screen window coverage in the Linux operating system has become a technical problem to be solved in the field. SUMMARY
[0004] The purpose of the present application is to provide a full-screen window processing method and device, a computer device and a readable storage medium, which solve the above technical problems in the prior art.
[0005] In one aspect, to achieve the above purpose, the present application provides a full-screen window processing method.
[0006] The full-screen window processing method comprises: starting an independent work thread in the process of the full-screen window, so that the work thread starts a shielding function, wherein the shielding function comprises disabling a preset hot key combination and shielding a preset function key; and when the process of the full-screen window completes a preset task, controlling the work thread to close the shielding function.
[0007] Further, the steps performed by the work thread when shielding the preset function key comprise: setting the full-screen window as a control window; registering a keyboard hook and capturing a user keystroke event; determining whether the captured keystroke event is an operation on the preset function key; and if it is an operation on the preset function key, intercepting the keystroke event, and if it is not an operation on the preset function key, sending the keystroke event to the control window. The steps performed by the work thread when closing the shielding function comprise: releasing the keyboard hook; and destroying the control window.
[0008] Further, the step of setting the full screen window as a control window comprises connecting an X server by calling an XOpenDisplay function; setting the full screen window as a default X server window by calling a DefaultRootWindow function; the step of registering a keyboard hook and capturing a user's keyboard event comprises hooking a keyboard event by calling an XGrabKeyboard function; capturing a user's keyboard action and obtaining a KeyPress and KeyRelease event by calling an XNextEvent function; the step of sending the keyboard event to the control window comprises sending the KeyRelease event by calling a SendEvent function; the step of releasing the keyboard hook comprises releasing the keyboard event by calling an XUngrabKeyboard function; and the step of destroying the control window comprises destroying the default X server window by calling an XDestoryWindow function and disconnecting the X server by calling an XCloseDisplay function.
[0009] Further, the step of determining whether the captured keyboard event is an operation on the preset function key comprises obtaining a key value in the captured keyboard event; and querying a key corresponding to the key value in the captured keyboard event in a pre-stored keyboard key value table, wherein the keyboard key value table comprises a correspondence between a key and a key value; and when the queried key is the preset function key, the captured keyboard event is an operation on the preset function key, and when the queried key is not the preset function key, the captured keyboard event is not an operation on the preset function key.
[0010] Further, the step of disabling the preset hot key combination by the working thread comprises modifying a mapping of the preset hot key combination to none; and the step of closing the shielding function by the working thread comprises restoring a default mapping of the preset hot key combination.
[0011] Further, the step of modifying the mapping of the preset hot key combination to none comprises executing a command line setxkbmap-option srvrkeys:none; or opening an / etc / default / keyboard file using root authority, adding a srvrkeys:none key field after an xkboptions option, and saving and exiting; and the step of restoring the default mapping of the preset hot key combination comprises executing a command line setxkbmap-option; or opening the / etc / default / keyboard file using root authority, emptying content after the xkboptions option, and saving and exiting.
[0012] Further, when the process of the full-screen window completes a preset task, the step of controlling the work thread to close the shielding function comprises: sending a process ending message to the work thread before the process of the full-screen window ends, wherein the work thread is configured to close the shielding function when the process ending message is received.
[0013] In another aspect, to achieve the above object, the present application provides a processing device of a full-screen window.
[0014] The processing device of the full-screen window comprises: an opening module configured to open an independent work thread in the process of the full-screen window, so that the work thread starts a shielding function, wherein the shielding function comprises disabling a preset hot key combination in an operating system and shielding a preset function key in the operating system; and a control module configured to control the work thread to close the shielding function when the process of the full-screen window completes a preset task.
[0015] To achieve the above object, the present application further provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0016] To achieve the above object, the present application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the steps of the above method.
[0017] The application provides a full-screen window processing method, device, computer equipment and readable storage medium, a preset task is set in the process of the full-screen window, in order to ensure the forced and effective execution of the preset task, that is, to ensure the full-screen covering purpose of the full-screen window, an independent work thread is started in the process of the full-screen window, so that the work thread starts a shielding function, disables a preset hot key combination key and shields a preset function key, when the process of the full-screen window completes the preset task, the work thread is controlled to close the shielding function. The full-screen window processing method, device, computer equipment and readable storage medium provided by the application avoid the user killing the process of the full-screen window by operating the hot key combination key and / or the preset function key, ensure the effective covering of the full-screen window, and the work thread is started in the process of the full-screen window, the work thread is controlled to realize the starting and exiting of the shielding function, avoid the hot key combination key and the shielding function key greatly affecting the process of the full-screen window, and after the process of the full-screen window is started, the work thread starts the shielding function, after the preset task in the process of the full-screen window is completed, the work thread closes the shielding function, and when the process is ended, the work thread is exited, so that the shielding function is just in the execution stage of the preset task, the shielding function is not started for a long time to waste the performance resource of the computer, and the full-screen window is not exited before the preset task is successfully completed to affect the effective covering, and the covering control is accurate. BRIEF DESCRIPTION OF DRAWINGS
[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments and are not intended to limit the scope of the application. Moreover, the same reference numerals are intended to denote the same components throughout the accompanying drawings. In the drawings:
[0019] Figure 1 A flow chart of the full-screen window processing method provided for the first embodiment of the application;
[0020] Figure 2 A block diagram of the full-screen window processing device provided for the second embodiment of the application;
[0021] Figure 3 A hardware structure diagram of the computer equipment provided for the third embodiment of the application. DETAILED DESCRIPTION
[0022] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0023] Embodiment one
[0024] The embodiment one of the present application provides a processing method of full-screen window. Through the method, an independent thread is started in the process of the full-screen window to disable hot key combination keys and shield function keys, so as to avoid the user from exiting the full-screen window through the hot key combination keys and the function keys, and ensure the full-screen covering purpose of the full-screen window. Specifically, Figure 1 The flow chart of the processing method of full-screen window provided by the embodiment one of the present application is shown in Figure 1 The processing method of full-screen window provided by the embodiment includes the following steps S101 and S102.
[0025] Step S101: starting an independent working thread in the process of the full-screen window, so as to enable the working thread to start the shielding function.
[0026] The shielding function includes disabling preset hot key combination keys and shielding preset function keys.
[0027] In an application scenario, the full-screen window covers the interactive interface of a business system. When the user completes the operation set on the full-screen window as required, the full-screen window exits and the interactive interface is continuously displayed. Specifically, when the user enters a module with higher security requirement in the business system, the full-screen window is set on the module homepage to perform secondary login verification. When the login password input by the user in the login information box on the full-screen window meets the requirement, the full-screen window exits and the module homepage is continuously displayed, so that the user can further operate on the module homepage.
[0028] The independent working thread is started in the process of the full-screen window, so that the working thread can be started at the same time after the process of the full-screen window is started. After the working thread is started, the shielding function is directly started, the preset hot key combination keys are disabled, and the preset function keys are shielded, so as to avoid the user from killing the process of the full-screen window by operating the hot key combination keys and / or the preset function keys. The preset hot key combination keys include ctrl+alt+fn, fn is f1~f9, and the preset function keys include ESC key and DEL key, etc.
[0029] Step S102: when the process of the full-screen window completes the preset task, the working thread is controlled to close the shielding function.
[0030] Specifically, the preset task is set in the full-screen window, and the full-screen window can be exited only after the preset task is completed, for example, the preset task is the secondary login verification task, and the full-screen window is exited when the login information box of the full-screen window receives a login password meeting the requirement, that is, the process of the full-screen window completes the preset task.
[0031] To ensure the effective existence of the full-screen window before the preset task is completed, the working thread starts the shielding function after the process of the full-screen window is started, and the preset hot key combination and the preset function key are disabled. When the process of the full-screen window completes the preset task, the full-screen window can be exited, and at this time, the working thread is controlled to close the shielding function, and the preset hot key combination and the preset function key are released, so that the user can normally operate the hot key combination and the function key.
[0032] In the processing method of the full-screen window provided in the embodiment, the preset task is set in the process of the full-screen window, and to ensure the forced effective execution of the preset task, that is, to ensure the full-screen covering purpose of the full-screen window, an independent working thread is started in the process of the full-screen window, so that the working thread starts the shielding function, disables the preset hot key combination and shields the preset function key, and when the process of the full-screen window completes the preset task, the working thread is controlled to close the shielding function. By using the processing method of the full-screen window provided in the embodiment, the hot key combination is disabled and the function key is shielded, so that the user cannot kill the process of the full-screen window by operating the hot key combination and / or the preset function key, the effective covering of the full-screen window is ensured, and by starting the working thread in the process of the full-screen window, the working thread is controlled to realize the starting and exiting of the shielding function, so that the hot key combination and the function key do not have too much influence on the process of the full-screen window, and after the process of the full-screen window is started, the working thread starts the shielding function, and after the preset task in the process of the full-screen window is completed, the working thread closes the shielding function. When the process ends, the working thread exits at the same time, so that the shielding function exists exactly in the execution stage of the preset task, the shielding function is not started for a long time to waste the performance resources of the computer, and the full-screen window is not exited before the preset task is successfully completed to affect the effective covering, and the covering control is accurate.
[0033] Optionally, in an embodiment, when the process of the full-screen window completes the preset task, the step of controlling the working thread to close the shielding function includes: sending a process end message to the working thread before the process of the full-screen window ends, and the working thread is used to close the shielding function when the process end message is received.
[0034] Specifically, when the process of the full-screen window completes the preset task, the process of the full-screen window ends, and before the process of the full-screen window ends, a process end message is sent to the working thread. The working thread closes the shielding function when the process end message is received. After the process ends, the working thread exits at the same time.
[0035] In the full-screen window processing method provided by the embodiment, the process can be ended after the preset task is completed, and the work thread closes the shielding function before the process is ended, that is, the work thread closes the shielding function is triggered by the process ending, without the need of additional triggering conditions, and the control process is simple.
[0036] Optionally, in an embodiment, the steps performed by the work thread when shielding the preset function key include: setting the full-screen window as a control window; registering a keyboard hook and capturing a user keystroke event; determining whether the captured keystroke event is an operation on the preset function key; and if it is an operation on the preset function key, intercepting the keystroke event, and if it is not an operation on the preset function key, sending the keystroke event to the control window. The steps performed by the work thread when closing the shielding function include: releasing the keyboard hook; and destroying the control window.
[0037] Specifically, when shielding the preset function key, the work thread can pre-establish a control window, call the control window, and set the full-screen window as the control window, or newly establish a control window and set the full-screen window as the control window. Then, the user's operation on the keyboard is monitored through the keyboard hook, and a user keystroke event is captured. When the user presses a key on the keyboard and releases it, a keystroke event occurs, and the keystroke event is captured at this time. It is determined whether the event is an operation on the preset function key, that is, whether the user presses and releases the preset function key. When the keystroke event is an operation on the preset function key, the keystroke event is intercepted, and the keystroke event is invalid, that is, the preset function key is shielded. When the keystroke event is not an operation on the preset function key, the keystroke event is sent to the control window, and the control window can normally receive operation information of the keystroke event, such as a user input password.
[0038] The steps performed by the work thread when closing the shielding function include canceling the shielding of the preset function key. Specifically, first, the keyboard hook is released to cancel the monitoring of the keyboard operation, and then the control window is destroyed, and the full-screen window is no longer a control window.
[0039] In the full-screen window processing method provided by the embodiment, the user's operation is filtered by accurate monitoring of the user's input behavior, which can accurately preset the function key and avoid affecting other keys.
[0040] Optionally, in an embodiment, the step of determining whether the captured keystroke event is an operation on the preset function key comprises: obtaining a key value in the captured keystroke event; and querying the key value in the captured keystroke event in a pre-stored keyboard key value table, wherein the keyboard key value table comprises a correspondence between a key and a key value; and when the queried key is the preset function key, the captured keystroke event is an operation on the preset function key, and when the queried key is not the preset function key, the captured keystroke event is not an operation on the preset function key.
[0041] Specifically, the pre-stored keyboard key value table stores the correspondence between the key and the key value in the form of a key-value pair, for example, the tab key corresponds to a key value of 23, the shift key corresponds to a key value of 50, the alt key corresponds to a key value of 64, and the enter key corresponds to a key value of 104. When determining whether the captured keystroke event is an operation on the preset function key, the key value in the captured keystroke event is first obtained, and the key corresponding to the obtained key value is then found in the keyboard key value table, so that the captured keystroke event is an operation on the preset function key if the key is the preset function key, and the captured keystroke event is not an operation on the preset function key if the key is not the preset function key.
[0042] The processing method of the full-screen window provided by the embodiment determines whether the captured keystroke event is an operation on the preset function key by pre-storing the keyboard key value table and obtaining the key value in the captured keystroke event. The keyboard key value table has a small amount of data, and the key value is queried at a high speed, so that it can be quickly determined whether the captured keystroke event is an operation on the preset function key, and it is quickly determined whether the captured keystroke event is to be sent, thereby reducing the impact on the response speed of user input and improving user experience.
[0043] Optionally, in an embodiment, the step of disabling the preset hotkey combination key by the worker thread comprises: modifying the mapping of the preset hotkey combination key to none; and the step of closing the shielding function by the worker thread comprises: restoring the default mapping of the preset hotkey combination key.
[0044] Specifically, the worker thread directly modifies the mapping of the preset hotkey combination key to none when the preset hotkey combination key is pressed, so that the preset hotkey combination key is disabled, and no response is made when the preset hotkey combination key is pressed in the process of the full-screen window.
[0045] The steps performed by the work thread when the shielding function is closed include canceling the preset hot key combination key disabling, specifically, restoring the preset hot key combination key to the default mapping, so that the preset hot key combination key can respond normally.
[0046] Optionally, in an embodiment, the step of setting the full-screen window as the control window includes connecting the X server by calling the XOpenDisplay function; setting the full-screen window as the default X server window by calling the DefaultRootWindow function; the step of registering the keyboard hook and capturing the user's keyboard event includes hooking the keyboard event by calling the XGrabKeyboard function; capturing the user's keyboard action by calling the XNextEvent function, and obtaining the KeyPress and KeyRelease events; the step of sending the keyboard event to the control window includes sending the KeyRelease event by calling the SendEvent function.
[0047] The step of modifying the mapping of the preset hot key combination key to empty includes executing the command line setxkbmap-optionsrvrkeys:none; or opening the / etc / default / keyboard file with root permission, adding the srvrkeys:none key field after the xkboptions option, and saving and exiting.
[0048] The step of releasing the keyboard hook includes releasing the keyboard event by calling the XUngrabKeyboard function; the step of destroying the control window includes destroying the default X server window by calling the XDestoryWindow function, and disconnecting the X server by calling the XCloseDisplay function.
[0049] The step of restoring the default mapping of the preset hot key combination key includes executing the command line setxkbmap-option; or opening the / etc / default / keyboard file with root permission, emptying the content after the xkboptions option, and saving and exiting.
[0050] Specifically, in this embodiment, the hot key combination key in the system is disabled through the setxkbmap method in the Linux operating system. Then the XGrabKeyboard method in X11 is used to capture the user's keyboard event, and according to the demand, the event is released or not. If the event is released, the user's input will be displayed, if the event is intercepted, the user's input is invalid. Further control the legality of the user's input behavior, realize the shielding of the system hot key combination key and some function keys that want to be shielded.
[0051] To enable the function of disabling system hotkey combination:
[0052] The first way is to use the command:
setxkbmap-option srvrkeys:none
[0053] The second way is to open the / etc / default / keyboard file with root permission, add the srvrkeys:none key field after the XKBOPTIONS option, and save and exit. Through one of the above two ways, the corresponding effect can be achieved, so that the current running process has the ability to shield the hotkey combination (ctrl+alt+fn, n=1~7).
[0054] To disable the function of disabling system hotkey combination
[0055] The first way is to use the command:
setxkbmap-option
[0056] The second way is to open the / etc / default / keyboard file with root permission, and set the content after the XKBOPTIONS option to empty.
[0057] To enable the function of shielding system function key:
[0058] 1. Connect the X server: through the X11 library function library, call the XOpenDisplay function to get the X server information.
[0059] 2. Set the current full-screen window as the default X service window by calling the X11 function library DefaultRootWindow with the X server information obtained in the previous step.
[0060] 3. Register a keyboard "hook" by calling the X11 library function XGrabKeyboard, which will get the user's keyboard events at this time
[0061] 4. Event loop waits for user to strike the keyboard.
[0062] 5. Capture the user's keyboard action and get the KeyPress and KeyRelease events through the XNextEvent function.
[0063] 6. Analyze whether the captured keyboard keycode is the one to be shielded.
[0064] 7. If it is wanted to shield, then directly continue to the event loop waiting place. If it is not wanted to shield, after getting the KeyRelease event, then send the event to the screen through the SendEvent function, and the corresponding key information appears on the screen.
[0065] 8. Once the capture is finished, the loop waits, and the cycle is repeated...
[0066] Regarding the closing of the shielding system function key function:
[0067] 1. Call the XUngrabKeyboard function to release the "hook".
[0068] 2. Call the XDestoryWindow function to destroy the current X service window.
[0069] 3. Call the XCloseDisplay function to disconnect from the X server.
[0070] Embodiment two
[0071] Corresponding to the above-mentioned embodiment one, the embodiment two of the present application provides a processing device of a full-screen window, and the corresponding technical feature details and the corresponding technical effects can be referred to the above-mentioned embodiment one, and the details are not described again in this embodiment. Figure 2 The block diagram of the processing device of the full-screen window provided for the embodiment two of the present application is shown as Figure 2 The device comprises an opening module 201 and a control module 202.
[0072] The opening module 201 is used for opening an independent working thread in the process of the full-screen window, so that the working thread starts the shielding function, wherein the shielding function comprises disabling a preset hot key combination in an operating system and shielding a preset function key in the operating system, and the control module 202 is used for controlling the working thread to close the shielding function when the process of the full-screen window completes a preset task.
[0073] Optionally, in an embodiment, the steps executed by the working thread when shielding the preset function key comprise: setting the full-screen window as a control window; registering a keyboard hook and capturing a user's keyboard event; judging whether the captured keyboard event is an operation on the preset function key; and if it is an operation on the preset function key, intercepting the keyboard event, and if it is not an operation on the preset function key, sending the keyboard event to the control window, and the steps executed by the working thread when closing the shielding function comprise: releasing the keyboard hook; and destroying the control window.
[0074] Optionally, in an embodiment, the step of setting the full screen window as a control window comprises connecting to an X server by calling an XOpenDisplay function; setting the full screen window as a default X server window by calling a DefaultRootWindow function; the step of registering a keyboard hook and capturing a user keystroke event comprises hooking a keyboard event by calling an XGrabKeyboard function; capturing a user keystroke action by calling an XNextEvent function and obtaining a KeyPress and KeyRelease event; the step of sending the keystroke event to the control window comprises sending the KeyRelease event by calling a SendEvent function; the step of releasing the keyboard hook comprises releasing the keyboard event by calling an XUngrabKeyboard function; the step of destroying the control window comprises destroying the default X server window by calling an XDestoryWindow function and disconnecting from the X server by calling an XCloseDisplay function.
[0075] Optionally, in an embodiment, the step of determining whether the captured keystroke event is an operation on the preset function key comprises obtaining a key value in the captured keystroke event; and querying a key corresponding to the key value in the captured keystroke event in a pre-stored keyboard key value table, wherein the keyboard key value table comprises a correspondence between a key and a key value; and wherein when the queried key is the preset function key, the captured keystroke event is an operation on the preset function key, and when the queried key is not the preset function key, the captured keystroke event is not an operation on the preset function key.
[0076] Optionally, in an embodiment, the step of disabling the preset hotkey combination key by the worker thread comprises modifying a mapping of the preset hotkey combination key to none; and the step of closing the shielding function by the worker thread comprises restoring a default mapping of the preset hotkey combination key.
[0077] Optionally, in one embodiment, the step of modifying the mapping of the preset hotkey combination to empty includes: executing the command `setxkbmap-option srvrkeys:none`; or opening the ` / etc / default / keyboard` file with root privileges, adding the `srvrkeys:none` keyword after the `xkboptions` option, and saving and exiting. The step of restoring the default mapping of the preset hotkey combination includes: executing the command `setxkbmap-option`; or opening the ` / etc / default / keyboard` file with root privileges, setting the content after the `xkboptions` option to empty, and saving and exiting.
[0078] Optionally, in one embodiment, when the control module 202 controls the worker thread to close the blocking function when the process of the full-screen window completes the preset task, the specific steps include: sending a process termination message to the worker thread before the process of the full-screen window ends, wherein the worker thread is used to close the blocking function when it receives the process termination message.
[0079] Example 3
[0080] This embodiment also provides a computer device, such as a smartphone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server, or cabinet server (including a standalone server or a server cluster composed of multiple servers), etc., capable of executing programs. Figure 3 As shown, the computer device 01 in this embodiment includes, but is not limited to, a memory 012 and a processor 011 that can be interconnected via a system bus, such as... Figure 3 As shown. It should be noted that, Figure 3 Only a computer device 01 with component memory 012 and processor 011 is shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0081] The memory 012 (i.e., a readable storage medium) in the embodiment includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 012 can be an internal storage unit of the computer device 01, such as a hard disk or a memory of the computer device 01. In other embodiments, the memory 012 can also be an external storage device of the computer device 01, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 01. Of course, the memory 012 can also include both the internal storage unit and the external storage device of the computer device 01. In the embodiment, the memory 012 is generally used to store an operating system and various application software installed on the computer device 01, such as program codes of the processing apparatus of the full-screen window in Embodiment Two, etc. In addition, the memory 012 can also be used to temporarily store various data that have been output or will be output.
[0082] The processor 011 in some embodiments can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 011 is generally used to control the overall operation of the computer device 01. In the embodiment, the processor 011 is used to run program codes or process data stored in the memory 012, such as the processing method of the full-screen window, etc.
[0083] Embodiment Four
[0084] The embodiment four also provides a computer readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., on which a computer program is stored. The program is executed by the processor to realize the corresponding function. The computer readable storage medium of the embodiment is used to store the processing apparatus of the full-screen window, which is executed by the processor to realize the processing method of the full-screen window in Embodiment One.
[0085] It should be noted that, in this text, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0086] The above-mentioned embodiment numbers of the application are only for description, not representing the advantages and disadvantages of the embodiments.
[0087] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by software and the necessary general hardware platform, of course, they can also be realized by hardware, but in many cases the former is a better embodiment.
[0088] The above is only the preferred embodiment of the application, and does not limit the patent scope of the application, any equivalent structure or equivalent process transformation using the content of the application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the application.
Claims
1. A method of processing a full-screen window, characterized by, The method comprises: starting an independent work thread in the process of the full-screen window, so that the work thread starts a shielding function, wherein the shielding function comprises disabling a preset hot key combination and shielding a preset function key; and setting a preset task in the full-screen window, and when the process of the full-screen window completes the preset task, controlling the work thread to close the shielding function, wherein the step of controlling the work thread to close the shielding function comprises: sending a process end message to the work thread before the process of the full-screen window ends, wherein the work thread is configured to close the shielding function when the process end message is received.
2. The method of claim 1, wherein: the steps performed by the work thread when shielding the preset function key comprise: setting the full-screen window as a control window; registering a keyboard hook and capturing a user keystroke event; determining whether the captured keystroke event is an operation on the preset function key; and if it is an operation on the preset function key, intercepting the keystroke event, and if it is not an operation on the preset function key, sending the keystroke event to the control window, the steps performed by the work thread when closing the shielding function comprise: releasing the keyboard hook; and destroying the control window.
3. The method of claim 2, wherein: the step of setting the full-screen window as a control window comprises: connecting to an X server by calling an XOpenDisplay function; and setting the full-screen window as a default X server window by calling a DefaultRootWindow function; the step of registering a keyboard hook and capturing a user keystroke event comprises: hooking a keyboard event by calling an XGrabKeyboard function; and capturing a user keystroke action and obtaining a KeyPress and KeyRelease event by calling an XNextEvent function; the step of sending the keystroke event to the control window comprises: sending the KeyRelease event by calling a SendEvent function; the step of releasing the keyboard hook comprises: releasing the keyboard event by calling an XUngrabKeyboard function; the step of destroying the control window comprises: destroying the default X server window by calling an XDestoryWindow function, and disconnecting from the X server by calling an XCloseDisplay function.
4. The method of claim 2, wherein, the step of determining whether the captured keystroke event is an operation on the preset function key comprises: obtaining a key value in the captured keystroke event; querying a key corresponding to the key value in the captured keystroke event in a pre-stored keyboard key value table, wherein the keyboard key value table comprises a correspondence between a key and a key value; and determining whether the key is the preset function key. When the queried key is the preset function key, the captured keystroke event is an operation on the preset function key; and when the queried key is not the preset function key, the captured keystroke event is not an operation on the preset function key.
5. The method of claim 1, wherein the step of disabling the preset hotkey combination key by the worker thread comprises modifying a mapping of the preset hotkey combination key to none. The step of disabling the preset hotkey combination key by the worker thread comprises modifying a mapping of the preset hotkey combination key to none. The step of disabling the preset hotkey combination key by the worker thread comprises modifying a mapping of the preset hotkey combination key to none. The step of modifying the mapping of the preset hotkey combination key to none comprises: executing a command line setxkbmap -option srvrkeys:none; or opening, with root authority, a file / etc / default / keyboard, adding a key field srvrkeys:none after an xkboptions option, and saving and exiting, The step of modifying the mapping of the preset hotkey combination key to none comprises: executing a command line setxkbmap -option srvrkeys:none; or opening, with root authority, a file / etc / default / keyboard, adding a key field srvrkeys:none after an xkboptions option, and saving and exiting, The method comprises:
7. An apparatus for processing a full-screen window, characterized by comprising: starting a separate worker thread in a process of the full-screen window, so that the worker thread starts a shielding function, wherein the shielding function comprises disabling a preset hotkey combination key in an operating system and shielding a preset function key in the operating system; and setting a preset task in the full-screen window, and controlling the worker thread to close the shielding function when the process of the full-screen window completes the preset task, The step of controlling the worker thread to close the shielding function comprises sending, before the process of the full-screen window ends, a process ending message to the worker thread, wherein the worker thread is configured to close the shielding function when the process ending message is received. The processor executes the computer program to implement the steps of the method of any one of claims 1 to 6.
8. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that:
Citation Information
Patent Citations
Method and system based on usage limit of established website platform for user
CN103106362A