Method and apparatus for differentiating simultaneous and sequential key strokes
BACKGROUND OF THE INVENTION 
     The present invention generally relates to methods and apparatuses for differentiating simultaneous and sequential key strokes, and more particularly to a method and an apparatus for differentiating simultaneous and sequential key strokes made on an input device when inputting information to a computer or the like. 
     Conventionally, a single key stroke on a keyboard inputs character, symbol and numeric information to a computer or the like. In addition, in order to minimize the number of keys on the keyboard and enable a larger amount of character, symbol and numeric information to be input from the keyboard, an input is also made by a combination of one key and a control key such as a shift key or a voiced sound key. When making the input by such a key combination, the key stroke of one key and the key stroke of the control key are made simultaneously. 
     On the other hand, the simultaneous and sequential key strokes are conventionally differentiated in the following manner. That is, it is judged that the key stroke K 1  is a part of sequential key strokes when a time T L  elapses from a time when the key K 1  is first pushed. Similarly, it is judged that the key stroke K 2  is a part of sequential key strokes when a time T L  elapses from a time when the key K 2  is first pushed. The time T L  is a fixed parameter used for detecting simultaneous key strokes, and is normally set to 100 msec. On the other hand, it is judged that the key strokes of the keys K 1  and K 2  are simultaneous if the second key K 2  is pushed before the time T L  elapses from the time when the first key K 1  is pushed. In other words, the key strokes are judged as being simultaneous if the keys K 1  and K 2  are pushed within the time T L . 
     FIGS. 1 and 2 are diagrams for explaining the operation of differentiating the simultaneous and sequential key strokes. As shown in FIG. 2, it is detected that the key stroke K 1  is a part of the sequential key strokes if the time T L  elapses from the time when the key K 1  is pushed and the key K 2  is not pushed during this time T L . The simultaneous key strokes of the keys K 1  and K 2  are detected if the key K 2  is pushed before the time T L  elapses from the time when the key K 1  is pushed. 
     However, as may be seen from FIG. 2, a differentiation of the simultaneous and sequential key strokes is conventionally not made if both times T 1  and T 2  fall within the time T L , where T 1  is the time difference between the time when the key K 1  is pushed and the time when the key K 2  is pushed, and T 2  is the time difference between the time when the key K 2  is pushed and the time when the key K 1  is released. That is, T 2  is the time during which both the keys K 1  and K 2  are held pushed. 
     Accordingly, the key strokes are all judged as being simultaneous key strokes if both the times T 1  and T 2  are shorter than the time T L . In this case, there are problems in that an input error may occur in response to the key strokes which are made, and that the differentiating accuracy of the key strokes is poor. 
     SUMMARY OF THE INVENTION 
     Accordingly, it is a general object of the present invention to provide a novel and useful method and an apparatus for differentiating simultaneous and sequential key strokes, in which the problems described above are eliminated. 
     Another and more specific object of the present invention is to provide a method of differentiating simultaneous and sequential key strokes by detecting simultaneous key strokes if two keys are pushed within a judging time T L , comprising the steps of (a) measuring a first time T 1  from a time when a first key is pushed to a time when a second key is pushed, and a second time T 2  from the time when the second key is pushed to a time when one of the first and second keys is released, (b) comparing the first and second times T 1  and T 2  with an arbitrary differentiation function T C  =f(T 1 , T 2 ) which is set within the judging time T L , and (c) differentiating whether key strokes of the first and second keys are simultaneous or sequential based on a comparison result of the step (b). According to the method of the present invention, it is possible to improve the accuracy of the differentiation and prevent erroneous input from an input device. 
     Still another object of the present invention is to provide an apparatus for differentiating simultaneous and sequential key strokes by detecting simultaneous key strokes if two keys are pushed within a judging time T L , comprising first means for measuring a first time T 1  from a time when a first key is pushed to a time when a second key is pushed, and a second time T 2  from the time when the second key is pushed to a time when one of the first and second keys is released, second means for comparing the first and second times T 1  and T 2  with an arbitrary differentiation function T C  =f(T 1 , T 2 ) which is set within the judging time T L , and third means for differentiating whether key strokes of the first and second keys are simultaneous or sequential based on a comparison result obtained from the second means. According to the apparatus of the present invention, it is possible to improve the accuracy of the differentiation and prevent erroneous input from an input device. 
     Other objects and further features of the present invention will be apparent from the following detailed description when read in conjunction with the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a time chart for explaining a conventional method of judging simultaneous key strokes; 
     FIG. 2 is a diagram for explaining the conventional operation of differentiating simultaneous and sequential key strokes; 
     FIG. 3 is a system block diagram showing a keyboard unit which is applied with an embodiment of an apparatus for differentiating simultaneous and sequential key strokes according to the present invention; 
     FIG. 4 is a plan view showing an essential part of a keyboard of the apparatus shown in FIG. 3; 
     FIG. 5 is a diagram for explaining an embodiment of a method of differentiating simultaneous and sequential key strokes according to the present invention; 
     FIG. 6 is a flow chart for explaining the embodiment of the method; and 
     FIG. 7 is a system block diagram showing an essential part of another embodiment of the apparatus for differentiating simultaneous and sequential key strokes according to the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     A description will be given of an embodiment of an apparatus for differentiating simultaneous and sequential key strokes according to the present invention, by referring to FIGS. 3 and 4. FIG. 3 shows a keyboard unit which is applied with this embodiment of the apparatus, and FIG. 4 shows an essential part of a keyboard of the keyboard unit. 
     In FIG. 3, the keyboard unit generally includes a central processing unit (CPU) 1, a read only memory (ROM) 2, a random access memory (RAM) 3, a timer 4, an output circuit 5, and a keyboard 6 which are coupled via a bus 20. 
     The ROM 2 prestores programs for controlling the CPU 1, and codes corresponding to each key and each combination of keys. The programs prestored in the ROM 2 include a differentiating program for differentiating simultaneous and sequential key strokes. Various registers are set in the RAM 3. The timer 4 and the output circuit 5 are used for outputting the codes. The keyboard 6 has a key arrangement shown in FIG. 4. 
     In FIG. 4, Japanese character keys, including Japanese hiragana character keys and semi-voiced sound character keys, are arranged in three rows. However, the keyboard 6 may have other key arrangements, and may have alpha-numeric and symbol keys. In FIG. 4, the keys are roughly divided into a group of keys arranged in a left region A1 and a group of keys arranged in a right region A2. A center line C corresponds to a boundary between the regions A1 and A2. A left thumb key (or left control key) 7 is arranged in the region A1 at the fourth bottom row, and a right thumb key (or right control key) 8 is arranged in the region A2 at the fourth bottom row. 
     The selection of the character, that is, the character input from the keyboard 6, is made in the following manner. 
     If an arbitrary key in the region A1 or A2 is pushed independently, a character which is indicated on the lower half of this arbitrary key is selected and input. 
     If an arbitrary key in the region A1 or A2 and one of the thumb keys 7 and 8 in the same region as the arbitrary key are pushed, a character which is indicated on the upper half of this arbitrary key is selected and input. 
     If an arbitrary key in the region A1 or A2 and one of the thumb keys 7 and 8 in the region different from the arbitrary key are pushed, a voiced sound character of a character which is indicated on the lower half of this arbitrary key is selected and input. 
     Next, a description will be given of the operation of differentiating simultaneous and sequential key strokes in this embodiment of the apparatus, by referring to FIG. 5. FIG. 5 shows an embodiment of a method of differentiating simultaneous and sequential key strokes according to the present invention. 
     If a key K 2  is pushed within a time T L  from the time when a key K 1  is pushed and one of the keys K 1  and K 2  is released within the time T L  from the time when the key K 2  is pushed, that is, if the keys K 1  and K 2  are pushed within a time region which is surrounded by T 1  =T L  on the T 1  time-axis and T 2  =T L  on the T 2  time-axis in FIG. 5, the ratio of the times T 1  and T 2  with respect to a differentiation function (or threshold curve) T C  =f(T 1 , T 2 ) is compared. The time T 1  is the time interval between the time when the key K 1  is pushed and the time when the key K 2  is pushed, and the time T 2  is the time interval in which both the keys K 1  and K 2  are pushed simultaneously, as may be seen from FIG. 1 described above. The time T L  is a fixed parameter for detecting simultaneous key strokes, and the simultaneous key strokes are detected if the keys K 1  and K 2  are pushed within the time T L . The differentiation function T C  is set within the above time region. The differentiation as to whether a single key was pushed (that is, a part of sequential key strokes) or two keys were pushed simultaneously (that is, simultaneous key strokes) is made based on the result of the comparison. For example, the key K 1  is a character key and the key K 2  is a thumb key (control key). 
     The methods of detecting whether or not each key is pushed and detecting whether or not each key is released, are known. Accordingly, a description related to the detecting methods will be omitted in the present specification. 
     A part of sequential key strokes is detected if the times T 1  and T 2  fall below the differentiation function T C  in FIG. 5. On the other hand, simultaneous key strokes are detected if the the times T 1  and T 2  fall above the differentiation function T C  in FIG. 5. Accordingly, by setting the differentiation function T C  within the time T L  which is the fixed parameter for judging the simultaneous key strokes, and judging whether the key stroke is a part of sequential key strokes or the key strokes are simultaneous based on the differentiation function T C , it is possible to prevent an erroneous input from the keyboard 6 even if the keys are pushed within the time T L . Further, since a reference is made to the times T 1  and T 2  when making the differentiation, it is possible to judge that the key stroke is a part of sequential key strokes even if the time T 1  is relatively short as long as the time T 2  is shorter than the time T 1 . As a result, it is possible to prevent an erroneous differentiation even if an operator of the keyboard 6 makes quick key strokes. 
     FIG. 6 is a flow chart for explaining the operation of this embodiment of the method. The operation shown in FIG. 6 corresponds to the operation of the CPU 1 shown in FIG. 3. 
     In FIG. 6, a step S1 decides whether or not the key K 1  is pushed. This step S1 is repeated until the decision result in the step S1 becomes YES. When the decision result in the step S1 becomes YES, a step S2 starts an internal timer of the CPU 1 or the timer 4 for timing the time T 1 . Then, a step S3 decides whether or not the time T L  has elapsed. If the decision result in the step S3 is YES, a step S4 detects that the key stroke of the key K 1  is a part of sequential key strokes and the process is ended. 
     On the other hand, if the decision result in the step S3 is NO, a step S5 decides whether or not the key K 2  is pushed. The process returns to the step S3 if the decision result in the step S5 is NO. But if the decision result in the step S5 is YES, a step S6 determines the time T 1  by temporarily storing the time T 1  in the RAM 3, for example. In addition, a step S7 starts an internal timer of the CPU 1 or the timer 4 for timing the time T 2 . 
     Next, a step S8 decides whether or not the time T L  has elapsed. If the decision result in the step S8 is YES, a step S9 detects that the key strokes of the keys K 1  and K 2  are simultaneous, and the process is ended. 
     On the other hand, if the decision result in the step S8 is NO, a step S10 decides whether or not the key K 1  or the key K 2  is released. The process returns to the step S8 if the decision result in the step S10 is NO. But if the decision result in the step S10 is YES, a step S11 determines the time T 2  by temporarily storing the time T 2  in the RAM 3, for example. 
     Of course, the step S10 may decide whether or not both the keys K 1  and K 2  are released. The step S10 may also decide whether the key K 1  alone is released, the key K 2  alone is released, or both the keys K 1  and K 2  are released. 
     After the step S11, a step S12 decides whether or not the time T 2  is greater than the differentiation function T C  =f(T 1 , T 2 ) at T 1 . If the decision result in the step S12 is YES, a step S13 detects the key strokes of the keys K 1  and K 2  as being simultaneous, and the process ends. On the other hand, if the decision result in the step S12 is NO, a step S14 detects the key strokes of the keys K 1  and K 2  as being sequential, and the process ends. 
     Next, a description will be given of another embodiment of the apparatus for differentiating simultaneous and sequential key strokes according to the present invention, by referring to FIG. 7. In this embodiment of the apparatus, the present invention is also applied to a keyboard unit, and FIG. 7 shows an essential part of the keyboard unit. 
     The keyboard unit shown in FIG. 7 includes a keyboard 6, a simultaneous key strokes detector 31, a timer 61, a code combination table 71, and a key combination judging part 81 which are connected as shown. The simultaneous key strokes detector 31 and the key combination judging part 81 function as the CPU 1 of the embodiment shown in FIG. 3. 
     The simultaneous key strokes detector 31 includes memories 32a and 32b for storing key codes, memories 33a and 33b for storing times, memories 34a and 34b for storing key release (key OFF) times, a key stroke detector 41, an operation part 42, and a comparator 51 which are connected as shown. 
     When a key of the keyboard 6 is pushed, the key stroke detector 41 stores a key code of this pushed key into the memory 32a, and stores a key-ON time which is read from the timer 61 into the memory 33a. The key-ON time is the time when the key is pushed. When the pushed key is released, the key stroke detector 41 reads the key code of this released key from the memory 32a and supplies this key code to the key combination judging part 81. If the key code has a meaning by itself, the key combination judging part 81 outputs a character code corresponding to the key code via an output terminal 91. On the other hand, if the key code does not have a meaning by itself, the key combination judging part 81 disregards the received key code. 
     If a first key is pushed and a second key such as a control key is pushed before the first key is released, the key stroke detector 41 stores the key code of the second key into the memory 32b, and stores a key-ON time of the second key which is read from the timer 61 into the memory 33b. 
     If the first and second keys are released one after the other, the key stroke detector 41 supplies the key codes of the first and second keys stored in the memories 32a and 32b to the key combination judging part 81. The key combination judging part 81 refers to the key code combination table 71 and judges whether or not the combination of the keys codes of the first and second keys is valid. If the key code combination is valid, the key combination judging part 81 outputs a character code which is described by this key code combination via the output terminal 91. On the other hand, if the key code combination is invalid, the key combination judging part 81 disregards the received key codes of the first and second keys. 
     Furthermore, the key stroke detector 41 reads a key-OFF time of the first key from the timer 61 and stores this key-OFF time into the memory 34a. Similarly, the key stroke detector 41 reads a key-OFF time of the second key from the timer 61 and stores this key-OFF time into the memory 34b. The key-OFF time is the time when the pushed key is released. 
     The operation part 42 refers to the memories 33a and 33b to calculate the time T 1  from the key-ON times of the first and second keys. In addition, the operation part 42 refers to the memories 33b, 34a and 34b to calculate the time T 2  based on the key-ON time of the second key and the key-OFF times of the first and second keys. 
     The comparator 51 compares the coordinate of the times T 1  and T 2  with respect to the threshold curve T C , so as to differentiate whether the key stroke is a part of sequential key strokes or the key strokes are simultaneous. The differentiation result of the comparator 51 is notified to the key stroke detector 41. 
     The key stroke detector 41 reads the key codes of the first and second keys from the memories 32a and 32b and supplies these key codes to the key combination judging part 81 if the differentiation result from the comparator 51 indicates that the key strokes are simultaneous. On the other hand, the key stroke detector 41 reads the key code of the first key from the memory 32a and supplies this key code to the key combination judging part 81 if the differentiation result from the comparator 51 indicates that the key stroke is a part of sequential key strokes. 
     The differentiation function T C  is of course not limited to that of the embodiment shown in FIG. 5, and an arbitrary differentiation function T C  may be used. In addition, it is also possible to vary the differentiation function T C  with the key input time. In this case, it is possible to vary the differentiation function T C  in correspondence with the change in the key input speed due to fatigue. 
     Furthermore, in the described embodiments, the simultaneous or sequential key strokes of the two keys K 1  and K 2  are detected. However, it is of course possible to similarly detect simultaneous or sequential key strokes of three or more keys. 
     In addition, the present invention is applied to the keyboard unit in the described embodiments, but may be applied to other apparatuses which is responsive to an input made from an input device having a plurality of input keys or switches. For example, the present invention is applicable to electronic instruments such as an electronic piano. 
     Further, the present invention is not limited to these embodiments, but various variations and modifications may be made without departing from the scope of the present invention.