1. Field of the Invention
The present invention relates to a method and related computer apparatus for differentiating keys, and more particularly, to a method and related computer apparatus through detecting whether a second layer application program is executed to selectively utilize a first layer application program or the second layer application layer to determine an event corresponding to a scan code.
2. Description of the Prior Art
In Microsoft's Windows graphical user interface, although the use of a mouse can handle lots of operations, the cooperation with keyboard hotkeys can make work more efficient, providing a user with a quick way to start and operate desired application programs.
To use Microsoft-defined scan codes as keyboard scan codes, it must first pass through Microsoft's certification before Microsoft's certification logo can be affixed. Furthermore, if other scan codes not defined by Microsoft are to be used as keyboard scan codes, and if any amendments have been made to the keyboard's programming, then the keyboard must be resubmitted for Microsoft's certification. This reiterative process is not only time-consuming and laborious, but also increases costs whenever the Microsoft's certification is resubmitted. For manufacturers, it is really a thorny issue.
It is one of the objectives of the claimed invention to provide a method for differentiating keys and related computer apparatus to solve the abovementioned problems.
The present invention discloses a method for differentiating keys. The method includes setting a first layer application program and a second layer application program, detecting whether the second layer application program is executed to generate a detection result when receiving a scan code corresponds to a key, and selectively utilizing the first layer application program or the second layer application program to determine an event corresponding to the scan code.
In one embodiment, when the detection result indicates that the second layer application program is executed, the first layer application program is used to transmit the scan code to the second layer application program, and the second layer application program is used to execute the event corresponding to the scan code defined in the second layer application program. In another embodiment, when the detection result indicates that the second layer application program is not executed, the first layer application program is used to execute the event corresponding to the scan code defined in the first layer application program.
The present invention discloses a computer apparatus. The computer apparatus includes a keyboard and a computer host. The keyboard has at least one key. The computer host is coupled to the keyboard. The computer host includes a first layer application program and a second layer application program. When receiving a scan code corresponding to the key, the computer host detects whether the second layer application program is executed to generate a detection result, and selectively utilizes the first layer application program or the second layer application program to determine an event corresponding to the scan code according to the detection result.
In one embodiment, the computer host includes a keyboard scan code generating module, a first processing module, and a second processing module. The keyboard scan code generating module is coupled to the keyboard for generating the scan code corresponding to the key when the key is pressed. The first processing module is coupled to the keyboard scan code generating module for detecting whether the second layer application program is executed when receiving the scan code corresponding to the key received from the keyboard scan code generating module. The second processing module is coupled to the first processing module. When the first processing module detects that the second layer application program is executed, the first processing module transmits the scan code to the second processing module and the second processing module executes the event corresponding to the scan code defined in the second layer application program.
In one embodiment, the first processing module is implemented by executing the first layer application program through a central processing unit, and the second processing module is implemented by executing the second layer application program through the central processing unit.
The present invention discloses a computer apparatus. The computer apparatus includes a keyboard, a keyboard controller, a first processing module, and a second processing module. The keyboard has at least one key. The keyboard controller is used for generating a scan code corresponding to the key when the key is pressed. The first processing module is used for detecting whether the second layer application program is executed when receiving the scan code corresponding to the key. The first processing module executes an event corresponding to the scan code defined in the first layer application program when the second layer application program is not executed. When the first processing module detects that the second layer application program is executed, the first processing module transmits the scan code to the second processing module and the second processing module executes an event corresponding to the scan code defined in the second layer application program.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
Step 102: Set a first layer application program and a second layer application program.
Step 104: Press a key of a keyboard.
Step 106: Generate a scan code corresponding to the key.
Step 108: Detect whether the second layer application program is executed. If the second layer application program is executed, go to Step 112; otherwise, go to Step 110.
Step 110: Utilize the first layer application program to execute an event corresponding to the scan code defined in the first layer application program.
Step 112: Utilize the first layer application program to transmit the scan code to the second layer application program.
Step 114: Utilize the second layer application program to execute an event corresponding to the scan code defined in the second layer application program.
Please refer to
Please continue referring to
Please note that the abovementioned first processing module 270 can be implemented by executing the first layer application program AP1 (which can be stored in any storage media of the computer host 230 to be accessed by the central processing unit 260) through the central processing unit 260, and the second processing module 280 can be implemented by executing the second layer application program AP2, but are not limited to this, and can be implemented through other ways. For example, the first processing module 270 and the second processing module 280 can be implemented through hardware, software, or their combination.
Please refer to
Please note that the abovementioned processing module 370 can be implemented by executing the first layer application program AP1 and the second layer application program AP2 through the central processing unit 260, but are not limited to this, and can be implemented in other ways. For example, the processing module 370 can be implemented through hardware, software, or their combination. Furthermore, the first layer application program AP1 and the second layer application program AP2 are installed in an operating system (OS).
Please note that the abovementioned computer apparatuses 200 and 300 are not limited to desktop personal computers (PC), and can be notebook PCs. Hence, the computer host 230 or 330 includes other computer components except the keyboard 210. Those skilled in the art should know that this is not a limitation of the present invention.
Please refer to
In Step 102, the first layer application program AP1 and the second layer application program AP2 are set. First, a key of the keyboard 210 is pressed, and then the keyboard scan code generating module 240 generates a scan code corresponding to the key (Steps 104-106). When the first processing module 270 receives the scan code corresponding to the key, the first processing module 270 detects whether the second layer application program AP2 is executed (Step 108). In the following, descriptions are divided into several conditions. In a first condition, if the first processing module 270 detects that the second layer application program AP2 is not executed, it will use the first layer application program AP1 to perform the event corresponding to the scan code defined in the first layer application program AP1 (Step 110). For example, the event corresponding to the scan code is defined as “opening the mailbox” in the first layer application program AP1. In the second condition, if the first processing module 270 detects that the second layer application program AP2 is executed, it will use the first layer application program AP1 to transmit the scan code to the second layer application program AP2 (Step 112) and then the second processing module 280 will use the second layer application program AP2 to perform the event corresponding to the scan code defined in the second layer application program AP2. For example, the event corresponding to the scan code is defined as “playing music” in the second layer application program AP2. In this embodiment, the generated scan code corresponding to the key is fixed, but the events corresponding to scan code defined in the first layer application program AP1 and in the second layer application program AP2 are different. When the second layer application program AP2 is not executed, the event (i.e. “opening the mailbox”) corresponding to the scan code defined in the first layer application program AP1 is performed. When the second layer application program AP2 is executed, the second layer application program AP2 is used for performing the event (i.e. “playing music”) corresponding to the scan code defined in the second layer application program AP2.
Of course, the abovementioned first layer application program AP1 of the first processing module 270 and the second layer application program AP2 of the second processing module 280 are merely exemplary embodiments of the present invention. In other embodiments, more functions are designated into the first layer application program AP1 to provide the computer apparatus 200 with more choices. For example, a comparison function can be added into the first layer application program AP1. Before receiving a scan code corresponding to a key, the scan code corresponding to the pressed key is compared with the designated scan codes SCD1-SCDn corresponding to the hotkeys F1-Fn. Only when the scan code corresponding to the pressed code is one of the designated scan codes SCD1-SCDn does the first layer application program AP1 of the first processing module 270 perform the above-mentioned judging step. Therefore, the processing efficiency for differentiating hotkeys can be improved, which can further lower power consumption.
Please refer to
Step 102: Set a first layer application program and a second layer application program.
Step 104: Press a key of a keyboard.
Step 106: Generate a scan code corresponding to the key.
Step 410: Compare the scan code corresponding to the key with a designated scan code corresponding to a designated hotkey. If the scan code corresponding to the key is the designated scan code corresponding to the designated hotkey, go to Step 108; otherwise, go to Step 412.
Step 412: Judge that the key is not the designated hotkey.
Step 108: Detect whether the second layer application program is executed. If the second layer application program is executed, go to Step 112; otherwise, go to Step 110.
Step 110: Utilize the first layer application program to execute an event corresponding to the scan code defined in the first layer application program.
Step 112: Utilize the first layer application program to transmit the scan code to the second layer application program.
Step 114: Utilize the second layer application program to execute an event corresponding to the scan code defined in the second layer application program.
The steps shown in
In Step 102, the first layer application program AP1 and the second layer application program AP2 are set. First, a key of the keyboard 210 is pressed, and then the keyboard scan code generating module 240 generates a scan code corresponding to the key (Steps 104-106). When the first processing module 270 receives the scan code corresponding to the key, the first processing module 270 will compare the scan code corresponding to the key with a designated scan code (i.e. one of the designated scan codes SCD1-SCDn) corresponding to a designated hotkey (i.e. one of the hotkeys F1-Fn) in Step 410. In the following, descriptions are divided into several conditions. In a first condition, assume that the pressed key is the key A, which has a corresponding scan code SC1. When the first processing module 270 receives the scan code SC1 corresponding to the key A generated from the keyboard scan code generating module 240, it will compare the scan code SC1 corresponding to the key A with the designated scan codes SCD1-SCDn (Step 410). Because the scan code SC1 corresponding to the key A is not one of the designated scan codes SCD1-SCDn, Step 412 is performed to determine that the key A is not a designated hotkey of the plurality of hotkeys F1-Fn. In a second condition, assume that the pressed key is the designated hotkey F1 and the second layer application program AP2 is not executed at this time. When the first processing module 270 receives the scan code SCD1 corresponding to the designated hotkey F1 generated from the keyboard scan code generating module 240, it will compare the scan code SCD1 corresponding to the designated hotkey F1 with the designated scan codes SCD1-SCDn (Step 410). Because there is a match, Step 108 is performed to detect whether the second layer application program AP2 is executed. The first processing module 270 detects that the second layer application program AP2 is not executed, and the first layer application program AP1 is used for performing the event corresponding to the scan code defined in the first layer application program AP1 (Step 110). For example, the event corresponding to the scan code is defined as “opening the mailbox” in the first layer application program AP1. In a third condition, assume that the pressed key is the designated hotkey F1 and the second layer application program AP2 is executed at this time. When the first processing module 270 receives the scan code SCD1 corresponding to the designated hotkey F1 generated from the keyboard scan code generating module 240, it will compare the designated scan code SCD1 corresponding to the pressed designated hotkey F1 with the designated scan codes SCD1-SCDn (Step 410). Because there is a match, Step 108 is performed to detect whether the second layer application program AP2 is executed. The first processing module 270 detects that the second layer application program AP2 is executed, and the first layer application program AP1 is used for transmitting the scan code to the second layer application program AP2 (Step 112) and then the second processing module 280 utilizes the second layer application program AP2 to perform the event corresponding to the scan code defined in the second layer application program AP2. For example, the event corresponding to the scan code is defined as “playing music” in the second layer application program AP2.
These embodiments above are presented merely for describing applications of the present invention, and in no way should be considered to be limitations of the scope of the present invention. It will be obvious to those skilled in the art that various modifications of the first layer application program AP1 in the first processing module 270 and the second layer application program AP2 in the second processing module 280 may be made without departing from the spirit of the present invention.
The abovementioned embodiments are presented merely for describing the present invention, and in no way should be considered to be limitations of the scope of the present invention. The abovementioned computer apparatuses 200 and 300 can be a desktop PC or a notebook PC, but are not limited to this only and can be computer apparatuses of other types. The first processing module 270 can be implemented by executing the first layer application program AP1 through the central processing unit 260 and the second processing module 280 can be implemented by executing the second layer application program AP2 through the central processing unit 260, or the processing module 370 can be implemented by executing the first layer application program AP1 and the second layer application program AP2 through the central processing unit 260, but are not limited to them and can be implemented in other ways. In addition, the first processing module 270 and the second processing module 280 above are presented merely for describing applications of the present invention. Those skilled in the art should appreciate that various modifications of the first layer application program AP1 in the processing module 270 and the second layer application program AP2 may be made without departing from the spirit of the present invention. The number n of the abovementioned hotkeys F1-Fn is not a fixed value and can be adjusted according to user demands. Please note that, the steps of the abovementioned flows are not limited to be performed according to the sequence shown in the embodiments above. Various modifications can be made without departing from the spirit of the present invention by those skilled in the art.
In summary, the present invention provides a method and related computer apparatus for differentiating keys. Through setting the first layer application program AP1 and the second layer application program AP2, the events corresponding to the designated scan code defined in the first layer application program AP1 and in the second layer application program AP2 are different although the designated scan code generated from the same designated hotkey (F1-Fn) is identical. Therefore, when the second layer application program AP2 is not executed, the first layer application program AP1 is used for performing the event (i.e. “opening the mailbox”) corresponding to the scan code defined in the first layer application program AP1. On the other hand, when the second layer application program AP2 is executed, the second layer application program AP2 is used for performing the event (i.e. “playing music”) corresponding to the scan code defined in the second layer application program AP2. In other words, assuming that the keyboard hotkeys (such as F1-Fn) produced by keyboard manufactures have passed through Microsoft's certification, the first layer application program AP1 is used for performing the hotkey functions passed through Microsoft's certification. However, the layered key-differentiating mechanism further provides a second layer application program AP2 to replace the first layer application program AP1 to provide other hotkey functions against the scan codes corresponding to the same keyboard hotkeys. Furthermore, a comparison function can be added into the first layer application program AP1 of the first processing module 270 to improve the efficiency for differentiating hotkeys further. Therefore, not only can users set different hotkey functions according to their demands, but manufacturers also can save time and costs of passing through certifications, which is a great boon in consideration of convenience and economy.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention.
Number | Date | Country | Kind |
---|---|---|---|
096129299 | Aug 2007 | TW | national |