TWI715061B - A scanning method for keys, a scanning method for keys scanning circuit, and an input device - Google Patents

A scanning method for keys, a scanning method for keys scanning circuit, and an input device Download PDF

Info

Publication number
TWI715061B
TWI715061B TW108119754A TW108119754A TWI715061B TW I715061 B TWI715061 B TW I715061B TW 108119754 A TW108119754 A TW 108119754A TW 108119754 A TW108119754 A TW 108119754A TW I715061 B TWI715061 B TW I715061B
Authority
TW
Taiwan
Prior art keywords
scan
scanning
lines
main
key
Prior art date
Application number
TW108119754A
Other languages
Chinese (zh)
Other versions
TW202046065A (en
Inventor
陳希聖
徐德平
Original Assignee
達方電子股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 達方電子股份有限公司 filed Critical 達方電子股份有限公司
Priority to TW108119754A priority Critical patent/TWI715061B/en
Publication of TW202046065A publication Critical patent/TW202046065A/en
Application granted granted Critical
Publication of TWI715061B publication Critical patent/TWI715061B/en

Links

Images

Landscapes

  • Input From Keyboards Or The Like (AREA)

Abstract

A scanning method for keys, a scanning method for keys scanning circuit, and an input device are provided. The scanning method for keys includes: executing a first scanning process, including triggering a first main scanning line, and reading a plurality of sensing signal lines to determine a plurality of the plurality of keys that are triggered in the first keys group. Then performing a second scanning process, including triggering one of the plurality of sub-scanning lines, and reading the plurality of sensing signal lines to determine a portion of the plurality of keys that are triggered in the second keys group. Wherein the first scanning program and the second scanning program are alternately executed, and each sub-scanning line is triggered at least once.

Description

按鍵掃描方法、使用於按鍵掃描電路的掃描方法及輸入裝置Key scanning method, scanning method and input device used in key scanning circuit

本發明是有關於一種按鍵掃描,且特別是一種對關鍵按鍵進行穿插式的多次掃描,以縮短掃描週期的按鍵掃描方法、使用於按鍵掃描電路的掃描方法及輸入裝置。The present invention relates to a key scanning, and in particular to a key scanning method that performs interspersed multiple scanning of key keys to shorten the scanning period, a scanning method used in a key scanning circuit, and an input device.

隨著電競文化越來越盛行,消費者逐漸選擇購買電競產品作為工作或遊戲的用途。電競產業不僅帶動數字競賽的風潮,更是推動硬體進步的推手。對於電競玩家或是鍵盤愛好者來說,一款擊鍵反應迅速並且大量敲擊後仍然耐用且可靠的機械鍵盤是絕對不可或缺的。事實上,電競玩家通常只使用到鍵盤的特定按鍵,來進行相關的電競遊戲。目前電競專用的鍵盤大多是藉由按鍵本身的機械結構或材料來縮短整體按鍵的反應時間。然而,鮮少是藉由改善按鍵掃描的方式來縮短特定按鍵的反應時間。因此,如何提供藉由改善特定按鍵的掃描方式,使特定按鍵的掃描速度可以大幅度地提升,將是本案所要著重的問題與解決的重點。As the e-sports culture becomes more and more popular, consumers gradually choose to buy e-sports products for work or games. The e-sports industry not only drives the trend of digital competitions, but also drives the advancement of hardware. For gaming players or keyboard enthusiasts, a mechanical keyboard that responds quickly to keystrokes and is durable and reliable even after a large number of hits is absolutely indispensable. In fact, e-sports players usually only use specific keys on the keyboard to play related e-sports games. Currently, most of the keyboards dedicated to gaming use the mechanical structure or material of the keys to shorten the response time of the overall keys. However, it is rare to improve the button scanning method to shorten the response time of a specific button. Therefore, how to provide a way to improve the scanning of specific keys so that the scanning speed of specific keys can be greatly increased will be the focus of this case and the focus of solution.

有鑑於此,本發明實施例提供一種按鍵掃描方法,適用於一個具有多個按鍵的輸入裝置,所述多個按鍵的其中一部分組成第一按鍵組,所述多個按鍵的其中另一部分組成第二按鍵組,且所述輸入裝置還具有用於掃描所述多個按鍵的多條掃描線以及對應所述多個按鍵的多條感應信號線,所述多條掃描線包括第一主掃描線與多條次掃描線,其中所述第一主掃描線電性連接至所述第一按鍵組,所述多條次掃描線電性連接至所述第二按鍵組,所述按鍵掃描方法包括:執行第一掃描模式,所述第一掃描模式包括:執行第一掃描程式,所述第一掃描程式包括觸發所述第一主掃描線,並讀取所述多條感應信號線的電信號,以判斷所述第一按鍵組中是否有按鍵被觸發;以及執行第二掃描程式,所述第二掃描程式為觸發所述多條次掃描線的至少其中之一,並讀取所述多條感應信號線的所述電信號,以判斷所述第二按鍵組中是否有按鍵被觸發;其中,所述第一掃描程式與所述第二掃描程式為交替執行,並且每一次掃描線至少被觸發一次。In view of this, an embodiment of the present invention provides a key scanning method, which is suitable for an input device with multiple keys. A part of the keys forms a first key group, and another part of the keys forms a first key group. Two key sets, and the input device further has a plurality of scan lines for scanning the plurality of keys and a plurality of sensing signal lines corresponding to the plurality of keys, and the plurality of scan lines includes a first main scan line And multiple secondary scan lines, wherein the first main scan line is electrically connected to the first button group, and the multiple secondary scan lines are electrically connected to the second button group, and the button scanning method includes : Execute a first scan mode, the first scan mode includes: execute a first scan program, the first scan program includes triggering the first main scan line, and reading the electrical signals of the plurality of sensing signal lines , To determine whether a button in the first button group is triggered; and execute a second scan program, the second scan program is to trigger at least one of the plurality of secondary scan lines, and read the plurality of The electrical signal of a sensing signal line is used to determine whether a button in the second button group is triggered; wherein, the first scan program and the second scan program are executed alternately, and each scan line is at least Is triggered once.

本發明實施例另提供一種使用於按鍵掃描電路的掃描方法,所述按鍵掃描電路可掃描第一按鍵組與第二按鍵組,所述第一按鍵組包含X個優先按鍵,所述第二按鍵組包含Y個次要按鍵,所述按鍵掃描電路包括M條主掃描線Sa(1)至Sa(M)、N條次掃描線Sb(1)至Sb(N)與多條感應信號線,其中X、Y、M、N 為正整數,所述M條主掃描線 Sa(1)至Sa(M)電性連接至所述X個優先按鍵,所述N條次掃描線Sb(1)至Sb(N)電性連接至所述Y個次要按鍵,所述掃描方法包括下列步驟:步驟(1),開始掃描迴圈,設定主掃描次數j的初始值為0;步驟(2a),判斷所述主掃描次數j是否等於主掃描預設上限值Jmax,其中Jmax為正整數,若是,則執行步驟(3),若否,則執行步驟(2b);步驟(2b),輪流觸發所述 M 條主掃描線 Sa(1)至Sa(M) 中的每一條,讀取所述多條感應信號線的電信號,以偵測所述X個優先按鍵中是否有按鍵被觸發;步驟(2c),增加所述主掃描次數 j 的值,其中 j = j + 1,並回到步驟 (2a);步驟(3),輪流觸發所述 N 條次掃描線 Sb(1)至Sb(N) 的其中 P 條次掃描線,讀取所述多條感應信號線的所述電信號,其中,所述P條次掃描線耦接到所述Y個次要按鍵中的 Q個次要按鍵,以偵測所述Q個次要按鍵中是否有按鍵被觸發,其中P < N,且Q < Y,P、Q為正整數;以及步驟(4),於所述掃描迴圈中,判斷所述N條次掃描線 Sb(1)至Sb(N)是否均被觸發過,若是則結束所述掃描迴圈,若否,則設定所述主掃描次數j為0,並回到步驟(2a)。The embodiment of the present invention further provides a scanning method used in a key scanning circuit, the key scanning circuit can scan a first key group and a second key group, the first key group includes X priority keys, the second key The group includes Y secondary keys, and the key scanning circuit includes M main scanning lines Sa(1) to Sa(M), N secondary scanning lines Sb(1) to Sb(N), and multiple sensing signal lines, Wherein X, Y, M, N are positive integers, the M main scan lines Sa(1) to Sa(M) are electrically connected to the X priority buttons, and the N sub scan lines Sb(1) Sb(N) is electrically connected to the Y secondary keys, and the scanning method includes the following steps: step (1), start a scanning loop, and set the initial value of the main scanning number j to 0; step (2a) , Determine whether the main scan times j is equal to the main scan preset upper limit Jmax, where Jmax is a positive integer, if yes, then execute step (3), if not, execute step (2b); step (2b), take turns Trigger each of the M main scan lines Sa(1) to Sa(M), read the electrical signals of the multiple sensing signal lines, to detect whether any of the X priority keys is triggered Step (2c), increase the value of the main scan times j, where j = j + 1, and go back to step (2a); Step (3), trigger the N secondary scan lines Sb(1) to In Sb(N), P secondary scan lines read the electrical signals of the plurality of sensing signal lines, wherein the P secondary scan lines are coupled to Q of the Y secondary keys The secondary key is used to detect whether a key is triggered in the Q secondary keys, where P <N and Q <Y, P and Q are positive integers; and step (4), in the scan loop , Determine whether the N secondary scan lines Sb(1) to Sb(N) have been triggered, if yes, end the scan loop, if not, set the main scan number j to 0, and return Go to step (2a).

本發明實施例提供一種輸入裝置,包括:按鍵掃描電路 ,所述按鍵掃描電路包括M條主掃描線 Sa(1)至Sa(M),N 條次掃描線 Sb(1)至Sb(N) 與多條感應信號線,其中M、N為正整數;第一按鍵組,所述第一按鍵組包含X個優先按鍵,所述M 條主掃描線 Sa(1)至Sa(M) 電性連接至所述X個優先按鍵,其中X為正整數;以及第二按鍵組,所述第二按鍵組包含Y個次要按鍵,所述N條次掃描線 Sb(1)至Sb(N) 電性連接至所述Y個次要按鍵,其中Y 為正整數;其中所述按鍵掃描電路執行下列步驟:步驟(1),開始掃描迴圈,設定主掃描次數 j 的初始值為 0;步驟(2a),判斷所述主掃描次數j是否等於主掃描預設上限值Jmax,其中Jmax為正整數;若是,則執行步驟 (3),若否,則執行步驟(2b);步驟(2b),輪流觸發所述 M 條主掃描線 Sa(1)至Sa(M) 中的每一條, 並讀取所述多條感應信號線的電信號,以偵測所述X個優先按鍵中是否有按鍵被觸發;步驟(2c),增加所述主掃描次數 j 的值,其中 j = j + 1,並回到步驟 (2a);步驟(3),輪流觸發所述N條次掃描線Sb(1)至Sb(N)的其中P條次掃描線,並讀取所述多條感應信號線的所述電信號,其中,所述P條次掃描線為耦接到所述Y個次要按鍵中的Q個次要按鍵,以偵測所述Q個次要按鍵中是否有按鍵被觸發,其中P < N,且Q < Y,P、Q為正整數;以及步驟(4),於所述掃描迴圈中,判斷所述N條次掃描線 Sb(1)至Sb(N)是否均被觸發過,若否,則設定所述主掃描次數j為0,並回到步驟(2a) ,若是,則結束所述掃描迴圈。An embodiment of the present invention provides an input device, including: a key scan circuit, the key scan circuit includes M main scan lines Sa(1) to Sa(M), N sub scan lines Sb(1) to Sb(N) And multiple sensing signal lines, where M and N are positive integers; the first button group, the first button group includes X priority buttons, and the M main scan lines Sa(1) to Sa(M) are electrical Connected to the X priority keys, where X is a positive integer; and a second key group, the second key group includes Y secondary keys, and the N secondary scan lines Sb(1) to Sb(N) Electrically connected to the Y secondary keys, where Y is a positive integer; wherein the key scanning circuit executes the following steps: step (1), start scanning loops, and set the initial value of the number of main scanning j to 0; step (2a), judge whether the main scan times j is equal to the main scan preset upper limit Jmax, where Jmax is a positive integer; if yes, execute step (3), if not, execute step (2b); step (2b) ), trigger each of the M main scan lines Sa(1) to Sa(M) in turn, and read the electrical signals of the multiple sensing signal lines to detect whether the X priority buttons A button is triggered; step (2c), increase the value of the main scan times j, where j = j + 1, and go back to step (2a); step (3), trigger the N secondary scan lines Sb in turn (1) P sub-scanning lines to Sb(N), and reading the electrical signals of the plurality of sensing signal lines, wherein the P sub-scanning lines are coupled to the Y sub-scanning lines The Q secondary buttons to be pressed to detect whether any of the Q secondary buttons are triggered, where P <N, and Q <Y, P and Q are positive integers; and step (4), In the scan loop, determine whether the N secondary scan lines Sb(1) to Sb(N) have been triggered, if not, set the main scan number j to 0, and return to step ( 2a) If yes, end the scanning loop.

本發明實施例另提供一種輸入裝置,包括:按鍵掃描電路 ,所述按鍵掃描電路包括 N+1 條掃描線 Row 0~Row N,與多條感應信號線,N為正整數;其中所述按鍵掃描電路執行下列步驟:步驟(1),開始掃描迴圈,判斷所述輸入裝置目前是否為第一掃描模式、第二掃描模式或第三掃描模式其中之一,據此分別執行步驟(2)、步驟(3)或步驟(4)其中之一;步驟(2),當所述輸入裝置於第一掃描模式時執行:所述按鍵掃描電路輪流觸發所述複數條掃描線 Row 0~Row N 其中之一直到所述複數條掃描線中每一條都被觸發過為止,並讀取所述多條感應信號線的電信號,偵測所述輸入裝置中是否有按鍵被觸發,並結束所述掃描迴圈;步驟(3),當所述輸入裝置於第二掃描模式時執行:步驟(3a),所述按鍵掃描電路將掃描線 Row 0定義為第一主掃描線 Sa(1)、並將掃描線 Row 1~Row N 定義為 N 條次掃描線 Sb(1) 至 Sb(N);步驟(3b),所述按鍵掃描電路將電性連接至所述第一主掃描線 Sa(1) 的 X1 個按鍵定義為第一按鍵組,並將未電性連接至所述第一主掃描線 Sa(1) 的其餘 Y1 個按鍵定義為第二按鍵組,X1、Y1為正整數;步驟(3c),設定主掃描次數 j 的初始值為 0;步驟(3d),判斷所述主掃描次數j是否等於預設上限值Jmax,其中預設上限值Jmax為正整數;若是,則執行步驟 (3g),若否,則執行步驟(3e);步驟(3e),觸發所述第一主掃描線 Sa(1),讀取所述多條感應信號線的所述電信號,偵測所述X1個優先按鍵中是否有按鍵被觸發; 步驟(3f),增加所述主掃描次數 j 的值,其中 j = j + 1,並回到步驟 (3d);步驟(3g),輪流觸發所述 N 條次掃描線Sb(1)至Sb(N)的其中 P 條,其中,所述P條次掃描線為耦接到所述Y1個次要按鍵中的Q個次要按鍵,讀取所述多條感應信號線的所述電信號,偵測所述Q個次要按鍵中是否有按鍵被觸發,其中P < N、Q < Y1,P、Q為正整數;步驟(3i),判斷所述N條次掃描線Sb(1)至Sb(N)是否均被觸發過,若否,則設定所述主掃描次數j為0,並回到步驟(3d) ,若是,則結束所述掃描迴圈;步驟(4),當所述輸入裝置於第三掃描模式時執行:步驟(4a),所述按鍵掃描電路將掃描線 Row 0~Row 1定義為兩條主掃描線 Sa(1)~Sa(2)、並將掃描線 Row 2~Row N 定義為 N-1 條次掃描線 Sb(1)至Sb(N-1);步驟(4b),所述按鍵掃描電路將電性連接至所述兩條主掃描線 Sa(1)~Sa(2) 的 X2 個按鍵定義為第一按鍵組,並將未電性連接至所述兩條主掃描線 Sa(1)~Sa(2) 的其餘 Y2 個按鍵定義為第二按鍵組,X2、Y2為正整數;步驟(4c),設定主掃描次數 j 的初始值為 0;步驟(4d),判斷所述主掃描次數j是否等於預設上限值Jmax,其中預設上限值Jmax為正整數,若是,則執行步驟 (4g),若否,則執行步驟(4e);步驟(4e),輪流觸發所述兩條主掃描線 Sa(1)~Sa(2),讀取所述多條感應信號線的所述電信號,偵測所述X2個優先按鍵中是否有按鍵被觸發;步驟(4f),增加所述主掃描次數 j 的值,其中 j = j + 1,並回到步驟 (4d);步驟(4g),輪流觸發所述 N-1 條次掃描線Sb(1)至Sb(N-1)的其中 P 條,所述P條次掃描線是耦接到所述Y2個次要按鍵中的Q個次要按鍵,並讀取所述多條感應信號線的所述電信號,偵測所述Q個次要按鍵中是否有按鍵被觸發,其中P < N-1、Q < Y2,P、Q為正整數;以及步驟(4h),判斷所述N-1條次掃描線Sb(1)至Sb(N-1)是否均被觸發過,若否,則設定所述主掃描次數j為0,並回到步驟(4d),若是,則結束所述掃描迴圈。An embodiment of the present invention further provides an input device, including: a key scanning circuit, the key scanning circuit includes N+1 scanning lines Row 0 ~ Row N, and a plurality of sensing signal lines, N is a positive integer; wherein the key The scanning circuit executes the following steps: step (1), start a scanning loop, determine whether the input device is currently in one of the first scanning mode, the second scanning mode or the third scanning mode, and perform step (2) accordingly One of step (3) or step (4); step (2), executed when the input device is in the first scan mode: the key scan circuit triggers the plurality of scan lines Row 0~Row N in turn One of them until each of the plurality of scan lines is triggered, and read the electrical signals of the plurality of sensing signal lines, detect whether a button in the input device is triggered, and end the Scan loop; step (3), executed when the input device is in the second scan mode: step (3a), the key scan circuit defines the scan line Row 0 as the first main scan line Sa(1), and The scan lines Row 1~Row N are defined as N secondary scan lines Sb(1) to Sb(N); step (3b), the key scan circuit is electrically connected to the first main scan line Sa(1) ) X1 buttons are defined as the first button group, and the remaining Y1 buttons that are not electrically connected to the first main scan line Sa(1) are defined as the second button group, and X1 and Y1 are positive integers; step (3c), set the initial value of the main scan number j to 0; step (3d), determine whether the main scan number j is equal to the preset upper limit Jmax, where the preset upper limit Jmax is a positive integer; if so, then Perform step (3g), if not, perform step (3e); step (3e), trigger the first main scan line Sa(1), read the electrical signals of the multiple sensing signal lines, and detect Measure whether any of the X1 priority buttons are triggered; step (3f), increase the value of the main scan times j, where j = j + 1, and go back to step (3d); step (3g), take turns Triggering P of the N secondary scan lines Sb(1) to Sb(N), wherein the P secondary scan lines are Q secondary buttons coupled to the Y1 secondary buttons, Read the electrical signals of the plurality of sensing signal lines, and detect whether any of the Q secondary keys is triggered, where P <N, Q <Y1, P and Q are positive integers; step (3i ), determine whether the N sub-scanning lines Sb(1) to Sb(N) have been triggered, if not, set the main scan times j to 0, and return to step (3d), if yes, then End the scan loop; step (4), when the input device is in the third scan mode, execute: step (4a), the key scan circuit defines scan lines Row 0 ~ Row 1 as two main scan lines Sa( 1)~Sa(2), and define scan lines Row 2~Row N as N-1 secondary scan lines Sb(1) to Sb(N-1); step (4b), the key scan circuit The X2 buttons that are electrically connected to the two main scan lines Sa(1)~Sa(2) are defined as the first button group, and are electrically connected to the two main scan lines Sa(1)~Sa (2) The remaining Y2 buttons are defined as the second button group, X2 and Y2 are positive integers; step (4c), set the initial value of the main scan number j to 0; step (4d), determine the main scan number j Whether it is equal to the preset upper limit value Jmax, where the preset upper limit value Jmax is a positive integer, if yes, execute step (4g), if not, execute step (4e); step (4e), trigger the two in turn The main scan lines Sa(1)~Sa(2), read the electrical signals of the multiple sensing signal lines, and detect whether any of the X2 priority keys is triggered; step (4f), add all The value of the number of main scans j, where j = j + 1, and return to step (4d); step (4g), trigger the N-1 secondary scan lines Sb(1) to Sb(N-1) in turn Among them, P, the P secondary scan lines are coupled to the Q secondary buttons of the Y2 secondary buttons, and read the electrical signals of the multiple sensing signal lines to detect all Whether any of the Q secondary keys are triggered, where P <N-1, Q <Y2, and P and Q are positive integers; and step (4h), determine the N-1 secondary scan lines Sb(1 ) To Sb(N-1) have been triggered, if not, set the main scan number j to 0, and return to step (4d), if yes, end the scan loop.

本發明實施例所提供的按鍵掃描方法、使用於按鍵掃描電路的掃描方法及輸入裝置,藉由對關鍵按鍵或者常用按鍵進行穿插式的多次掃描,也就對這些關鍵按鍵所耦接的掃描線增加掃描的次數,以達到縮短這些關鍵按鍵的掃描週期,以對這些關鍵按鍵進行更快速度的掃描。藉此,大幅度地縮短這些關鍵按鍵的掃描時間,同時加快這些關鍵按鍵的反應時間。In the key scanning method, the scanning method used in the key scanning circuit, and the input device provided by the embodiments of the present invention, the key keys or common keys are scanned multiple times, and the key keys are scanned The line increases the number of scans to shorten the scan period of these key keys, so as to scan these key keys at a faster speed. In this way, the scanning time of these key keys is greatly shortened, and the reaction time of these key keys is accelerated.

上述說明僅是本發明技術方案的概述,為了能夠更清楚瞭解本發明的技術手段,而可依照說明書的內容予以實施,並且為了讓本發明的上述和其他目的、特徵和優點能夠更明顯易懂,以下特舉較佳實施例,並配合附圖,詳細說明如下。為讓本發明之上述和其他目的、特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式,作詳細說明如下。The above description is only an overview of the technical solution of the present invention. In order to understand the technical means of the present invention more clearly, it can be implemented in accordance with the content of the specification, and to make the above and other objectives, features and advantages of the present invention more obvious and understandable. In the following, the preferred embodiments are cited in conjunction with the drawings, and the detailed description is as follows. In order to make the above and other objects, features and advantages of the present invention more comprehensible, the following specific examples are given in conjunction with the accompanying drawings to describe in detail as follows.

本發明實施例所提供的按鍵掃描方法、使用於按鍵掃描電路的掃描方法及輸入裝置,其可應用於諸如桌上型電腦、筆記型電腦或其他使用到鍵盤的電子產品。藉由針對關鍵按鍵或者常用按鍵進行穿插式的多次掃描,以縮短該些關鍵按鍵連續兩次掃描的間隔時間,使這些關鍵按鍵在單位時間內能有較多的掃描次數,亦即能以更高的頻率掃描這些關鍵按鍵。藉此,大幅度地縮短這些關鍵按鍵連續兩次被掃描的間隔時間,同時縮短這些關鍵按鍵的反應時間.如此當使用者按壓這些關鍵按鍵時,使用者按壓關鍵按鍵的機械動作,能更快地轉換為電信號,更迅速地輸入給在主機中執行的電競遊戲或者文書處理軟體。本發明實施例利用儲存用於執行按鍵掃描方法的指令的儲存裝置,並通過電性連接至儲存裝置的處理器,來執行程式的指令以控制、觸發或偵測輸入裝置的按鍵掃描電路以進行多個運作。The key scanning method, the scanning method used in the key scanning circuit, and the input device provided by the embodiments of the present invention can be applied to a desktop computer, a notebook computer, or other electronic products that use a keyboard. By interspersing multiple scans for key keys or frequently used keys, the interval between two consecutive scans of these key keys can be shortened, so that these key keys can have more scan times per unit time, which means that Scan these key keys at a higher frequency. This greatly shortens the interval between two consecutive scans of these key keys, and shortens the response time of these key keys. In this way, when the user presses these key buttons, the mechanical action of the user pressing the key buttons can be converted into electrical signals more quickly, which can be input to the e-sports game or word processing software running in the host more quickly. The embodiment of the present invention utilizes a storage device that stores instructions for executing the key scan method, and is electrically connected to a processor of the storage device to execute program instructions to control, trigger, or detect the key scan circuit of the input device to perform Multiple operations.

請參閱圖1,圖1是依照本發明實施例所繪示的執行第一掃描模式與第二掃描模式的按鍵掃描方法的流程示意圖,並同時參閱圖4A至圖6以便理解鍵盤按鍵掃描的運作流程。圖4A是依照本發明另一實施例所繪示鍵盤可使用的6*21按鍵矩陣的示意圖,圖4B是依照本發明另一實施例所繪示第一掃描模式的鍵盤可使用6*21按鍵矩陣的示意圖,圖4C是依照本發明另一實施例所繪示第二掃描模式的鍵盤可使用6*21按鍵矩陣的示意圖。圖5是依照本發明實施例所繪示一鍵盤輸入裝置的方塊示意圖,所述輸入裝置具有兩種掃描模式,分別對應兩個按鍵組。圖6是依照本發明另一鍵盤輸入裝置的方塊示意圖,所述輸入裝置具有三種掃描模式,分別對應三個按鍵組。Please refer to FIG. 1. FIG. 1 is a flowchart of a key scanning method for executing the first scan mode and the second scan mode according to an embodiment of the present invention, and also refer to FIGS. 4A to 6 to understand the operation of the keyboard key scanning Process. FIG. 4A is a schematic diagram of a 6*21 key matrix that can be used by a keyboard according to another embodiment of the present invention, and FIG. 4B is a keyboard that can use 6*21 keys in the first scan mode according to another embodiment of the present invention A schematic diagram of a matrix. FIG. 4C is a schematic diagram illustrating that a keyboard in the second scan mode can use a 6*21 key matrix according to another embodiment of the present invention. Fig. 5 is a block diagram of a keyboard input device according to an embodiment of the present invention. The input device has two scanning modes, corresponding to two key groups respectively. 6 is a block diagram of another keyboard input device according to the present invention. The input device has three scanning modes, corresponding to three key groups respectively.

在本實施例中,一種按鍵掃描方法,適用於一個具有多個按鍵的輸入裝置,上述多個按鍵的其中一部分組成第一按鍵組10,上述多個按鍵的其中另一部分組成第二按鍵組20,且輸入裝置具有用於掃描上述多個按鍵的多條掃描線,多條掃描線包括第一主掃描線Sa(1)與多條次掃描線Sb(1)至Sb(N),其中第一主掃描線Sa(1)電性連接至第一按鍵組10(具體為連接至上述第一按鍵組10所包含的多個按鍵),上述多條次掃描線Sb(1)至Sb(N)電性連接至第二按鍵組20(具體為連接至上述第二按鍵組20所包含的多個按鍵)。In this embodiment, a key scanning method is applicable to an input device with multiple keys. A part of the keys forms the first key group 10, and the other part of the keys forms the second key group 20. , And the input device has multiple scan lines for scanning the multiple keys, the multiple scan lines include a first main scan line Sa(1) and a plurality of sub scan lines Sb(1) to Sb(N). A main scanning line Sa(1) is electrically connected to the first button group 10 (specifically connected to the plurality of buttons included in the first button group 10), and the plurality of sub-scanning lines Sb(1) to Sb(N ) Is electrically connected to the second button group 20 (specifically, connected to the plurality of buttons included in the second button group 20).

上述多個按鍵的排列形式為矩陣,由R列和C行所組成,其中R與C為大於等於2的正整數。輸入裝置除了具有上述多條掃描線外,還具有對應多個按鍵的多條感應信號線SS。實際操作中,多條掃描線對應矩陣的第1列至第R列設置,多條感應信號線SS對應矩陣的第1行至第C行設置。以一般較多人使用的104鍵的鍵盤為例,目前較常使用的矩陣大小為  6列*21行(亦即R為6,而C為21),則輸入裝置可具有6條掃描線以及21條感應信號線。如圖4A所示,當輸入裝置處於一般掃描模式時,輪流觸發六條掃描線的順序為:Row0 -> Row1-> Row2-> 直到 Row5為止,如此當完成一個掃描迴圈,六條掃描線中每一條均被觸發相同的次數。如圖4B所示,當輸入裝置處於電競掃描模式時,按鍵掃描電路會將六條掃描線加以分類,設定 Row0 為第一主掃描線Sa(1),且設定 Row1~Row5 為五條次掃描線Sb(1)至Sb(5)。舉例來說,第一按鍵組10所包含的多個按鍵為電競遊戲操作時會經常使用到的特定按鍵,例如“W”、“A”、“S”、“D”四個英文字母鍵與“上 ”、“下”、“左”、“右”四個方向鍵,並且這些按鍵可以是設置在矩陣的第一列Row0 (亦即對應前述第一主掃描線Sa(1))。其餘電競遊戲操作時不常使用的按鍵則可以設置在矩陣的第二列至第六列Row1至Row5 (亦即對應前述次掃描線Sb(1)至Sb(5))。如稍後圖8示意的流程圖所描述,當完成一個掃描迴圈,第一主掃描線Sa(1)的被觸發掃描次數高於次掃描線Sb(1)至Sb(5)中每一條的被觸發掃描次數。上述多條次掃描線Sb(1)至Sb(N)的列序,亦即Sb(1)至Sb(5),排在第一主掃描線Sa(1)的列序之後,亦即,多條次掃描線Sb(1)至Sb(N)的掃描排列優先順序排在第一主掃描線Sa(1)的掃描排列優先順序之後。而上述多條感應信號線SS對應矩陣的第一行至第C行設置,也就是對應矩陣的第一行至第二十一行(亦即Col.0至Col.20)設置。The arrangement of the above-mentioned multiple keys is a matrix consisting of R columns and C rows, where R and C are positive integers greater than or equal to 2. In addition to the above-mentioned multiple scan lines, the input device also has multiple sensing signal lines SS corresponding to multiple keys. In actual operation, multiple scan lines are arranged corresponding to the first column to the Rth column of the matrix, and multiple sensing signal lines SS are arranged corresponding to the first row to the Cth row of the matrix. Taking the 104-key keyboard commonly used by more people as an example, the matrix size currently used more frequently is 6 columns * 21 rows (that is, R is 6 and C is 21), and the input device can have 6 scan lines and 21 sensing signal lines. As shown in Figure 4A, when the input device is in the general scan mode, the sequence of triggering six scan lines in turn is: Row0 -> Row1-> Row2-> until Row5, so when a scan loop is completed, six scan lines Each of them is triggered the same number of times. As shown in Figure 4B, when the input device is in the gaming scan mode, the key scan circuit will classify six scan lines, set Row0 as the first main scan line Sa(1), and set Row1~Row5 as five sub scans Lines Sb(1) to Sb(5). For example, the multiple buttons included in the first button group 10 are specific buttons that are frequently used in gaming games, such as "W", "A", "S", and "D" four English letter keys There are four direction keys "up", "down", "left" and "right", and these keys can be arranged in the first row of the matrix Row0 (that is, corresponding to the aforementioned first main scan line Sa(1)). The other keys that are not frequently used during gaming operations can be arranged in the second to sixth rows Row1 to Row5 of the matrix (that is, corresponding to the aforementioned secondary scan lines Sb(1) to Sb(5)). As described in the flowchart shown in Fig. 8 later, when a scan loop is completed, the number of triggered scans of the first main scan line Sa(1) is higher than each of the sub scan lines Sb(1) to Sb(5) The number of triggered scans. The column sequence of the multiple sub-scanning lines Sb(1) to Sb(N), that is, Sb(1) to Sb(5), is arranged after the column sequence of the first main scanning line Sa(1), that is, The priority order of scanning arrangement of the plurality of sub-scanning lines Sb(1) to Sb(N) is lower than the order of scanning arrangement priority of the first main scanning line Sa(1). The multiple sensing signal lines SS are arranged corresponding to the first row to the Cth row of the matrix, that is, corresponding to the first row to the twenty-first row (ie, Col. 0 to Col. 20) of the matrix.

若輸入裝置同時兼具電競掃描模式與稍後描述的文書掃描模式,則可參閱圖4C來設置第一列與第二列按鍵。如圖4C所示,當輸入裝置處於文書掃描模式時,按鍵掃描電路會將六條掃描線加以分類,會設定Row0至Row1為兩條主掃描線Sa(1) 至Sa(2)(可分別定義為第一主掃描線Sa(1)和第二主掃描線Sa(2)),且設定 Row2至Row5 為四條次掃描線Sb(1)至Sb(4);舉例來說,第一按鍵組10包含文書操作時經常使用到的按鍵,例如至少包含 "A至Z" 26 個英文字母鍵,並且這些按鍵可以是設置在矩陣的Row0至Row1上 (亦即對應前述兩條主掃描線Sa(1) 至Sa(2))。其餘文書處理操作時不常使用的按鍵則可以設置在矩陣的第三列至第六列Row2至Row5 (亦即對應前述次掃描線Sb(1) 至Sb(4))。如稍後圖9示意的流程圖所描述,當完成一個掃描迴圈,兩條主掃描線Sa(1) 至Sa(2)中每一條的被觸發掃描次數高於次掃描線Sb(1)至Sb(4)中每一條的被觸發掃描次數。If the input device has both an e-sports scanning mode and a document scanning mode described later, you can refer to FIG. 4C to set the first row and the second row of buttons. As shown in Figure 4C, when the input device is in the document scanning mode, the key scanning circuit will classify the six scanning lines and set Row0 to Row1 as the two main scanning lines Sa(1) to Sa(2) (can be separately Defined as the first main scan line Sa(1) and the second main scan line Sa(2)), and set Row2 to Row5 as four sub scan lines Sb(1) to Sb(4); for example, the first button Group 10 contains keys that are frequently used in clerical operations, such as at least 26 English letter keys "A to Z", and these keys can be set on Row0 to Row1 of the matrix (that is, corresponding to the two main scan lines Sa (1) to Sa(2)). Other keys that are not frequently used in word processing operations can be arranged in the third to sixth rows Row2 to Row5 of the matrix (that is, corresponding to the aforementioned secondary scan lines Sb(1) to Sb(4)). As described in the flowchart shown in Fig. 9 later, when a scan loop is completed, the number of triggered scans for each of the two main scan lines Sa(1) to Sa(2) is higher than that of the secondary scan line Sb(1) The number of triggered scans for each item in Sb(4).

如圖1所示,本發明實施例可實際應用於具有兩種掃描模式的鍵盤,例如是一般掃描模式(簡稱為一般模式)與電競掃描模式(簡稱為電競模式)。在步驟S200中,設定掃描模式可以是系統以自動偵測並自動判斷的方式執行掃描模式的設定,例如系統偵測到使用者開啟遊戲,此時系統便會自動將掃描模式設定為第一掃描模式(電競模式)。當然也可以是使用者以手動的方式執行掃描模式的設定。在步驟S210中,在執行第一掃描模式或第二掃描模式的步驟前,所述方法進一步包括判斷第一掃描模式與第二掃描模式何者被致能,也就是要執行哪一個模式。第二掃描模式可以是一般模式。在步驟S220中,若第一掃描模式被致能,則執行第一掃描模式,如步驟S221至S223所示。反之,在步驟S230中,若第二掃描模式被致能,則執行第二掃描模式。As shown in FIG. 1, the embodiment of the present invention can be practically applied to a keyboard having two scanning modes, for example, a general scanning mode (referred to as a general mode) and a gaming scanning mode (referred to as a gaming mode). In step S200, setting the scan mode can be that the system executes the scan mode setting by automatic detection and automatic judgment. For example, when the system detects that the user starts the game, the system will automatically set the scan mode to the first scan. Mode (e-sports mode). Of course, the user can also manually set the scan mode. In step S210, before executing the first scan mode or the second scan mode, the method further includes determining which of the first scan mode and the second scan mode is enabled, that is, which mode is to be executed. The second scan mode may be a general mode. In step S220, if the first scan mode is enabled, the first scan mode is executed, as shown in steps S221 to S223. Conversely, in step S230, if the second scan mode is enabled, the second scan mode is executed.

接著,請同時參閱圖1、圖4B與圖5,以便理解第一掃描模式的運作流程。在步驟S220中,按鍵掃描方法包括執行第一掃描模式,第一掃描模式可以是電競模式,第一按鍵組10包含電競操作時經常使用到的多個按鍵,例如至少包括“W”、“A”、“S”、“D”四個英文字母鍵,並且這些按鍵電性連接至第一主掃描線Sa(1),第二按鍵組20可為除此之外的其他一些按鍵。在步驟S221中,第一掃描模式包括執行第一掃描程式,第一掃描程式包括觸發第一主掃描線Sa(1),並讀取多條感應信號線SS的電信號,以判斷第一按鍵組10中是否有按鍵被觸發。在步驟S222中,執行第二掃描程式,第二掃描程式為觸發上述多個次掃描線Sb(1)至Sb(N)的至少其中之一,並讀取上述多條感應信號線SS的電信號,以判斷第二按鍵組20中是否有按鍵被觸發。舉例來說,以按鍵的電壓準位是否為高準位作為判斷此按鍵是否被按壓的例子來說明。若使用者只按壓“W”、“A”、“S”、“D”這四個英文字母鍵的按鍵。也就是說,在觸發第一主掃描線Sa(1)的同時,讀取二十一個感應信號線SS的電信號,結果只有第一至第四個感應信號線SS(亦即Col.0至Col.3)的電壓準位是高準位,而其餘的是低準位,此時便可以判斷是“W”、“A”、“S”、“D”這四個英文字母鍵被按壓。換言之,第一掃描程式的階段便可立即知道是這四個英文字母鍵被按壓,而不用等到第二掃描程式的階段才得知。因此可以通過軟體的方式縮短特定按鍵的反應時間,提升反應速度。Next, please refer to FIG. 1, FIG. 4B and FIG. 5 at the same time to understand the operation flow of the first scanning mode. In step S220, the button scanning method includes executing a first scanning mode, the first scanning mode may be a gaming mode, and the first button group 10 includes a plurality of buttons frequently used in gaming operations, such as at least "W", There are four English letter keys "A", "S", and "D", and these keys are electrically connected to the first main scan line Sa(1), and the second key group 20 can be other keys. In step S221, the first scan mode includes executing a first scan program, the first scan program includes triggering the first main scan line Sa(1), and reading the electrical signals of the multiple sensing signal lines SS to determine the first button Whether any key in group 10 is triggered. In step S222, a second scan program is executed. The second scan program is to trigger at least one of the plurality of sub-scanning lines Sb(1) to Sb(N), and to read the electrical power of the plurality of sensing signal lines SS. Signal to determine whether a button in the second button group 20 is triggered. For example, take whether the voltage level of a button is a high level as an example to determine whether the button is pressed. If the user only presses the four English letter keys "W", "A", "S", and "D". That is to say, when the first main scanning line Sa(1) is triggered, the electrical signals of the twenty-one sensing signal lines SS are read, and as a result, only the first to fourth sensing signal lines SS (ie, Col. 0 The voltage level to Col.3) is the high level, and the rest are the low level. At this time, it can be judged that the four English letter keys "W", "A", "S", and "D" are Press. In other words, the stage of the first scanning program can immediately know that the four English letter keys are pressed, without waiting until the stage of the second scanning program. Therefore, the response time of specific keys can be shortened by software, and the response speed can be improved.

在步驟S223中,第一掃描程式與第二掃描程式為交替執行,並且每一個次掃描線Sb(1)至Sb(N)至少被觸發一次。也就是說,第一掃描程式與第二掃描程式為穿插式、交替式的掃描方式。例如,可以是第一主掃描線Sa(1)搭配一個次掃描線;也可以是第一主掃描線Sa(1)搭配兩個次掃描線;或者可以是第一主掃描線Sa(1)搭配三個次掃描線等等。以第一主掃描線Sa(1)搭配一個次掃描線為例子,可以是先觸發第一主掃描線Sa(1),接著觸發次掃描線Sb(1);然後觸發第一主掃描線Sa(1),再接著觸發次掃描線Sb(2);緊接著觸發第一主掃描線Sa(1),然後觸發次掃描線Sb(3);接著觸發第一主掃描線Sa(1),然後觸發次掃描線Sb(3);再接著觸發第一主掃描線Sa(1),緊接著觸發次掃描線Sb(4);然後觸發第一主掃描線Sa(1),接著觸發次掃描線Sb(5),從而完成一個掃描迴圈,以此類推,再繼續地迴圈下一個掃描迴圈。假設觸發掃描線的時間T為0.5ms,則在第一掃描模式時,第一按鍵組10的掃描迴圈為1ms(2T),亦即每1ms會掃描第一按鍵組10一次;第二按鍵組20的掃描迴圈為5ms(10T),亦即每5ms會掃描第二按鍵組20一次。藉此,大幅度地縮短第一按鍵組10的掃描迴圈,同時縮短第一按鍵組10的按鍵反應時間。In step S223, the first scanning program and the second scanning program are executed alternately, and each sub-scanning line Sb(1) to Sb(N) is triggered at least once. In other words, the first scanning program and the second scanning program are interleaved and alternate scanning methods. For example, it can be the first main scan line Sa(1) with one sub scan line; it can also be the first main scan line Sa(1) with two sub scan lines; or it can be the first main scan line Sa(1) With three secondary scan lines and so on. Taking the first main scan line Sa(1) with a sub scan line as an example, the first main scan line Sa(1) can be triggered first, then the sub scan line Sb(1) is triggered; then the first main scan line Sa is triggered (1), then trigger the secondary scan line Sb(2); then trigger the first main scan line Sa(1), then trigger the secondary scan line Sb(3); then trigger the first main scan line Sa(1), Then trigger the secondary scan line Sb(3); then trigger the first main scan line Sa(1), then trigger the secondary scan line Sb(4); then trigger the first main scan line Sa(1), then trigger the secondary scan Line Sb(5), thus completing a scan loop, and so on, and then continue to loop the next scan loop. Assuming that the time T to trigger the scan line is 0.5ms, in the first scan mode, the scan loop of the first button group 10 is 1ms (2T), that is, the first button group 10 is scanned once every 1ms; the second button The scan loop of group 20 is 5ms (10T), that is, the second key group 20 is scanned every 5ms. In this way, the scanning loop of the first button group 10 is greatly shortened, and the button response time of the first button group 10 is shortened.

若第二掃描模式被致能,則執行第二掃描模式,如步驟S230所示。請同時參閱圖1與圖4A,以便理解第二掃描模式的運作流程。在步驟S231中,第二掃描模式包括交替執行第一掃描程式與第三掃描程式,第三掃描程式包括依序觸發上述多個次掃描線Sb(1)至Sb(N),並讀取上述多條感應信號線SS的電信號,以判斷第二按鍵組20中是否有按鍵被觸發。也就是說,第一掃描程式與第三掃描程式為穿插式、交替式的掃描方式。例如,先觸發第一主掃描線Sa(1),接著可以是依序觸發次掃描線Sb(1)至Sb(N),從而完成一個掃描迴圈,以此類推,再繼續地迴圈下一個掃描迴圈。If the second scan mode is enabled, the second scan mode is executed, as shown in step S230. Please refer to FIG. 1 and FIG. 4A at the same time to understand the operation flow of the second scanning mode. In step S231, the second scan mode includes alternately executing the first scan program and the third scan program. The third scan program includes sequentially triggering the plurality of sub-scanning lines Sb(1) to Sb(N), and reading the The electrical signals of the plurality of signal lines SS are sensed to determine whether a button in the second button group 20 is triggered. In other words, the first scanning program and the third scanning program are interleaved and alternate scanning methods. For example, the first main scan line Sa(1) is triggered first, and then the sub scan lines Sb(1) to Sb(N) may be triggered in sequence to complete a scan loop, and so on, and then continue to loop down A scan loop.

然後,請同時參閱圖2、圖4C與圖6,以便理解第三掃描模式的運作流程。圖2是依照本發明實施例所繪示的執行第一掃描模式、第二掃描模式與第三掃描模式的按鍵掃描方法的流程示意圖,亦即電競模式、一般模式與文書掃描模式(簡稱文書模式)的實施例。本發明實施例中,前述鍵盤上的多個按鍵的其中又一部分組成第三按鍵組30,且用於掃描上述多個按鍵的多個掃描線中除了第一主掃描線Sa(1)外,還包括第二主掃描線 Sa(2),第二主掃描線 Sa(2)電性連接至第三按鍵組30(具體為連接至上述第三按鍵組30所包含的多個按鍵),按鍵掃描方法進一步包括第三掃描模式,且對應在圖1判斷第一掃描模式(亦即電競模式)與第二掃描模式(亦即一般模式)何者被致能的步驟中,圖2所示的方法進一步包括判斷第三掃描模式是否被致能。若第三掃描模式被致能,則執行第三掃描模式(亦即文書模式)。需注意的是,有關步驟S220至S231的第一掃描模式與第二掃描模式的按鍵掃描方法已於前述實施例所詳加敘述,在此不再贅述。Then, please refer to FIG. 2, FIG. 4C and FIG. 6 at the same time to understand the operation flow of the third scanning mode. 2 is a schematic flowchart of a key scanning method for executing the first scan mode, the second scan mode, and the third scan mode according to an embodiment of the present invention, that is, the e-sports mode, the general mode, and the document scanning mode (referred to as document scanning mode) Mode). In the embodiment of the present invention, another part of the plurality of keys on the aforementioned keyboard forms the third key group 30, and among the plurality of scan lines used to scan the plurality of keys, except for the first main scan line Sa(1), It also includes a second main scan line Sa(2), the second main scan line Sa(2) is electrically connected to the third button group 30 (specifically connected to the multiple buttons included in the third button group 30), and the button The scanning method further includes a third scanning mode, and corresponds to the step of determining which of the first scanning mode (that is, the gaming mode) and the second scanning mode (that is, the normal mode) is enabled in FIG. 1, as shown in FIG. The method further includes determining whether the third scan mode is enabled. If the third scan mode is enabled, the third scan mode (ie, document mode) is executed. It should be noted that the key scanning methods related to the first scanning mode and the second scanning mode of steps S220 to S231 have been described in detail in the foregoing embodiment, and will not be repeated here.

在步驟S300中,設定掃描模式可以是系統以自動偵測並自動判斷的方式執行掃描模式的設定,例如系統偵測到使用者開啟文書處理軟體,此時系統便會自動將掃描模式設定為第三掃描模式。或者可以是使用者以手動的方式執行掃描模式的設定。在步驟S310中,按鍵掃描方法包括判斷第一掃描模式、第二掃描模式與第三掃描模式何者被致能。在步驟S340中,若第三掃描模式被致能,則執行第三掃描模式。In step S300, setting the scan mode can be that the system executes the scan mode setting by automatic detection and automatic judgment. For example, when the system detects that the user has opened the word processing software, the system will automatically set the scan mode to the first Three scan mode. Or the user can manually set the scan mode. In step S310, the key scan method includes determining which of the first scan mode, the second scan mode, and the third scan mode is enabled. In step S340, if the third scan mode is enabled, the third scan mode is executed.

接著,在步驟S341中,第三掃描模式包括執行第一掃描程式(具體執行內容可如步驟S221所示);接著執行第四掃描程式,第四掃描程式包括觸發第二主掃描線 Sa(2),並讀取多條感應信號線SS的電信號,以判斷第三按鍵組30中是否有按鍵被觸發;接著執行第二掃描程式(具體執行內容可如步驟S222所示)。此外,第一掃描程式、第四掃描程式與第二掃描程式為交替執行,並且每一個次掃描線Sb(1)至Sb(N)至少被觸發一次。需注意的是,第一按鍵組10的使用頻率比第三按鍵組30的使用頻率高。第二主掃描線 Sa(2)的列序排在第一主掃描線Sa(1)的列序之後,上述多個次掃描線Sb(1)至Sb(N)的列序排在第二主掃描線 Sa(2)的列序之後。Then, in step S341, the third scan mode includes executing the first scan program (the specific execution content can be as shown in step S221); and then executes the fourth scan program, which includes triggering the second main scan line Sa(2 ), and read the electrical signals of the multiple sensing signal lines SS to determine whether a button in the third button group 30 is triggered; and then execute the second scanning program (the specific execution content can be shown in step S222). In addition, the first scan program, the fourth scan program, and the second scan program are executed alternately, and each scan line Sb(1) to Sb(N) is triggered at least once. It should be noted that the frequency of use of the first button group 10 is higher than that of the third button group 30. The column order of the second main scanning line Sa(2) is arranged after the column order of the first main scanning line Sa(1), and the column order of the plurality of sub-scanning lines Sb(1) to Sb(N) is arranged second After the main scan line Sa(2) in the column order.

實際操作中,本發明實施例可實際應用於具有兩種掃描模式的鍵盤,例如是電競掃描模式(簡稱為電競模式)與文書掃描模式(簡稱為文書模式)。同樣的,設定掃描模式可以是系統以自動偵測並自動判斷的方式執行掃描模式的設定,例如系統偵測到使用者開啟遊戲,此時系統便會自動將掃描模式設定為第一掃描模式(電競模式)。當然也可以是使用者以手動的方式執行掃描模式的設定。在執行第一掃描模式或第三掃描模式的步驟前,所述方法進一步包括判斷第一掃描模式與第三掃描模式何者被致能,也就是要執行哪一個模式。若第一掃描模式被致能,則執行第一掃描模式;若第三掃描模式被致能,則執行第三掃描模式,第三掃描模式包括:先執行第一掃描程式;接著執行第四掃描程式,第四掃描程式包括觸發第二主掃描線Sa(2),並讀取多條感應信號線SS的電信號,以判斷第三按鍵組中是否有按鍵被觸發;然後執行第二掃描程式;其中,第一掃描程式、第四掃描程式與第二掃描程式為交替執行,並且每一次掃描線至少被觸發一次。In actual operation, the embodiment of the present invention can be practically applied to a keyboard with two scanning modes, for example, an e-sports scanning mode (referred to as an e-sports mode) and a document scanning mode (referred to as a document mode). Similarly, setting the scan mode can be that the system executes the scan mode setting by automatically detecting and automatically determining. For example, when the system detects that the user starts the game, the system will automatically set the scan mode to the first scan mode ( E-sports mode). Of course, the user can also manually set the scan mode. Before the step of executing the first scan mode or the third scan mode, the method further includes determining which of the first scan mode and the third scan mode is enabled, that is, which mode is to be executed. If the first scan mode is enabled, the first scan mode is executed; if the third scan mode is enabled, the third scan mode is executed. The third scan mode includes: first execute the first scan program; then execute the fourth scan Program, the fourth scan program includes triggering the second main scan line Sa(2), and reading the electrical signals of the multiple sensing signal lines SS to determine whether a button in the third button group is triggered; then execute the second scan program ; Among them, the first scan program, the fourth scan program and the second scan program are alternately executed, and each scan line is triggered at least once.

然後,請參閱圖3,並同時參閱圖4A至圖5以便理解按鍵掃描的運作流程。圖3是依照本發明另一實施例所繪示的使用於按鍵掃描電路的掃描方法的流程示意圖,需注意的是,由於使用於按鍵掃描電路的掃描方法的步驟流程與按鍵掃描方法的步驟流程非常相似且有部分是一樣的,而按鍵掃描方法已於前述實施例所詳加敘述,在此不再贅述,僅作重點概述。在本實施例中,一種使用於按鍵掃描電路40的掃描方法,按鍵掃描電路40可用於掃描第一按鍵組10與第二按鍵組20,第一按鍵組10包含X個優先按鍵,第二按鍵組20包含Y個次要按鍵,按鍵掃描電路40包括M條主掃描線 Sa(1)至Sa(M)、N 條次掃描線 Sb(1)至Sb(N) 與多條感應信號線SS,其中X、Y、M、N 為正整數,M 條主掃描線 Sa(1)至Sa(M) 電性連接至X個優先按鍵,N條次掃描線 Sb(1)至Sb(N) 電性連接至Y個次要按鍵,掃描方法包括下列步驟:步驟 (1) 開始掃描迴圈,設定主掃描次數 j 的初始值為0 (如步驟S500所示);步驟 (2a),判斷主掃描次數j是否等於主掃描預設上限值Jmax(如步驟S510所示),其中Jmax為正整數。若是,則執行步驟 (3);若否,則執行步驟(2b);步驟 (2b),輪流觸發 M 條主掃描線 Sa(1)至Sa(M) 中的每一條,讀取上述多條感應信號線SS的電信號,以偵測X個優先按鍵中是否有按鍵被觸發(如步驟S530所示); 步驟 (2c),增加主掃描次數 j 的值,其中 j = j + 1(如步驟S531所示),並回到步驟 (2a);步驟(3),輪流觸發 N 條次掃描線 Sb(1)至Sb(N) 的其中 P 條次掃描線,讀取上述多條感應信號線SS的電信號,其中,P條次掃描線為耦接到Y個次要按鍵中的 Q個次要按鍵,以偵測Q個次要按鍵中任一個是否被觸發,其中P < N,且Q < Y,P、Q為正整數(如步驟S520所示);步驟(4),於掃描迴圈中,判斷N條次掃描線 Sb(1)至Sb(N)是否均被觸發過(如步驟S521所示),若是,則結束掃描迴圈(如步驟S540所示),若否,則設定主掃描次數j值為0,並回到步驟(2a) (如步驟S522所示)。Then, please refer to Fig. 3 and Figs. 4A to 5 at the same time to understand the operation flow of the key scan. FIG. 3 is a schematic flow chart of a scanning method used in a key scanning circuit according to another embodiment of the present invention. It should be noted that the step flow of the scanning method used in the key scanning circuit and the step flow of the key scanning method are It is very similar and some parts are the same, and the key scanning method has been described in detail in the foregoing embodiment, and will not be repeated here, but only a key overview. In this embodiment, a scanning method used in the key scanning circuit 40, the key scanning circuit 40 can be used to scan the first key group 10 and the second key group 20, the first key group 10 includes X priority keys, the second key The group 20 includes Y secondary keys. The key scanning circuit 40 includes M main scanning lines Sa(1) to Sa(M), N secondary scanning lines Sb(1) to Sb(N), and multiple sensing signal lines SS , Where X, Y, M, N are positive integers, M main scan lines Sa(1) to Sa(M) are electrically connected to X priority buttons, N sub scan lines Sb(1) to Sb(N) Electrically connected to the Y secondary keys, the scanning method includes the following steps: Step (1) Start scanning loop, set the initial value of the main scanning times j to 0 (as shown in Step S500); Step (2a), determine the main Whether the number of scanning times j is equal to the main scanning preset upper limit Jmax (as shown in step S510), where Jmax is a positive integer. If yes, go to step (3); if not, go to step (2b); step (2b), trigger each of the M main scan lines Sa(1) to Sa(M) in turn, and read the multiple The electrical signal of the signal line SS is sensed to detect whether any of the X priority keys is triggered (as shown in step S530); step (2c), increase the value of the main scan times j, where j = j + 1 (as shown in Step S531), and return to step (2a); step (3), trigger N sub-scanning lines Sb(1) to Sb(N) in turn, and read the multiple sensing signals The electrical signal of line SS, where P secondary scan lines are coupled to Q secondary buttons among Y secondary buttons to detect whether any of the Q secondary buttons is triggered, where P <N, And Q <Y, P and Q are positive integers (as shown in step S520); step (4), in the scan loop, determine whether the N secondary scan lines Sb(1) to Sb(N) have been triggered (As shown in step S521), if yes, end the scan loop (as shown in step S540), if not, set the number of main scan times j as 0, and return to step (2a) (as shown in step S522) .

當按鍵掃描電路40被設定為第一掃描模式時, M等於1(M=1),即輸入裝置具有一條主掃描線,定義為第一主掃描線Sa(1), X個優先按鍵均電性連接至第一主掃描線 Sa(1)上。於掃描迴圈中,輪流觸發第一主掃描線Sa(1)與 N 條次掃描線 Sb(1)至Sb(N)的順序可以是:對 Sa(1) 掃描 Jmax 次,例如若Jmax為3時,則連續掃描Sa(1)三次。接著依序掃描次掃描線 Sb(1) 至 Sb(P),然後再對第一條主掃描線Sa(1) 掃描 Jmax 次,接著掃描 Sb(1+P) 至Sb(2P) ,以此類推,直到對Sa(1) 掃描 Jmax 次 ,且接著掃描完P條次掃描線後判斷N條次掃描線Sb(1)至Sb(N)均被觸發過為止。實際操作中,第一掃描模式可以是電競模式,X個優先按鍵至少包含“W”、“A”、“S”、“D”四個英文字母鍵與“上 ”、“下”、“左”、“右”四個方向鍵。When the key scan circuit 40 is set to the first scan mode, M is equal to 1 (M=1), that is, the input device has a main scan line, defined as the first main scan line Sa(1), and the X priority keys are all powered It is connected to the first main scan line Sa(1). In the scan loop, the sequence of triggering the first main scan line Sa(1) and N sub scan lines Sb(1) to Sb(N) in turn can be: scan Sa(1) Jmax times, for example, if Jmax is At 3 o'clock, Sa(1) is scanned three times continuously. Then scan the sub scan lines Sb(1) to Sb(P) in sequence, then scan the first main scan line Sa(1) Jmax times, and then scan Sb(1+P) to Sb(2P), so By analogy, until Sa(1) is scanned Jmax times, and then P sub-scan lines are scanned, it is determined that N sub-scan lines Sb(1) to Sb(N) have been triggered. In actual operation, the first scan mode can be an e-sports mode. The X priority buttons include at least the four English alphabet keys "W", "A", "S", and "D" and "up", "down" and " "Left" and "Right" four direction keys.

舉例來說,當Jmax=1且P=1時,於掃描迴圈中,輪流觸發第一主掃描線Sa(1)與N條次掃描線Sb(1)至Sb(N)的順序可以是:Sa(1) -> Sb(1) -> Sa(1) -> Sb(2) -> Sa(1) -> Sb(3) 直到Sa(1) -> Sb(N)為止。換言之,先觸發第一主掃描線 Sa(1),接著觸發次掃描線Sb(1),然後觸發第一主掃描線Sa(1),再接著觸發次掃描線 Sb(2),緊接著觸發第一主掃描線 Sa(1),接著觸發次掃描線Sb(3),以此類推,直到觸發第一主掃描線Sa(1),接著觸發次掃描線 Sb(N) 為止。For example, when Jmax=1 and P=1, in the scan loop, the sequence of triggering the first main scan line Sa(1) and N sub scan lines Sb(1) to Sb(N) in turn can be : Sa(1) -> Sb(1) -> Sa(1) -> Sb(2) -> Sa(1) -> Sb(3) until Sa(1) -> Sb(N). In other words, first trigger the first main scan line Sa(1), then trigger the sub scan line Sb(1), then trigger the first main scan line Sa(1), then trigger the sub scan line Sb(2), and then trigger The first main scan line Sa(1), then the secondary scan line Sb(3) is triggered, and so on, until the first main scan line Sa(1) is triggered, and then the secondary scan line Sb(N) is triggered.

或者例如,當 Jmax=1且P=2時,本實施例中,輸入裝置一共具有6條掃描線,其中包括一條主掃描線和5條次掃描線。於掃描迴圈中,輪流觸發第一主掃描線Sa(1)與N條次掃描線 Sb(1)至Sb(N)的順序可以是:Sa(1) -> [Sb(1) -> Sb(2)] -> Sa(1) -> [Sb(3) -> Sb(4)] 直到->Sa(1) -> Sb(5)為止。本實施例中,P等於2,N等於5,P不能夠被N整除,在掃描迴圈內的最後一次掃描時,僅選擇N條次掃描線Sb(1)至Sb(N)中尚未被掃描的1條次掃描線Sb(5)進行掃描。實際操作中,還可以於掃描迴圈中,輪流觸發第一主掃描線Sa(1)與N條次掃描線 Sb(1)至Sb(N)的順序還可以是:Sa(1) -> [Sb(1) -> Sb(2)] -> Sa(1) -> [Sb(3) -> Sb(4)] 直到->Sa(1) -> [Sb(5) -> Sb(1)]為止。即,還可以將N條次掃描線Sb(1)至Sb(N)的迴圈來作為掃描物件,則可掃描Sb(5)和Sb(1)。Or, for example, when Jmax=1 and P=2, in this embodiment, the input device has a total of 6 scan lines, including one main scan line and 5 sub scan lines. In the scan loop, the sequence of triggering the first main scan line Sa(1) and N sub scan lines Sb(1) to Sb(N) in turn can be: Sa(1) -> [Sb(1) -> Sb(2)] -> Sa(1) -> [Sb(3) -> Sb(4)] until ->Sa(1) -> Sb(5). In this embodiment, P is equal to 2, N is equal to 5, and P cannot be divisible by N. In the last scan in the scan loop, only N sub-scanning lines Sb(1) to Sb(N) are selected. Scan one scan line Sb(5) of the scan. In actual operation, it is also possible to trigger the first main scan line Sa(1) and N secondary scan lines Sb(1) to Sb(N) alternately in the scan loop. The sequence may also be: Sa(1) -> [Sb(1) -> Sb(2)] -> Sa(1) -> [Sb(3) -> Sb(4)] until -> Sa(1) -> [Sb(5) -> Sb( 1)] so far. That is, the loops of N sub-scanning lines Sb(1) to Sb(N) can also be used as the scanning object, and then Sb(5) and Sb(1) can be scanned.

又或者例如,當 Jmax=1且P=3時。於掃描迴圈中,輪流觸發第一條主掃描線Sa(1)與N條次掃描線Sb(1)至Sb(N)的順序可以是:Sa(1) -> [Sb(1) -> Sb(2) -> Sb(3)] -> Sa(1) -> [Sb(4) -> Sb(5) -> Sb(6)]直到->Sa(1) -> [Sb(N-2) -> Sb(N-1)-> Sb(N)]為止。Or for example, when Jmax=1 and P=3. In the scan loop, the sequence of triggering the first main scan line Sa(1) and N sub scan lines Sb(1) to Sb(N) in turn can be: Sa(1) -> [Sb(1)- > Sb(2) -> Sb(3)] -> Sa(1) -> [Sb(4) -> Sb(5) -> Sb(6)] until ->Sa(1) -> [Sb( N-2) -> Sb(N-1) -> Sb(N)].

或者例如,當Jmax=2且P=1時,於掃描迴圈中,輪流觸發第一主掃描線Sa(1)與N條次掃描線 Sb(1)至Sb(N)的順序可以是:[Sa(1) -> Sa(1)] -> Sb(1) -> [Sa(1) -> Sa(1)] -> Sb(2)直到-> [Sa(1) -> Sa(1)] -> Sb(N)為止。Or for example, when Jmax=2 and P=1, in the scan loop, the sequence of triggering the first main scan line Sa(1) and N sub scan lines Sb(1) to Sb(N) in turn can be: [Sa(1) -> Sa(1)] -> Sb(1) -> [Sa(1) -> Sa(1)] -> Sb(2) until -> [Sa(1) -> Sa( 1)] -> Sb(N).

又或者例如,當 Jmax=3且P=1時,於掃描迴圈中,輪流觸發第一主掃描線Sa(1)與N條次掃描線Sb(1)至Sb(N)的順序可以是:[Sa(1) -> Sa(1) -> Sa(1)] -> Sb(1) -> [Sa(1) -> Sa(1) -> Sa(1)] -> Sb(2)直到-> [Sa(1) -> Sa(1) -> Sa(1)] -> Sb(N)為止。總的來說,藉由增加對主掃描線Sa(1)的掃描次數,可以大幅度地縮短X個優先按鍵的反應時間。Or for example, when Jmax=3 and P=1, in the scan loop, the sequence of triggering the first main scan line Sa(1) and N sub scan lines Sb(1) to Sb(N) in turn can be :[Sa(1) -> Sa(1) -> Sa(1)] -> Sb(1) -> [Sa(1) -> Sa(1) -> Sa(1)] -> Sb(2 ) Until -> [Sa(1) -> Sa(1) -> Sa(1)] -> Sb(N). In general, by increasing the number of scans for the main scan line Sa(1), the response time of the X priority keys can be greatly shortened.

當按鍵掃描電路40被設定為第二掃描模式時,M等於2(M=2),輸入裝置具有兩條主掃描線,分別定義為第一主掃描線Sa(1)和第二主掃描線Sa(2),X個優先按鍵電性連接至兩條主掃描線Sa(1)、Sa(2),於掃描迴圈中,輪流觸發兩條主掃描線Sa(1)、Sa(2)與N條次掃描線Sb(1)至Sb(N)的順序可以是:Sa(1)至Sa(2)迴圈掃描 Jmax次-> Sb(1)至Sb(P) -> Sa(1)至Sa(2)迴圈掃描Jmax次-> Sb(1+P) 至Sb(2P) -> Sa(1)至Sa(2)迴圈掃描Jmax次直到-> Sa(1)至Sa(2)迴圈掃描Jmax次且接著掃描完P條次掃描線後判斷N條次掃描線 Sb(1)至Sb(N)均被觸發過為止。實際操作中,第二掃描模式可以是文書模式,X個優先按鍵至少包含“A至Z”26個英文字母鍵。When the key scanning circuit 40 is set to the second scanning mode, M is equal to 2 (M=2), and the input device has two main scanning lines, which are defined as the first main scanning line Sa(1) and the second main scanning line respectively. Sa(2), X priority buttons are electrically connected to the two main scan lines Sa(1), Sa(2), and the two main scan lines Sa(1) and Sa(2) are triggered in turn in the scan loop The sequence with the N sub-scanning lines Sb(1) to Sb(N) can be: Sa(1) to Sa(2) loop scan Jmax times -> Sb(1) to Sb(P) -> Sa(1 ) To Sa(2) lap scan Jmax times -> Sb(1+P) to Sb(2P) -> Sa(1) to Sa(2) lap scan Jmax times until -> Sa(1) to Sa( 2) After scanning Jmax times in a loop and then scanning P secondary scan lines, it is determined that all N secondary scan lines Sb(1) to Sb(N) are triggered. In actual operation, the second scanning mode can be a document mode, and the X priority keys include at least 26 English letter keys from "A to Z".

舉例來說,當 Jmax=1且P=1時,於掃描迴圈中,輪流觸發兩條主掃描線Sa(1)、Sa(2)與N條次掃描線Sb(1)至Sb(N)的順序可以是:[Sa(1) -> Sa(2)]-> Sb(1) -> [Sa(1) -> Sa(2)]-> Sb(2) ->[ Sa(1) -> Sa(2)]-> Sb(3)直到[Sa(1) -> Sa(2)]-> Sb(N)為止。換言之,先觸發主掃描線Sa(1),接著觸發主掃描線Sa(2),然後觸發次掃描線Sb(1),再接著觸發主掃描線Sa(1),緊接著觸發主掃描線Sa(2),接著觸發次掃描線 Sb(2),然後觸發主掃描線Sa(1),再接著觸發主掃描線Sa(2),緊接著觸發次掃描線 Sb(3),以此類推,直到觸發第一主掃描線Sa(1),接著觸發第二主掃描線Sa(2),然後觸發次掃描線 Sb(N) 為止。總的來說,藉由增加對主掃描線Sa(1)與Sa(2)的掃描次數,可以大幅度地提升X個優先按鍵的反應時間。For example, when Jmax=1 and P=1, in the scan loop, two main scan lines Sa(1), Sa(2) and N sub scan lines Sb(1) to Sb(N The order of) can be: [Sa(1) -> Sa(2)]-> Sb(1) -> [Sa(1) -> Sa(2)]-> Sb(2) ->[ Sa(1 ) -> Sa(2)] -> Sb(3) until [Sa(1) -> Sa(2)] -> Sb(N). In other words, first trigger the main scan line Sa(1), then trigger the main scan line Sa(2), then trigger the secondary scan line Sb(1), then trigger the main scan line Sa(1), and then trigger the main scan line Sa (2), then trigger the secondary scan line Sb(2), then trigger the main scan line Sa(1), then trigger the main scan line Sa(2), then trigger the secondary scan line Sb(3), and so on, Until the first main scan line Sa(1) is triggered, then the second main scan line Sa(2) is triggered, and then the secondary scan line Sb(N) is triggered. In general, by increasing the number of scans for the main scan lines Sa(1) and Sa(2), the response time of the X priority buttons can be greatly improved.

接下來要說明的是,本發明實施例所提供的按鍵掃描方法與使用於按鍵掃描電路的掃描方法是可以執行於輸入裝置1中,請同時參閱圖1至圖4C。但本發明並不限制圖1至圖2的按鍵掃描方法與圖3的使用於按鍵掃描電路的掃描方法僅能夠執行於圖5的輸入裝置1中。需注意的是,由於按鍵掃描方法與使用於按鍵掃描電路的掃描方法的步驟流程,已於前述實施例所詳加敘述,在此不再贅述,僅作重點概述。It will be explained that the key scanning method provided by the embodiment of the present invention and the scanning method used in the key scanning circuit can be executed in the input device 1. Please refer to FIGS. 1 to 4C at the same time. However, the present invention does not limit the key scanning method of FIGS. 1 to 2 and the scanning method used in the key scanning circuit of FIG. 3 to be executed only in the input device 1 of FIG. 5. It should be noted that, since the key scanning method and the step flow of the scanning method used in the key scanning circuit have been described in detail in the foregoing embodiment, it will not be repeated here, and only a key overview is given.

輸入裝置1包括按鍵掃描電路40、第一按鍵組10與第二按鍵組20。實際操作中,輸入裝置1可以是實體鍵盤。鍵盤上具有多個按鍵,每個按鍵上標示著其代表的字元與符號。大部分情況下,按下一個按鍵就輸出對應的一個符號,如字母、數字或標點符號等。按鍵掃描電路40包括M條主掃描線Sa(1)至Sa(M)、N條次掃描線 Sb(1)至Sb(N) 與多條感應信號線SS,其中M、N為正整數。第一按鍵組10包含X個優先按鍵,M 條主掃描線 Sa(1)至Sa(M) 電性連接至X個優先按鍵,其中X為正整數。舉例來說,當M=1,即按鍵掃描電路40僅包含一條主掃描線,可定義為第一主掃描線Sa(1),X個優先按鍵至少包含“W”、“A”、“S”、“D”四個英文字母鍵與“上 ”、“下”、“左”、“右”四個方向鍵,此時X個優先按鍵均電性連接至第一主掃描線 Sa(1)。此外,當M=2,即按鍵掃描電路40包含兩條主掃描線,可分別定義為第一主掃描線Sa(1)和第二主掃描線Sa(2),X個優先按鍵至少包含“A至Z” 26個英文字母鍵,此時X個優先按鍵電性連接至兩條主掃描線Sa(1)與Sa(2)。第二按鍵組20包含Y個次要按鍵,N條次掃描線Sb(1)至Sb(N)電性連接至Y個次要按鍵,其中Y為正整數。The input device 1 includes a key scanning circuit 40, a first key group 10 and a second key group 20. In actual operation, the input device 1 may be a physical keyboard. There are multiple keys on the keyboard, and each key is marked with its representative characters and symbols. In most cases, pressing a button will output a corresponding symbol, such as letters, numbers, or punctuation marks. The key scanning circuit 40 includes M main scanning lines Sa(1) to Sa(M), N secondary scanning lines Sb(1) to Sb(N), and a plurality of sensing signal lines SS, where M and N are positive integers. The first button group 10 includes X priority buttons, and M main scan lines Sa(1) to Sa(M) are electrically connected to X priority buttons, where X is a positive integer. For example, when M=1, that is, the key scan circuit 40 only includes one main scan line, which can be defined as the first main scan line Sa(1), and the X priority keys include at least "W", "A", and "S". "" and "D" four English letter keys and "up", "down", "left", "right" four direction keys, at this time X priority keys are electrically connected to the first main scan line Sa(1 ). In addition, when M=2, that is, the key scanning circuit 40 includes two main scanning lines, which can be defined as the first main scanning line Sa(1) and the second main scanning line Sa(2) respectively, and the X priority keys include at least " A to Z" 26 English letter keys, at this time, the X priority keys are electrically connected to the two main scan lines Sa(1) and Sa(2). The second button group 20 includes Y secondary buttons, and N secondary scan lines Sb(1) to Sb(N) are electrically connected to the Y secondary buttons, where Y is a positive integer.

請參閱圖3,本發明的輸入裝置1的按鍵掃描電路40可以是執行下列步驟:步驟(1) 開始掃描迴圈,設定主掃描次數 j 的初始值為 0 (如步驟S500所示);步驟(2a),判斷主掃描次數j是否等於主掃描預設上限值Jmax (如步驟S510所示),Jmax為正整數。若是,則執行步驟(3);若否,則執行步驟(2b);步驟(2b),輪流觸發M條主掃描線 Sa(1)至Sa(M) 中的每一條,並讀取上述多條感應信號線SS的電信號,以偵測X個優先按鍵中是否有按鍵被觸發 (如步驟S530所示); 步驟(2c),增加主掃描次數 j 的值,其中 j = j + 1 (如步驟S531所示),並回到步驟(2a);步驟(3),輪流觸發N條次掃描線 Sb(1)至Sb(N) 的其中 P 條次掃描線,並讀取上述多條感應信號線SS的電信號,其中,P條次掃描線為耦接到Y個次要按鍵中的 Q個次要按鍵,以偵測Q個次要按鍵是否被觸發,其中P < N,且Q < Y,P、Q為正整數(如步驟S520所示);步驟(4),於掃描迴圈中,判斷N條次掃描線 Sb(1)至Sb(N)是否均被觸發過(如步驟S521所示),若否,則設定主掃描次數j為0,並回到步驟(2a) ,若是,則結束掃描迴圈 (如步驟S540所示)。Referring to FIG. 3, the key scanning circuit 40 of the input device 1 of the present invention can perform the following steps: Step (1) Start scanning loop, and set the initial value of the main scanning times j to 0 (as shown in step S500); (2a) Determine whether the main scan times j is equal to the main scan preset upper limit Jmax (as shown in step S510), where Jmax is a positive integer. If yes, proceed to step (3); if not, proceed to step (2b); step (2b), trigger each of the M main scan lines Sa(1) to Sa(M) in turn, and read the multiple The electrical signal of the sensing signal line SS is used to detect whether any of the X priority keys is triggered (as shown in step S530); step (2c), increase the value of the main scan times j, where j = j + 1 ( (As shown in step S531), and return to step (2a); step (3), trigger N sub-scanning lines Sb(1) to Sb(N) in turn, and read the above-mentioned multiple scan lines. Sensing the electrical signal of the signal line SS. Among them, the P secondary scan lines are coupled to the Q secondary buttons of the Y secondary buttons to detect whether the Q secondary buttons are triggered, where P <N, and Q <Y, P and Q are positive integers (as shown in step S520); step (4), in the scan loop, determine whether the N secondary scan lines Sb(1) to Sb(N) have been triggered ( (As shown in step S521), if not, set the number of main scan times j to 0, and return to step (2a), if yes, end the scan loop (as shown in step S540).

當按鍵掃描電路40未被設定為第一掃描模式時,M等於1(M=1),即輸入裝置具有一條主掃描線,定義為第一主掃描線Sa(1),Jmax = 1,P =N,於掃描迴圈中,輪流觸發第一主掃描線Sa(1)與 N 條次掃描線 Sb(1)至Sb(N)的順序可以是:Sa(1) -> Sb(1) -> Sb(2) -> Sb(3) 直到 Sb(N) 為止,使第一主掃描線Sa(1)與 N 條次掃描線 Sb(1)至Sb(N)中每一條均被觸發相同的次數。又舉例來說,當 Jmax=1 且 P=1 時,於掃描迴圈中,輪流觸發第一主掃描線Sa(1)與 N 條次掃描線 Sb(1)至Sb(N)的順序可以是:Sa(1) -> Sb(1) -> Sa(1) -> Sb(2) -> Sa(1) -> Sb(3)直到Sa(1) -> Sb(N)為止,使第一主掃描線Sa(1)的被觸發次數高於N條次掃描線Sb(1)至Sb(N)中每一條的被觸發次數。When the key scan circuit 40 is not set to the first scan mode, M is equal to 1 (M=1), that is, the input device has one main scan line, defined as the first main scan line Sa(1), Jmax=1, P =N, in the scan loop, the first main scan line Sa(1) and N sub scan lines Sb(1) to Sb(N) are triggered alternately. The sequence can be: Sa(1) -> Sb(1) -> Sb(2) -> Sb(3) Until Sb(N), each of the first main scan line Sa(1) and N sub scan lines Sb(1) to Sb(N) is triggered The same number of times. For another example, when Jmax=1 and P=1, in the scan loop, the sequence of triggering the first main scan line Sa(1) and N sub scan lines Sb(1) to Sb(N) in turn can be Yes: Sa(1) -> Sb(1) -> Sa(1) -> Sb(2) -> Sa(1) -> Sb(3) until Sa(1) -> Sb(N), so The number of times that the first main scan line Sa(1) is triggered is higher than the number of times that each of the N secondary scan lines Sb(1) to Sb(N) is triggered.

當按鍵掃描電路40被設定為第一掃描模式時,Jmax >= 1,P <N,於掃描迴圈中,輪流觸發第一主掃描線Sa(1)與 N 條次掃描線 Sb(1)至Sb(N)的順序可以是: Sa(1) 掃描 Jmax 次 ->[ Sb(1) -> 至Sb(P)] -> Sa(1) 掃描 Jmax 次 -> [Sb(P+1) ->至Sb(2P)]直到Sa(1) 掃描 Jmax 次且接著掃描完P條次掃描線後判斷N條次掃描線Sb(1)至Sb(N)均被觸發過為止,使第一主掃描線Sa(1) 的被觸發次數高於 N條次掃描線Sb(1)至Sb(N)中每一條的被觸發次數。When the key scan circuit 40 is set to the first scan mode, Jmax >= 1, P <N, in the scan loop, the first main scan line Sa(1) and N sub scan lines Sb(1) are triggered alternately The order to Sb(N) can be: Sa(1) scan Jmax times -> [Sb(1) -> to Sb(P)] -> Sa(1) scan Jmax times -> [Sb(P+1) ->to Sb(2P)] until Sa(1) scans Jmax times and then P scan lines are scanned, it is determined that N scan lines Sb(1) to Sb(N) have been triggered, so that the first The number of times that the main scan line Sa(1) is triggered is higher than the number of times that each of the N sub-scan lines Sb(1) to Sb(N) is triggered.

當按鍵掃描電路40未被設定為第二掃描模式時,M等於2(m=2),即輸入裝置具有兩條主掃描線,分別定義為第一主掃描線Sa(1)和第二主掃描線Sa(2),Jmax = 1,P =N,於掃描迴圈中,輪流觸發兩條主掃描線Sa(1)、Sa(2)與 N 條次掃描線 Sb(1)至Sb(N)的順序可以是:Sa(1) -> Sa(2) -> Sb(1) -> Sb(2) -> Sb(3) 直到Sb(N) 為止,使兩條主掃描線 Sa(1)、Sa(2) 中每一條與N條次掃描線 Sb(1)至Sb(N)中每一條均被觸發相同的次數。又舉例來說,當 Jmax=1 且 P=1 時,於掃描迴圈中,輪流觸發兩條主掃描線Sa(1)、Sa(2)與 N 條次掃描線 Sb(1)至Sb(N)的順序可以是:[Sa(1) ->Sa(2)]-> Sb(1) ->[ Sa(1) ->Sa(2)] -> Sb(2) -> [Sa(1) ->Sa(2)] -> Sb(3)直到[Sa(1) -> Sa(2)] -> Sb(N)為止,使兩條主掃描線Sa(1)的被觸發次數高於N條次掃描線Sb(1)至Sb(N)中每一條的被觸發次數。When the key scan circuit 40 is not set to the second scan mode, M is equal to 2 (m=2), that is, the input device has two main scan lines, defined as the first main scan line Sa(1) and the second main scan line respectively. Scan line Sa(2), Jmax = 1, P=N, in the scan loop, two main scan lines Sa(1), Sa(2) and N secondary scan lines Sb(1) to Sb( The order of N) can be: Sa(1) -> Sa(2) -> Sb(1) -> Sb(2) -> Sb(3) until Sb(N), so that the two main scan lines Sa( 1) Each of Sa(2) and each of the N secondary scan lines Sb(1) to Sb(N) are triggered the same number of times. For another example, when Jmax=1 and P=1, in the scan loop, two main scan lines Sa(1), Sa(2) and N sub scan lines Sb(1) to Sb( The order of N) can be: [Sa(1) ->Sa(2)] -> Sb(1) ->[ Sa(1) ->Sa(2)] -> Sb(2) -> [Sa( 1) ->Sa(2)] -> Sb(3) until [Sa(1) -> Sa(2)] -> Sb(N), so that the two main scan lines Sa(1) are triggered It is higher than the number of times that each of the N secondary scan lines Sb(1) to Sb(N) is triggered.

當按鍵掃描電路40被設定為第二掃描模式時,Jmax >= 1,P <N,於掃描迴圈中,輪流觸發兩條主掃描線Sa(1)、Sa(2)與 N 條次掃描線 Sb(1)至Sb(N)的順序為: [Sa(1)->Sa(2)] 迴圈掃描 Jmax 次 -> [Sb(1) -> Sb(2) ->... Sb(P)] 掃描一次 -> [Sa(1)->Sa(2)] 迴圈掃描 Jmax 次 -> [Sb(P+1)... Sb(2P)] 掃描一次直到[Sa(1)->Sa(2)] 迴圈掃描 Jmax 次且接著掃描完P條次掃描線後判斷N條次掃描線Sb(1)至Sb(N)均被觸發過為止,使兩條主掃描線Sa(1)~Sa(2) 中每一條的被觸發次數高於N條次掃描線 Sb(1)至Sb(N)中每一條的被觸發次數。When the key scan circuit 40 is set to the second scan mode, Jmax >= 1, P <N, in the scan loop, the two main scan lines Sa(1), Sa(2) and N secondary scans are triggered in turn The order of the lines Sb(1) to Sb(N) is: [Sa(1)->Sa(2)] loop scanning Jmax times -> [Sb(1) -> Sb(2) ->... Sb (P)] Scan once -> [Sa(1)->Sa(2)] lap scan Jmax times -> [Sb(P+1)... Sb(2P)] Scan once until [Sa(1) ->Sa(2)] After scanning Jmax times in a loop and then scanning P sub-scanning lines, it is determined that N sub-scanning lines Sb(1) to Sb(N) are triggered, so that two main scanning lines Sa (1)~Sa(2) has a higher number of triggers than each of the N scan lines Sb(1) to Sb(N).

接下來要說明的是,本發明實施例所提供的按鍵掃描方法、使用於按鍵掃描電路的掃描方法是可以執行於輸入裝置3中,請同時參閱圖1至圖4C。但本發明並不限制圖1至圖2的按鍵掃描方法與圖3的使用於按鍵掃描電路的掃描方法僅能夠執行於圖7A至圖7C的輸入裝置3中。圖7A為依照本發明另一鍵盤輸入裝置的方塊示意圖,適用於第一掃描模式。圖7B為依照本發明另一鍵盤輸入裝置的方塊示意圖,適用於第二掃描模式。圖7C為依照本發明另一鍵盤輸入裝置的方塊示意圖,適用於第三掃描模式。需注意的是,由於按鍵掃描方法與使用於按鍵掃描電路的掃描方法的步驟流程,已於前述實施例所詳加敘述,在此不再贅述,僅作重點概述。It will be explained that the key scanning method and the scanning method used in the key scanning circuit provided by the embodiments of the present invention can be executed in the input device 3, please refer to FIGS. 1 to 4C at the same time. However, the present invention does not limit the key scanning method of FIGS. 1 to 2 and the scanning method used in the key scanning circuit of FIG. 3 to be executed only in the input device 3 of FIGS. 7A to 7C. 7A is a block diagram of another keyboard input device according to the present invention, which is suitable for the first scanning mode. 7B is a block diagram of another keyboard input device according to the present invention, which is suitable for the second scanning mode. 7C is a block diagram of another keyboard input device according to the present invention, which is suitable for the third scanning mode. It should be noted that, since the key scanning method and the step flow of the scanning method used in the key scanning circuit have been described in detail in the foregoing embodiment, it will not be repeated here, and only a key overview is given.

輸入裝置3包括按鍵掃描電路40與按鍵組50,按鍵組50可包括第一按鍵組10與第二按鍵組20。輸入裝置3可以是實體鍵盤,鍵盤上具有多個按鍵,每個按鍵上標示著其代表的字元與符號。大部分情況下,按下一個按鍵就輸出對應的一個符號,如字母、數字或標點符號等。按鍵掃描電路40包括N+1條掃描線Row 0~Row N,與多條感應信號線SS,N為正整數。The input device 3 includes a key scanning circuit 40 and a key group 50. The key group 50 may include a first key group 10 and a second key group 20. The input device 3 may be a physical keyboard, and the keyboard has a plurality of keys, and each key is marked with its representative characters and symbols. In most cases, pressing a button will output a corresponding symbol, such as letters, numbers, or punctuation marks. The key scanning circuit 40 includes N+1 scanning lines Row 0 to Row N, and a plurality of sensing signal lines SS, where N is a positive integer.

請參閱圖8至圖10。圖8至圖10是依照本發明另一實施例執行本發明按鍵掃描方法的流程示意圖.如圖8步驟S800所示,按鍵掃描電路40執行下列步驟:開始掃描迴圈,判斷輸入裝置3目前是否為第一掃描模式、第二掃描模式或第三掃描模式其中之一,據此分別執行步驟S810(C路徑-對應第一掃描模式)、步驟S821(A路徑-對應第二掃描模式)或步驟S841 (B路徑-對應第三掃描模式)其中之一。需說明的是,在實際操作中,第一掃描模式可以是一般模式;第二掃描模式可以是電競模式;第三掃描模式可以是文書模式。Please refer to Figure 8 to Figure 10. 8 to 10 are schematic diagrams of the process of executing the button scanning method of the present invention according to another embodiment of the present invention. As shown in step S800 in FIG. 8, the key scan circuit 40 performs the following steps: starts a scan loop, determines whether the input device 3 is currently in one of the first scan mode, the second scan mode, or the third scan mode, and executes them accordingly. Step S810 (path C-corresponding to the first scanning mode), step S821 (path A-corresponding to the second scanning mode) or step S841 (path B-corresponding to the third scanning mode). It should be noted that, in actual operation, the first scanning mode may be a general mode; the second scanning mode may be an e-sports mode; and the third scanning mode may be a document mode.

如圖8步驟S810所示,當輸入裝置3於第一掃描模式時執行以下步驟。首先,按鍵掃描電路40輪流觸發複數條掃描線Row 0~Row N其中之一直到複數條掃描線中每一條都被觸發過為止,並讀取多條感應信號線SS的電信號,然後偵測輸入裝置3中是否有按鍵被觸發,並結束掃描迴圈。As shown in step S810 in FIG. 8, when the input device 3 is in the first scan mode, the following steps are executed. First, the key scan circuit 40 triggers one of the plurality of scan lines Row 0~Row N in turn until each of the plurality of scan lines is triggered, and reads the electrical signals of the plurality of sensing signal lines SS, and then detects Whether a button in the input device 3 is triggered and the scanning loop is ended.

如圖9步驟S821所示,當輸入裝置3於第二掃描模式時,按鍵掃描電路40將掃描線Row0定義為第一主掃描線Sa(1)、並將掃描線Row1~RowN定義為N條次掃描線Sb(1)至Sb(N)。接著,按鍵掃描電路40將電性連接至第一主掃描線Sa(1)的X1個按鍵定義為第一按鍵組10,並將未電性連接至第一主掃描線Sa(1)的其餘Y1個按鍵定義為第二按鍵組20,其中X1、Y1為正整數(如步驟S822所示)。需說明的是,X1個優先按鍵至少包含“W”、“A”、“S”、“D”四個英文字母鍵與“上 ”、“下”、“左”、“右”四個方向鍵。緊接著,設定主掃描次數j的初始值為0(如步驟S823所示)。然後,判斷主掃描次數j是否等於預設上限值Jmax,其中預設上限值Jmax為正整數(如步驟S824所示)。若是,則執行步驟S825,若否,則執行步驟S830。As shown in step S821 in FIG. 9, when the input device 3 is in the second scan mode, the key scan circuit 40 defines the scan line Row0 as the first main scan line Sa(1), and defines the scan lines Row1~RowN as N The secondary scan lines Sb(1) to Sb(N). Next, the key scanning circuit 40 defines the X1 keys electrically connected to the first main scanning line Sa(1) as the first key group 10, and electrically connects to the rest of the first main scanning line Sa(1) Y1 buttons are defined as the second button group 20, where X1 and Y1 are positive integers (as shown in step S822). It should be noted that the X1 priority keys include at least the four alphabet keys "W", "A", "S", and "D" and the four directions of "up", "down", "left" and "right" key. Next, the initial value of the main scan number j is set to 0 (as shown in step S823). Then, it is determined whether the number of main scans j is equal to the preset upper limit Jmax, where the preset upper limit Jmax is a positive integer (as shown in step S824). If yes, execute step S825, if not, execute step S830.

接著要說明的是,當主掃描次數j是等於預設上限值Jmax時的步驟流程。首先,輪流觸發N條次掃描線Sb(1)至Sb(N)的其中P條,其中P條次掃描線為耦接到Y1個次要按鍵中的Q個次要按鍵。接著,讀取多條感應信號線SS的電信號,偵測Q個次要按鍵中是否有按鍵被觸發,其中P<N、Q<Y1,P、Q為正整數(如步驟S825所示)。緊接著,判斷N條次掃描線Sb(1)至Sb(N)是否均被觸發過(如步驟S826所示),若否,則設定主掃描次數j為0,並回到步驟S824(如步驟S828所示),若是,則結束掃描迴圈(如步驟S827所示)。What is to be explained next is the flow of steps when the number of main scans j is equal to the preset upper limit Jmax. First, P of the N secondary scan lines Sb(1) to Sb(N) are triggered in turn, where the P secondary scan lines are Q secondary buttons coupled to the Y1 secondary buttons. Next, read the electrical signals of the multiple sensing signal lines SS to detect whether any of the Q secondary keys is triggered, where P<N, Q<Y1, P and Q are positive integers (as shown in step S825) . Next, determine whether the N secondary scan lines Sb(1) to Sb(N) have been triggered (as shown in step S826), if not, set the number of main scan times j to 0, and return to step S824 (as shown in Step S828), if yes, end the scan loop (shown in step S827).

緊接著要說明的是,當主掃描次數j不等於預設上限值Jmax時的步驟流程。首先,觸發第一主掃描線Sa(1),讀取多條感應信號線SS的電信號,偵測X1個優先按鍵中是否有按鍵被觸發(如步驟S830所示)。接著,增加主掃描次數j的值,其中j=j+1,並回到步驟S824(如步驟S831所示)。What will be explained next is the flow of steps when the number of main scans j is not equal to the preset upper limit Jmax. First, trigger the first main scan line Sa(1), read the electrical signals of multiple sensing signal lines SS, and detect whether any of the X1 priority keys is triggered (as shown in step S830). Next, increase the value of the number of main scans j, where j=j+1, and return to step S824 (as shown in step S831).

如圖10步驟S841所示,當輸入裝置3於第三掃描模式時,按鍵掃描電路40將掃描線Row0~Row1定義為兩條主掃描線Sa(1)~Sa(2),並將掃描線Row2~RowN定義為N-1條次掃描線Sb(1)至Sb(N-1)。接著,按鍵掃描電路40將電性連接至兩條主掃描線Sa(1)~Sa(2)的X2個按鍵定義為第一按鍵組,並將未電性連接至兩條主掃描線Sa(1)~Sa(2)的其餘Y2個按鍵定義為第二按鍵組,X2、Y2為正整數(如步驟S842所示)。需說明的是,X2 個優先按鍵至少包含“A至Z”26 個英文字母鍵 與“上 ”、“下”、“左”、“右”四個方向鍵。緊接著,設定主掃描次數j的初始值為0(如步驟S843所示)。然後,判斷主掃描次數j是否等於預設上限值Jmax,其中預設上限值Jmax為正整數(如步驟S844所示),若是,則執行步驟S845,若否,則執行步驟S850。As shown in step S841 in FIG. 10, when the input device 3 is in the third scan mode, the key scan circuit 40 defines the scan lines Row0~Row1 as two main scan lines Sa(1)~Sa(2), and the scan lines Row2~RowN are defined as N-1 secondary scan lines Sb(1) to Sb(N-1). Next, the button scanning circuit 40 defines the X2 buttons electrically connected to the two main scanning lines Sa(1)~Sa(2) as the first button group, and electrically connects them to the two main scanning lines Sa( 1) The remaining Y2 buttons of ~Sa(2) are defined as the second button group, and X2 and Y2 are positive integers (as shown in step S842). It should be noted that the X2 priority keys include at least 26 English letter keys from "A to Z" and four direction keys "up", "down", "left" and "right". Next, the initial value of the number of main scans j is set to 0 (as shown in step S843). Then, it is determined whether the number of main scans j is equal to the preset upper limit Jmax, where the preset upper limit Jmax is a positive integer (as shown in step S844), if yes, step S845 is executed, and if not, step S850 is executed.

接著要說明的是,當主掃描次數j是等於預設上限值Jmax時的步驟流程。首先,輪流觸發N-1條次掃描線Sb(1)至Sb(N-1)的其中P條,P條次掃描線是耦接到Y2個次要按鍵中的Q個次要按鍵,並讀取多條感應信號線SS的電信號,偵測Q個次要按鍵中是否有按鍵被觸發,其中P<N-1、Q<Y2,P、Q為正整數(如步驟S845所示)。接著,判斷N-1條次掃描線Sb(1)至Sb(N-1)是否均被觸發過(如步驟S846所示),若否,則設定主掃描次數j為0,並回到步驟S844(如步驟S847所示),若是,則結束掃描迴圈(如步驟S827所示)。What is to be explained next is the flow of steps when the number of main scans j is equal to the preset upper limit Jmax. First, P of the N-1 secondary scan lines Sb(1) to Sb(N-1) are triggered in turn. The P secondary scan lines are coupled to the Q secondary buttons of the Y2 secondary buttons, and Read the electrical signals of multiple sensing signal lines SS, and detect whether any key is triggered in the Q secondary keys, where P<N-1, Q<Y2, P and Q are positive integers (as shown in step S845) . Next, determine whether the N-1 secondary scan lines Sb(1) to Sb(N-1) have been triggered (as shown in step S846), if not, set the number of main scan times j to 0, and return to step S844 (shown in step S847), if yes, end the scan loop (shown in step S827).

緊接著要說明的是,當主掃描次數j不等於預設上限值Jmax時的步驟流程。首先,輪流觸發兩條主掃描線Sa(1)~Sa(2),讀取多條感應信號線SS的電信號,偵測X2個優先按鍵中是否有按鍵被觸發(如步驟S850所示)。接著,增加主掃描次數j的值,其中j=j+1,並回到步驟S844 (如步驟S851所示)。What will be explained next is the flow of steps when the number of main scans j is not equal to the preset upper limit Jmax. First, trigger the two main scan lines Sa(1)~Sa(2) in turn, read the electrical signals of multiple sensing signal lines SS, and detect whether any of the X2 priority keys is triggered (as shown in step S850) . Next, increase the value of the number of main scans j, where j=j+1, and return to step S844 (as shown in step S851).

綜上所述,本發明實施例所提供的按鍵掃描方法、使用於按鍵掃描電路的掃描方法及輸入裝置。藉由對關鍵按鍵或者常用按鍵進行穿插式、交替式的掃描,也就是對這些關鍵按鍵所耦接的主掃描線增加掃描的次數,以達到縮短這些關鍵按鍵的掃描迴圈,以對這些關鍵按鍵進行更快速度的掃描。藉此,大幅度地縮短這些關鍵按鍵的掃描迴圈,同時也加快這些關鍵按鍵的反應速度。In summary, the key scanning method, the scanning method used in the key scanning circuit, and the input device provided by the embodiments of the present invention. By performing interspersed and alternate scanning of key keys or commonly used keys, that is, the number of scans is increased to the main scan line coupled to these key keys, so as to shorten the scan loop of these key keys, so as to correct these key keys. Press the key to scan faster. In this way, the scanning loop of these key keys is greatly shortened, and the response speed of these key keys is also accelerated.

藉由以上較佳具體實施例的詳述,是希望能更加清楚描述本發明的特徵與精神,而並非以上述所揭露的較佳具體實施例來對本發明的保護範圍加以限制。相反地,其目的是希望能涵蓋各種改變及具相等性的安排於本發明所欲申請的權利要求的保護範圍內。因此,本發明的權利要求的保護範圍應該根據上述的說明作最寬廣的解釋,以致使其涵蓋所有可能的改變以及具相等性的安排。Through the detailed description of the above preferred embodiments, it is hoped that the characteristics and spirit of the present invention can be described more clearly, and the preferred embodiments disclosed above are not used to limit the protection scope of the present invention. On the contrary, its purpose is to cover various changes and equivalent arrangements within the protection scope of the claims of the present invention. Therefore, the protection scope of the claims of the present invention should be interpreted in the broadest way based on the above description so as to cover all possible changes and equivalent arrangements.

1、2、3:輸入裝置 10:第一按鍵組 20:第二按鍵組 30:第三按鍵組 40:按鍵掃描電路 50:按鍵組 Row 1~Row N:掃描線 Sa(1)~Sa(M):主掃描線 Sb(1)~Sb(N):次掃描線 SS:感應信號線 1, 2, 3: Input device 10: The first button group 20: The second button group 30: The third button group 40: Button scanning circuit 50: Button group Row 1~Row N: scan line Sa(1)~Sa(M): main scan line Sb(1)~Sb(N): secondary scan line SS: Sensor signal line

圖1為依照本發明實施例所繪示的執行第一掃描模式與第二掃描模式的按鍵掃描方法的流程示意圖。 圖2為依照本發明實施例所繪示的執行第一掃描模式、第二掃描模式與第三掃描模式的按鍵掃描方法的流程示意圖。 圖3為依照本發明另一實施例所繪示的使用於按鍵掃描電路的掃描方法的流程示意圖。 圖4A為依照本發明另一實施例所繪示鍵盤可使用6*21按鍵矩陣的示意圖。 圖4B為依照本發明另一實施例所繪示第一掃描模式的鍵盤可使用6*21按鍵矩陣的示意圖。 圖4C為依照本發明另一實施例所繪示第二掃描模式的鍵盤可使用6*21按鍵矩陣的示意圖。 圖5為依照本發明實施例所繪示鍵盤輸入裝置的方塊示意圖,所述輸入裝置具有兩種掃描模式,分別對應兩個按鍵組。 圖6為依照本發明另一鍵盤輸入裝置的方塊示意圖,所述輸入裝置具有三種掃描模式,分別對應三個按鍵組。 圖7A為依照本發明另一鍵盤輸入裝置的方塊示意圖,適用於第一掃描模式。 圖7B為依照本發明另一鍵盤輸入裝置的方塊示意圖,適用於第二掃描模式。 圖7C為依照本發明另一鍵盤輸入裝置的方塊示意圖,適用於第三掃描模式。 圖8為依照本發明另一實施例所繪示的執行第一掃描模式的按鍵掃描方法的流程示意圖。 圖9為依照本發明另一實施例所繪示的執行第二掃描模式的按鍵掃描方法的流程示意圖。 圖10為依照本發明另一實施例所繪示的執行第三掃描模式的按鍵掃描方法的流程示意圖。 FIG. 1 is a schematic flowchart of a key scan method for executing a first scan mode and a second scan mode according to an embodiment of the present invention. 2 is a schematic flowchart of a key scan method for executing the first scan mode, the second scan mode, and the third scan mode according to an embodiment of the present invention. FIG. 3 is a schematic flowchart of a scanning method used in a key scanning circuit according to another embodiment of the present invention. FIG. 4A is a schematic diagram illustrating that a keyboard can use a 6*21 key matrix according to another embodiment of the present invention. FIG. 4B is a schematic diagram illustrating that a keyboard in the first scan mode can use a 6*21 key matrix according to another embodiment of the present invention. FIG. 4C is a schematic diagram illustrating that a keyboard in the second scan mode can use a 6*21 key matrix according to another embodiment of the present invention. 5 is a block diagram of a keyboard input device according to an embodiment of the present invention. The input device has two scanning modes, corresponding to two key groups respectively. 6 is a block diagram of another keyboard input device according to the present invention. The input device has three scanning modes, corresponding to three key groups respectively. 7A is a block diagram of another keyboard input device according to the present invention, which is suitable for the first scanning mode. 7B is a block diagram of another keyboard input device according to the present invention, which is suitable for the second scanning mode. 7C is a block diagram of another keyboard input device according to the present invention, which is suitable for the third scanning mode. FIG. 8 is a schematic flowchart of a key scan method for executing the first scan mode according to another embodiment of the present invention. FIG. 9 is a schematic flowchart of a key scan method for executing the second scan mode according to another embodiment of the present invention. FIG. 10 is a schematic flowchart of a key scan method for executing the third scan mode according to another embodiment of the present invention.

S200~S231:流程步驟S200~S231: Process steps

Claims (25)

一種按鍵掃描方法,適用於一個具有多個按鍵的輸入裝置,該多個按鍵的其中一部分組成第一按鍵組,該多個按鍵的其中另一部分組成第二按鍵組,且該輸入裝置還具有用於掃描該多個按鍵的多條掃描線以及對應該多個按鍵的多條感應信號線,該多條掃描線包括第一主掃描線與多條次掃描線,其中該第一主掃描線電性連接至該第一按鍵組,該多條次掃描線電性連接至該第二按鍵組,該按鍵掃描方法包括: 執行第一掃描模式,該第一掃描模式包括: 執行第一掃描程式,該第一掃描程式包括觸發該第一主掃描線,並讀取該多條感應信號線的電信號,以判斷該第一按鍵組中是否有按鍵被觸發;以及 執行第二掃描程式,該第二掃描程式為觸發該多條次掃描線的至少其中之一,並讀取該多條感應信號線的該電信號,以判斷該第二按鍵組中是否有按鍵被觸發; 其中,該第一掃描程式與該第二掃描程式為交替執行,並且每一次掃描線至少被觸發一次。 A key scanning method is suitable for an input device with multiple keys. A part of the multiple keys forms a first key group, and another part of the multiple keys forms a second key group, and the input device also has For scanning the plurality of scan lines of the plurality of keys and the plurality of sensing signal lines corresponding to the plurality of keys, the plurality of scan lines include a first main scan line and a plurality of sub scan lines, wherein the first main scan line is electrically Are electrically connected to the first button group, the plurality of secondary scan lines are electrically connected to the second button group, and the button scanning method includes: Perform a first scan mode, the first scan mode includes: Execute a first scan program, the first scan program includes triggering the first main scan line, and reading the electrical signals of the plurality of sensing signal lines to determine whether a button in the first button group is triggered; and Execute a second scan program, the second scan program is to trigger at least one of the plurality of secondary scan lines, and read the electrical signals of the plurality of sensing signal lines to determine whether there is a button in the second button group Be triggered Wherein, the first scan program and the second scan program are executed alternately, and each scan line is triggered at least once. 如申請專利範圍第1項所述之按鍵掃描方法,其中該多個按鍵的排列形式為一矩陣,由R列和C行所組成,其中R與C為大於等於2的正整數。As for the button scanning method described in item 1 of the scope of patent application, the arrangement of the plurality of buttons is a matrix consisting of R columns and C rows, where R and C are positive integers greater than or equal to 2. 如申請專利範圍第2項所述之按鍵掃描方法,其中該多條次掃描線的列序排在該第一主掃描線的列序之後,該多條感應信號線對應該矩陣的第一行至第C行進行設置。According to the key scanning method described in item 2 of the scope of patent application, the column sequence of the multiple sub-scanning lines is arranged after the column sequence of the first main scanning line, and the multiple sensing signal lines correspond to the first row of the matrix Go to line C to set. 如申請專利範圍第1項所述之按鍵掃描方法,該按鍵掃描方法還包括第二掃描模式,其中在執行該第一掃描模式或該第二掃描模式的步驟前,該按鍵掃描方法還包括: 判斷該第一掃描模式與該第二掃描模式何者被致能; 若該第一掃描模式被致能,則執行該第一掃描模式;以及 若該第二掃描模式被致能,則執行該第二掃描模式,該第二掃描模式包括交替執行該第一掃描程式與第三掃描程式,該第三掃描程式包括依序觸發該多條次掃描線,並讀取該多條感應信號線的該電信號,以判斷該第二按鍵組中是否有按鍵被觸發。 For the key scanning method described in item 1 of the scope of patent application, the key scanning method further includes a second scanning mode, wherein before the step of executing the first scanning mode or the second scanning mode, the key scanning method further includes: Determining which of the first scanning mode and the second scanning mode is enabled; If the first scan mode is enabled, execute the first scan mode; and If the second scan mode is enabled, the second scan mode is executed. The second scan mode includes alternately executing the first scan program and the third scan program, and the third scan program includes sequentially triggering the multiple lines Scan lines, and read the electrical signals of the plurality of sensing signal lines to determine whether a button in the second button group is triggered. 如申請專利範圍第4項所述之按鍵掃描方法,其中該多個按鍵的其中又一部分組成第三按鍵組,且用於掃描該多個按鍵的該多條掃描線還包括第二主掃描線,該第二主掃描線電性連接至該第三按鍵組,該按鍵掃描方法還包括第三掃描模式,且在執行該第一掃描模式、該第二掃描模式或該第三掃描模式的步驟前,該按鍵掃描方法還包括: 判斷該第一掃描模式、該第二掃描模式以及該第三掃描模式何者被致能;以及 若該第三掃描模式被致能,則執行該第三掃描模式,該第三掃描模式包括: 執行該第一掃描程式; 執行第四掃描程式,該第四掃描程式包括觸發該第二主掃描線,並讀取該多條感應信號線的該電信號,以判斷該第三按鍵組中是否有按鍵被觸發;以及 執行該第二掃描程式; 其中,該第一掃描程式、該第四掃描程式與該第二掃描程式為交替執行,並且每一次掃描線至少被觸發一次。 The button scanning method described in item 4 of the scope of patent application, wherein another part of the plurality of buttons forms a third button group, and the plurality of scan lines used to scan the plurality of buttons further includes a second main scan line , The second main scan line is electrically connected to the third key group, the key scan method further includes a third scan mode, and in the step of executing the first scan mode, the second scan mode, or the third scan mode Previously, the key scan method also includes: Determine which of the first scan mode, the second scan mode, and the third scan mode is enabled; and If the third scanning mode is enabled, the third scanning mode is executed, and the third scanning mode includes: Execute the first scanning program; Execute a fourth scan program, the fourth scan program includes triggering the second main scan line, and reading the electrical signals of the plurality of sensing signal lines to determine whether a button in the third button group is triggered; and Execute the second scanning program; Wherein, the first scan program, the fourth scan program, and the second scan program are executed alternately, and each scan line is triggered at least once. 如申請專利範圍第5項所述之按鍵掃描方法,其中該第一按鍵組的使用頻率比該第三按鍵組的使用頻率高。According to the key scanning method described in item 5 of the scope of patent application, the frequency of use of the first key group is higher than that of the third key group. 如申請專利範圍第5項所述之按鍵掃描方法,其中該第二主掃描線的列序排在該第一主掃描線的列序之後,該多條次掃描線的列序排在該第二主掃描線的列序之後。As for the key scanning method described in item 5 of the scope of patent application, the column sequence of the second main scanning line is arranged after the column sequence of the first main scanning line, and the column sequence of the plurality of sub scanning lines is arranged in the first After the column sequence of the main scan line. 如申請專利範圍第1項所述之按鍵掃描方法,其中該多個按鍵的其中又一部分組成第三按鍵組,且用於掃描該多個按鍵的該多條掃描線還包括第二主掃描線,該第二主掃描線電性連接至該第三按鍵組,該按鍵掃描方法還包括第三掃描模式,而在執行該第一掃描模式或該第三掃描模式的步驟前,該按鍵掃描方法還包括: 判斷該第一掃描模式與該第三掃描模式何者被致能; 若該第一掃描模式被致能,則執行該第一掃描模式;以及 若該第三掃描模式被致能,則執行該第三掃描模式,該第三掃描模式包括: 執行該第一掃描程式; 執行第四掃描程式,該第四掃描程式包括觸發該第二主掃描線,並讀取該多條感應信號線的該電信號,以判斷該第三按鍵組中是否有按鍵被觸發;以及 執行該第二掃描程式; 其中,該第一掃描程式、該第四掃描程式與該第二掃描程式為交替執行,並且每一次掃描線至少被觸發一次。 The button scanning method described in item 1 of the scope of patent application, wherein another part of the plurality of buttons forms a third button group, and the plurality of scan lines used to scan the plurality of buttons further includes a second main scan line , The second main scanning line is electrically connected to the third key group, the key scanning method further includes a third scanning mode, and before the step of executing the first scanning mode or the third scanning mode, the key scanning method Also includes: Determining which of the first scanning mode and the third scanning mode is enabled; If the first scan mode is enabled, execute the first scan mode; and If the third scanning mode is enabled, the third scanning mode is executed, and the third scanning mode includes: Execute the first scanning program; Execute a fourth scan program, the fourth scan program includes triggering the second main scan line, and reading the electrical signals of the plurality of sensing signal lines to determine whether a button in the third button group is triggered; and Execute the second scanning program; Wherein, the first scan program, the fourth scan program, and the second scan program are executed alternately, and each scan line is triggered at least once. 如申請專利範圍第8項所述之按鍵掃描方法,其中該第一按鍵組的使用頻率比該第三按鍵組的使用頻率高。In the key scanning method described in item 8 of the scope of patent application, the frequency of use of the first key group is higher than that of the third key group. 如申請專利範圍第8項所述之按鍵掃描方法,其中該第二主掃描線的列序排在該第一主掃描線的列序之後,該多條次掃描線的列序排在該第二主掃描線的列序之後。According to the key scanning method described in item 8 of the scope of patent application, the column sequence of the second main scanning line is arranged after the column sequence of the first main scanning line, and the column sequence of the plurality of sub-scanning lines is arranged in the first After the column sequence of the main scan line. 一種使用於按鍵掃描電路的掃描方法,該按鍵掃描電路可掃描第一按鍵組與第二按鍵組,該第一按鍵組包含X個優先按鍵,該第二按鍵組包含Y個次要按鍵,該按鍵掃描電路包括M條主掃描線Sa(1)至Sa(M)、N條次掃描線Sb(1)至Sb(N)與多條感應信號線,其中X、Y、M、N 為正整數,該M條主掃描線 Sa(1)至Sa(M)電性連接至該X個優先按鍵,該N條次掃描線Sb(1)至Sb(N)電性連接至該Y個次要按鍵,該掃描方法包括下列步驟: 步驟(1),開始掃描迴圈,設定主掃描次數j的初始值為0; 步驟(2a),判斷該主掃描次數j是否等於主掃描預設上限值Jmax,其中Jmax為正整數,若是,則執行步驟(3),若否,則執行步驟(2b); 步驟(2b),輪流觸發該 M 條主掃描線 Sa(1)至Sa(M) 中的每一條,讀取該多條感應信號線的電信號,以偵測該X個優先按鍵中是否有按鍵被觸發; 步驟(2c),增加該主掃描次數 j 的值,其中 j = j + 1,並回到步驟 (2a); 步驟(3),輪流觸發該 N 條次掃描線 Sb(1)至Sb(N) 的其中 P 條次掃描線,讀取該多條感應信號線的該電信號,其中,該P條次掃描線耦接到該Y個次要按鍵中的 Q個次要按鍵,以偵測該Q個次要按鍵中是否有按鍵被觸發,其中P < N,且Q < Y,P、Q為正整數;以及 步驟(4),於該掃描迴圈中,判斷該N條次掃描線 Sb(1)至Sb(N)是否均被觸發過,若是則結束該掃描迴圈,若否,則設定該主掃描次數j為0,並回到步驟(2a)。 A scanning method used in a key scanning circuit. The key scanning circuit can scan a first key group and a second key group. The first key group includes X priority keys, and the second key group includes Y secondary keys. The key scan circuit includes M main scan lines Sa(1) to Sa(M), N sub scan lines Sb(1) to Sb(N), and multiple sensing signal lines, where X, Y, M, and N are positive Integer, the M main scan lines Sa(1) to Sa(M) are electrically connected to the X priority buttons, and the N secondary scan lines Sb(1) to Sb(N) are electrically connected to the Y secondary To press the key, the scanning method includes the following steps: Step (1), start the scan loop, and set the initial value of the main scan times j to 0; Step (2a), determine whether the number of main scans j is equal to the preset upper limit Jmax of the main scan, where Jmax is a positive integer, if yes, execute step (3), if not, execute step (2b); Step (2b), trigger each of the M main scan lines Sa(1) to Sa(M) in turn, read the electrical signals of the multiple sensing signal lines to detect whether there are any of the X priority buttons The button is triggered; Step (2c), increase the value of the main scan times j, where j = j + 1, and return to step (2a); Step (3), trigger P sub-scan lines of the N sub-scan lines Sb(1) to Sb(N) in turn, and read the electrical signals of the plurality of sensing signal lines, where the P sub-scan lines The line is coupled to the Q secondary buttons of the Y secondary buttons to detect whether any of the Q secondary buttons is triggered, where P <N and Q <Y, P and Q are positive integers ;as well as Step (4), in the scan loop, determine whether the N secondary scan lines Sb(1) to Sb(N) have been triggered, if yes, end the scan loop, if not, set the main scan The number of times j is 0, and return to step (2a). 如申請專利範圍第11項所述之掃描方法,其中當該按鍵掃描電路被設定為第一掃描模式時, M=1,該按鍵掃描電路具有一條主掃描線,定義為第一主掃描線Sa(1),該X個優先按鍵均電性連接至該第一主掃描線Sa(1)上,於該掃描迴圈中,輪流觸發該第一主掃描線Sa(1)與該N條次掃描線Sb(1)至Sb(N)的順序為:Sa(1)掃描 Jmax 次 -> Sb(1) 至 Sb(P) 輪流掃描一次 -> Sa(1)掃描Jmax次-> Sb(1+P) 至Sb(2P)掃描一次直到該N條次掃描線Sb(1)至Sb(N)均被掃描過為止。The scanning method described in item 11 of the scope of patent application, wherein when the key scanning circuit is set to the first scanning mode, M=1, the key scanning circuit has a main scanning line defined as the first main scanning line Sa (1) The X priority buttons are all electrically connected to the first main scan line Sa(1), and in the scan loop, the first main scan line Sa(1) and the N times The sequence of scanning lines Sb(1) to Sb(N) is: Sa(1) scan Jmax times -> Sb(1) to Sb(P) scan once in turn -> Sa(1) scan Jmax times -> Sb(1 +P) to Sb(2P) scan once until the N sub-scanning lines Sb(1) to Sb(N) are all scanned. 如申請專利範圍第12項所述之掃描方法,其中當Jmax=1且P=1時,於該掃描迴圈中,輪流觸發該第一主掃描線Sa(1)與該N條次掃描線Sb(1)至Sb(N)的順序為:Sa(1) -> Sb(1) -> Sa(1) -> Sb(2) -> Sa(1) -> Sb(3)直到步驟 Sa(1) -> Sb(N)為止。The scanning method described in item 12 of the scope of patent application, wherein when Jmax=1 and P=1, in the scanning loop, the first main scanning line Sa(1) and the N secondary scanning lines are triggered alternately The order of Sb(1) to Sb(N) is: Sa(1) -> Sb(1) -> Sa(1) -> Sb(2) -> Sa(1) -> Sb(3) until step Sa (1) -> Sb(N). 如申請專利範圍第12項所述之掃描方法,其中該第一掃描模式為電競模式,該X個優先按鍵至少包含“W”、“A”、“S”、“D”四個英文字母鍵與“上 ”、“下”、“左”、“右”四個方向鍵。The scanning method described in item 12 of the scope of patent application, wherein the first scanning mode is an e-sports mode, and the X priority buttons contain at least four English letters "W", "A", "S", and "D" Key and the four arrow keys "up", "down", "left" and "right". 如申請專利範圍第11項所述之掃描方法,其中當該按鍵掃描電路被設定為第二掃描模式時,M=2,該按鍵掃描電路具有兩條主掃描線,分別為第一主掃描線Sa(1)和第二主掃描線Sa(2),該X個優先按鍵電性連接至該兩條主掃描線Sa(1)、Sa(2),於該掃描迴圈中,輪流觸發該兩條主掃描線Sa(1)、Sa(2)與該N條次掃描線Sb(1)至Sb(N)的順序為:Sa(1)至Sa(2)迴圈掃描Jmax次-> Sb(1)至Sb(P) 掃描一次-> Sa(1)至Sa(2)迴圈掃描Jmax次 -> Sb(1+P) 至Sb(2P) 掃描一次-> Sa(1)至Sa(2)迴圈掃描Jmax次-> Sb(1+2P) 至Sb(3P)掃描一次,直到該N條次掃描線Sb(1)至Sb(N)均被掃描過為止。The scanning method described in item 11 of the scope of patent application, wherein when the key scanning circuit is set to the second scanning mode, M=2, the key scanning circuit has two main scanning lines, respectively the first main scanning line Sa(1) and the second main scan line Sa(2), the X priority buttons are electrically connected to the two main scan lines Sa(1), Sa(2), and in the scan loop, trigger the The order of the two main scanning lines Sa(1), Sa(2) and the N sub-scanning lines Sb(1) to Sb(N) is: Sa(1) to Sa(2) loop scanning Jmax times -> Sb(1) to Sb(P) scan once -> Sa(1) to Sa(2) loop scan Jmax times -> Sb(1+P) to Sb(2P) scan once -> Sa(1) to Sa (2) Loop scanning Jmax times -> Sb(1+2P) to Sb(3P) scanning once, until the N sub-scanning lines Sb(1) to Sb(N) are all scanned. 如申請專利範圍第15項所述之掃描方法,其中當Jmax=1且P=1時,於該掃描迴圈中,輪流觸發該兩條主掃描線Sa(1)、Sa(2)與該 N 條次掃描線 Sb(1)至Sb(N)的順序為:Sa(1) -> Sa(2)-> Sb(1) -> Sa(1) -> Sa(2)-> Sb(2) -> Sa(1) -> Sa(2)-> Sb(3),直到步驟 [Sa(1) -> Sa(2)-> Sb(N)]為止。The scanning method described in item 15 of the scope of patent application, wherein when Jmax=1 and P=1, in the scanning loop, the two main scanning lines Sa(1), Sa(2) and the The sequence of N secondary scan lines Sb(1) to Sb(N) is: Sa(1) -> Sa(2)-> Sb(1) -> Sa(1) -> Sa(2)-> Sb( 2) -> Sa(1) -> Sa(2) -> Sb(3), until step [Sa(1) -> Sa(2) -> Sb(N)]. 如申請專利範圍第16項所述之掃描方法,其中該第二掃描模式為文書模式,該X個優先按鍵至少包含“A至Z”26個英文字母鍵。The scanning method described in item 16 of the scope of patent application, wherein the second scanning mode is a document mode, and the X priority keys include at least 26 English letter keys "A to Z". 一輸入裝置,包括: 按鍵掃描電路 ,該按鍵掃描電路包括M條主掃描線 Sa(1)至Sa(M),N 條次掃描線 Sb(1)至Sb(N) 與多條感應信號線,其中M、N為正整數; 第一按鍵組,該第一按鍵組包含X個優先按鍵,該M 條主掃描線 Sa(1)至Sa(M) 電性連接至該X個優先按鍵,其中X為正整數;以及 第二按鍵組,該第二按鍵組包含Y個次要按鍵,該N條次掃描線 Sb(1)至Sb(N) 電性連接至該Y個次要按鍵,其中Y 為正整數; 其中該按鍵掃描電路執行下列步驟: 步驟(1),開始掃描迴圈,設定主掃描次數 j 的初始值為 0; 步驟(2a),判斷該主掃描次數j是否等於主掃描預設上限值Jmax,其中Jmax為正整數;若是,則執行步驟 (3),若否,則執行步驟(2b); 步驟(2b),輪流觸發該 M 條主掃描線 Sa(1)至Sa(M) 中的每一條, 並讀取該多條感應信號線的電信號,以偵測該X個優先按鍵中是否有按鍵被觸發; 步驟(2c),增加該主掃描次數 j 的值,其中 j = j + 1,並回到步驟 (2a); 步驟(3),輪流觸發該N條次掃描線Sb(1)至Sb(N)的其中P條次掃描線,並讀取該多條感應信號線的該電信號,其中,該P條次掃描線為耦接到該Y個次要按鍵中的Q個次要按鍵,以偵測該Q個次要按鍵中是否有按鍵被觸發,其中P < N,且Q < Y,P、Q為正整數;以及 步驟(4),於該掃描迴圈中,判斷該N條次掃描線 Sb(1)至Sb(N)是否均被觸發過,若否,則設定該主掃描次數j為0,並回到步驟(2a) ,若是,則結束該掃描迴圈。 An input device, including: Key scan circuit, the key scan circuit includes M main scan lines Sa(1) to Sa(M), N sub scan lines Sb(1) to Sb(N) and multiple sensing signal lines, where M and N are Positive integer; A first button group, the first button group includes X priority buttons, the M main scan lines Sa(1) to Sa(M) are electrically connected to the X priority buttons, where X is a positive integer; and A second button group, the second button group includes Y secondary buttons, the N secondary scan lines Sb(1) to Sb(N) are electrically connected to the Y secondary buttons, where Y is a positive integer; The key scanning circuit performs the following steps: Step (1), start scanning loop, set the initial value of the main scanning times j to 0; Step (2a), judge whether the main scan number j is equal to the main scan preset upper limit Jmax, where Jmax is a positive integer; if it is, execute step (3), if not, execute step (2b); Step (2b), trigger each of the M main scan lines Sa(1) to Sa(M) in turn, and read the electrical signals of the multiple sensing signal lines to detect whether the X priority buttons are A key is triggered; Step (2c), increase the value of the main scan times j, where j = j + 1, and return to step (2a); Step (3): Trigger P of the N secondary scan lines Sb(1) to Sb(N) in turn, and read the electrical signals of the plurality of sensing signal lines, where the P secondary scan lines The scan line is coupled to the Q secondary buttons of the Y secondary buttons to detect whether any of the Q secondary buttons is triggered, where P <N and Q <Y, and P and Q are Positive integer; and Step (4), in the scan loop, determine whether the N secondary scan lines Sb(1) to Sb(N) have been triggered, if not, set the main scan number j to 0, and return Step (2a), if yes, end the scan loop. 如申請專利範圍第18項所述之輸入裝置,其中M=1,該按鍵掃描電路具有一條主掃描線,定義為第一主掃描線Sa(1),該X個優先按鍵至少包含“W”、“A”、“S”、“D”四個英文字母鍵與“上 ”、“下”、“左”、“右”四個方向鍵,該X個優先按鍵均電性連接至該第一主掃描線Sa(1); 其中當該按鍵掃描電路未被設定為第一掃描模式時,Jmax = 1,P =N,於該掃描迴圈中,輪流觸發該第一主掃描線Sa(1)與該N條次掃描線Sb(1)至Sb(N)的順序為:Sa(1) -> Sb(1) -> Sb(2) -> Sb(3) 直到 Sb(N) 為止,使該第一主掃描線Sa(1)與該 N 條次掃描線 Sb(1)至Sb(N)中每一條均被觸發相同的次數; 其中當該按鍵掃描電路被設定為該第一掃描模式時,Jmax >= 1,P <N,於該掃描迴圈中,輪流觸發該第一主掃描線Sa(1)與該N條次掃描線Sb(1)至Sb(N)的順序為:Sa(1)掃描Jmax次 -> Sb(1)至Sb(P)掃描一次-> Sa(1)掃描Jmax 次-> Sb(P+1)至Sb(2P)掃描一次直到該N條次掃描線Sb(1)至Sb(N)均被掃描過為止,使該第一主掃描線Sa(1)的被觸發次數高於該N條次掃描線Sb(1)至Sb(N)中每一條的被觸發次數。 For example, the input device described in item 18 of the scope of patent application, where M=1, the key scan circuit has a main scan line, defined as the first main scan line Sa(1), and the X priority keys contain at least "W" , "A", "S", and "D" four English letter keys and four direction keys "up", "down", "left" and "right". The X priority keys are electrically connected to the A main scan line Sa(1); When the key scan circuit is not set to the first scan mode, Jmax = 1, P = N, in the scan loop, the first main scan line Sa(1) and the N sub scan lines are triggered in turn The sequence from Sb(1) to Sb(N) is: Sa(1) -> Sb(1) -> Sb(2) -> Sb(3) until Sb(N), so that the first main scan line Sa (1) The same number of times as each of the N secondary scan lines Sb(1) to Sb(N) is triggered; When the key scan circuit is set to the first scan mode, Jmax >= 1, P <N, in the scan loop, trigger the first main scan line Sa(1) and the N sub scans in turn The order of lines Sb(1) to Sb(N) is: Sa(1) scan Jmax times -> Sb(1) to Sb(P) scan once -> Sa(1) scan Jmax times -> Sb(P+1) ) To Sb(2P) scan once until the N secondary scan lines Sb(1) to Sb(N) have been scanned, so that the first main scan line Sa(1) is triggered more frequently than the N The number of times each of the secondary scan lines Sb(1) to Sb(N) is triggered. 如申請專利範圍第19項所述之輸入裝置,其中當 Jmax=1 且 P=1 時,於該掃描迴圈中,輪流觸發該第一主掃描線Sa(1)與該 N 條次掃描線 Sb(1)至Sb(N)的順序為:Sa(1) -> Sb(1) -> Sa(1) -> Sb(2) -> Sa(1) -> Sb(3)直到步驟 [Sa(1) -> Sb(N)]為止。The input device described in item 19 of the scope of patent application, wherein when Jmax=1 and P=1, in the scan loop, the first main scan line Sa(1) and the N sub scan lines are triggered in turn The order of Sb(1) to Sb(N) is: Sa(1) -> Sb(1) -> Sa(1) -> Sb(2) -> Sa(1) -> Sb(3) until step [ Sa(1) -> Sb(N)]. 如申請專利範圍第18項所述之輸入裝置,其中M=2,該按鍵掃描電路具有兩條主掃描線,分別為第一主掃描線Sa(1)和第二主掃描線Sa(2),該X個優先按鍵至少包含 “A至Z” 26個英文字母鍵,該X個優先按鍵電性連接至該兩條主掃描線 Sa(1)、Sa(2); 其中當該按鍵掃描電路未被設定為第二掃描模式時,Jmax = 1,P =N,於該掃描迴圈中,輪流觸發該兩條主掃描線Sa(1)、Sa(2)與該 N 條次掃描線 Sb(1)至Sb(N)的順序為:Sa(1) -> Sa(2) -> Sb(1) -> Sb(2) -> Sb(3) 直到Sb(N) 為止,使該兩條主掃描線Sa(1)、Sa(2)中每一條與該N條次掃描線Sb(1)至Sb(N)中每一條均被觸發相同的次數; 其中當該按鍵掃描電路被設定為該第二掃描模式時,Jmax >= 1,P <N,於該掃描迴圈中,輪流觸發該兩條主掃描線Sa(1)、Sa(2)與該 N 條次掃描線 Sb(1)至Sb(N)的順序為:Sa(1)至Sa(2)迴圈掃描 Jmax 次-> Sb(1)至Sb(P)掃描一次-> Sa(1)至Sa(2)迴圈掃描 Jmax 次->Sb(P+1)至Sb(2P)掃描一次,直到該N條次掃描線Sb(1)至Sb(N)均被掃描過為止,使該兩條主掃描線Sa(1)~Sa(2)中每一條的被觸發次數高於該N條次掃描線 Sb(1)至Sb(N)中每一條的被觸發次數。 The input device described in item 18 of the scope of patent application, where M=2, the key scanning circuit has two main scanning lines, namely the first main scanning line Sa(1) and the second main scanning line Sa(2) , The X priority buttons include at least 26 English letter keys "A to Z", and the X priority buttons are electrically connected to the two main scan lines Sa(1) and Sa(2); When the key scan circuit is not set to the second scan mode, Jmax = 1, P = N, in the scan loop, the two main scan lines Sa(1), Sa(2) and the The sequence of N secondary scan lines Sb(1) to Sb(N) is: Sa(1) -> Sa(2) -> Sb(1) -> Sb(2) -> Sb(3) until Sb(N ) Until each of the two main scan lines Sa(1), Sa(2) and each of the N secondary scan lines Sb(1) to Sb(N) are triggered the same number of times; When the key scan circuit is set to the second scan mode, Jmax >= 1, P <N, in the scan loop, the two main scan lines Sa(1), Sa(2) and The sequence of the N sub-scanning lines Sb(1) to Sb(N) is: Sa(1) to Sa(2) loop scan Jmax times -> Sb(1) to Sb(P) scan once -> Sa( 1) Scan Jmax times in a loop to Sa(2) -> Sb(P+1) to Sb(2P) scan once, until the N sub-scanning lines Sb(1) to Sb(N) have been scanned, The number of triggers of each of the two main scan lines Sa(1) to Sa(2) is higher than the number of triggers of each of the N secondary scan lines Sb(1) to Sb(N). 如申請專利範圍第19項所述之輸入裝置,其中當 Jmax=1 且 P=1 時,於該掃描迴圈中,輪流觸發該兩條主掃描線Sa(1)、Sa(2)與該 N 條次掃描線 Sb(1)至Sb(N)的順序為:Sa(1) ->Sa(2)-> Sb(1) -> Sa(1) ->Sa(2) -> Sb(2) -> Sa(1) ->Sa(2) -> Sb(3)直到步驟Sa(1) -> Sa(2) -> Sb(N)為止。For the input device described in item 19 of the scope of patent application, when Jmax=1 and P=1, in the scan loop, the two main scan lines Sa(1), Sa(2) and the The sequence of N secondary scan lines Sb(1) to Sb(N) is: Sa(1) ->Sa(2)->Sb(1) -> Sa(1) ->Sa(2) -> Sb( 2) -> Sa(1) -> Sa(2) -> Sb(3) until step Sa(1) -> Sa(2) -> Sb(N). 一種輸入裝置,包括: 按鍵掃描電路 ,該按鍵掃描電路包括 N+1 條掃描線 Row 0~Row N,與多條感應信號線,N為正整數; 其中該按鍵掃描電路執行下列步驟: 步驟(1),開始掃描迴圈,判斷該輸入裝置目前是否為第一掃描模式、第二掃描模式或第三掃描模式其中之一,據此分別執行步驟(2)、步驟(3)或步驟(4)其中之一; 步驟(2),當該輸入裝置於第一掃描模式時執行: 該按鍵掃描電路輪流觸發該複數條掃描線 Row 0~Row N 其中之一直到該複數條掃描線中每一條都被觸發過為止,並讀取該多條感應信號線的電信號,偵測該輸入裝置中是否有按鍵被觸發,並結束該掃描迴圈; 步驟(3),當該輸入裝置於第二掃描模式時執行: 步驟(3a),該按鍵掃描電路將掃描線 Row 0定義為第一主掃描線 Sa(1)、並將掃描線 Row 1~Row N 定義為 N 條次掃描線 Sb(1) 至 Sb(N); 步驟(3b),該按鍵掃描電路將電性連接至該第一主掃描線 Sa(1) 的 X1 個按鍵定義為第一按鍵組,並將未電性連接至該第一主掃描線 Sa(1) 的其餘 Y1 個按鍵定義為第二按鍵組,X1、Y1為正整數; 步驟(3c),設定主掃描次數 j 的初始值為 0; 步驟(3d),判斷該主掃描次數j是否等於預設上限值Jmax,其中預設上限值Jmax為正整數;若是,則執行步驟 (3g),若否,則執行步驟(3e); 步驟(3e),觸發該第一主掃描線 Sa(1),讀取該多條感應信號線的該電信號,偵測該X1個優先按鍵中是否有按鍵被觸發; 步驟(3f),增加該主掃描次數 j 的值,其中 j = j + 1,並回到步驟 (3d); 步驟(3g),輪流觸發該 N 條次掃描線Sb(1)至Sb(N)的其中 P 條,其中,該P條次掃描線為耦接到該Y1個次要按鍵中的Q個次要按鍵,讀取該多條感應信號線的該電信號,偵測該Q個次要按鍵中是否有按鍵被觸發,其中P < N、Q < Y1,P、Q為正整數; 步驟(3i),判斷該N條次掃描線Sb(1)至Sb(N)是否均被觸發過,若否,則設定該主掃描次數j為0,並回到步驟(3d) ,若是,則結束該掃描迴圈; 步驟(4),當該輸入裝置於第三掃描模式時執行: 步驟(4a),該按鍵掃描電路將掃描線 Row 0~Row 1定義為兩條主掃描線 Sa(1)~Sa(2)、並將掃描線 Row 2~Row N 定義為 N-1 條次掃描線 Sb(1)至Sb(N-1); 步驟(4b),該按鍵掃描電路將電性連接至該兩條主掃描線 Sa(1)~Sa(2) 的 X2 個按鍵定義為第一按鍵組,並將未電性連接至該兩條主掃描線 Sa(1)~Sa(2) 的其餘 Y2 個按鍵定義為第二按鍵組,X2、Y2為正整數; 步驟(4c),設定主掃描次數 j 的初始值為 0; 步驟(4d),判斷該主掃描次數j是否等於預設上限值Jmax,其中預設上限值Jmax為正整數,若是,則執行步驟 (4g),若否,則執行步驟(4e); 步驟(4e),輪流觸發該兩條主掃描線 Sa(1)~Sa(2),讀取該多條感應信號線的該電信號,偵測該X2個優先按鍵中是否有按鍵被觸發; 步驟(4f),增加該主掃描次數 j 的值,其中 j = j + 1,並回到步驟 (4d); 步驟(4g),輪流觸發該 N-1 條次掃描線Sb(1)至Sb(N-1)的其中 P 條,該P條次掃描線是耦接到該Y2個次要按鍵中的Q個次要按鍵,並讀取該多條感應信號線的該電信號,偵測該Q個次要按鍵中是否有按鍵被觸發,其中P < N-1、Q < Y2,P、Q為正整數;以及 步驟(4h),判斷該N-1條次掃描線Sb(1)至Sb(N-1)是否均被觸發過,若否,則設定該主掃描次數j為0,並回到步驟(4d),若是,則結束該掃描迴圈。 An input device, including: Button scanning circuit, the button scanning circuit includes N+1 scanning lines Row 0~Row N, and multiple sensing signal lines, N is a positive integer; The key scanning circuit performs the following steps: Step (1), start a scanning loop, determine whether the input device is currently in one of the first scan mode, the second scan mode, or the third scan mode, and perform step (2), step (3) or step accordingly (4) One of them; Step (2), execute when the input device is in the first scan mode: The key scanning circuit triggers one of the plurality of scan lines Row 0~Row N in turn until each of the plurality of scan lines is triggered, and reads the electrical signals of the plurality of sensing signal lines, and detects the Whether a button in the input device is triggered and the scanning loop is ended; Step (3), when the input device is in the second scan mode, execute: Step (3a), the key scan circuit defines the scan line Row 0 as the first main scan line Sa(1), and defines the scan lines Row 1~Row N as N secondary scan lines Sb(1) to Sb(N ); In step (3b), the button scanning circuit defines X1 buttons electrically connected to the first main scanning line Sa(1) as a first button group, and electrically connecting the buttons to the first main scanning line Sa( 1) The remaining Y1 buttons are defined as the second button group, X1 and Y1 are positive integers; Step (3c), set the initial value of the main scan times j to 0; Step (3d), judging whether the number of main scans j is equal to the preset upper limit Jmax, where the preset upper limit Jmax is a positive integer; if yes, execute step (3g), if not, execute step (3e); Step (3e), trigger the first main scan line Sa(1), read the electrical signals of the multiple sensing signal lines, and detect whether any of the X1 priority keys is triggered; Step (3f), increase the value of the main scan times j, where j = j + 1, and return to step (3d); In step (3g), P of the N secondary scan lines Sb(1) to Sb(N) are triggered in turn, where the P secondary scan lines are coupled to Q of the Y1 secondary keys To press a key, read the electrical signals of the multiple sensing signal lines, and detect whether a key is triggered in the Q secondary keys, where P <N, Q <Y1, and P and Q are positive integers; Step (3i), determine whether the N secondary scan lines Sb(1) to Sb(N) have been triggered, if not, set the main scan number j to 0, and return to step (3d), if yes, End the scan loop; Step (4), execute when the input device is in the third scan mode: Step (4a), the key scan circuit defines the scan line Row 0~Row 1 as two main scan lines Sa(1)~Sa(2), and defines the scan line Row 2~Row N as N-1 times Scan lines Sb(1) to Sb(N-1); Step (4b), the button scanning circuit defines the X2 buttons electrically connected to the two main scanning lines Sa(1)~Sa(2) as the first button group, and electrically connects the two buttons The remaining Y2 buttons of the main scan line Sa(1)~Sa(2) are defined as the second button group, and X2 and Y2 are positive integers; Step (4c), set the initial value of the main scan times j to 0; Step (4d), determine whether the number of main scans j is equal to the preset upper limit Jmax, where the preset upper limit Jmax is a positive integer, if yes, execute step (4g), if not, execute step (4e); Step (4e), trigger the two main scan lines Sa(1)~Sa(2) in turn, read the electrical signals of the multiple sensing signal lines, and detect whether any of the X2 priority buttons is triggered; Step (4f), increase the value of the main scan times j, where j = j + 1, and go back to step (4d); Step (4g), trigger P of the N-1 secondary scan lines Sb(1) to Sb(N-1) in turn, and the P secondary scan lines are coupled to Q in the Y2 secondary keys Secondary buttons, and read the electrical signals of the multiple sensing signal lines, and detect whether any of the Q secondary buttons are triggered, where P <N-1, Q <Y2, and P and Q are positive Integer; and Step (4h), determine whether the N-1 secondary scan lines Sb(1) to Sb(N-1) have been triggered, if not, set the main scan number j to 0, and return to step (4d ), if yes, end the scan loop. 如申請專利範圍第23項所述之輸入裝置,其中該第二掃描模式是為電競模式,該 X1 個優先按鍵至少包含“W”、“A”、“S”、“D”四個英文字母鍵與“上 ”、“下”、“左”、“右”四個方向鍵。Such as the input device described in item 23 of the scope of patent application, wherein the second scan mode is an e-sports mode, and the X1 priority buttons contain at least four English words: "W", "A", "S", and "D" Letter keys and four direction keys "up", "down", "left" and "right". 如申請專利範圍第23項所述之輸入裝置,其中該第三掃描模式是為文書模式,該X2個優先按鍵的組合至少包含 “A至Z” 26 個英文字母鍵 與“上 ”、“下”、“左”、“右”四個方向鍵。For example, the input device described in item 23 of the scope of patent application, wherein the third scanning mode is a document mode, and the combination of the X2 priority keys includes at least 26 English letter keys "A to Z" and "up" and "down" "," "Left", "Right" four direction keys.
TW108119754A 2019-06-06 2019-06-06 A scanning method for keys, a scanning method for keys scanning circuit, and an input device TWI715061B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108119754A TWI715061B (en) 2019-06-06 2019-06-06 A scanning method for keys, a scanning method for keys scanning circuit, and an input device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108119754A TWI715061B (en) 2019-06-06 2019-06-06 A scanning method for keys, a scanning method for keys scanning circuit, and an input device

Publications (2)

Publication Number Publication Date
TW202046065A TW202046065A (en) 2020-12-16
TWI715061B true TWI715061B (en) 2021-01-01

Family

ID=74668534

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108119754A TWI715061B (en) 2019-06-06 2019-06-06 A scanning method for keys, a scanning method for keys scanning circuit, and an input device

Country Status (1)

Country Link
TW (1) TWI715061B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI312124B (en) * 2005-04-19 2009-07-11 Wistron Corporatio Electronic device and its keyboard system and key status detecting method thereof
CN101686060A (en) * 2008-09-25 2010-03-31 旭丽电子(广州)有限公司 Control circuit and configuration method
US20100259424A1 (en) * 2009-04-14 2010-10-14 Wang Horng-Bin Power saving method in sleep mode and keyboard controller using the same
CN102227698A (en) * 2008-11-26 2011-10-26 京瓷株式会社 Key input device and portable mobile communication terminal using key input device
TW201346514A (en) * 2012-05-02 2013-11-16 Generalplus Technology Inc Ultra low power wake-up circuit device
TWI568196B (en) * 2015-08-17 2017-01-21 光寶電子(廣州)有限公司 Scaning circuit of keyboard, keyboard and scaning method thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI312124B (en) * 2005-04-19 2009-07-11 Wistron Corporatio Electronic device and its keyboard system and key status detecting method thereof
CN101686060A (en) * 2008-09-25 2010-03-31 旭丽电子(广州)有限公司 Control circuit and configuration method
CN102227698A (en) * 2008-11-26 2011-10-26 京瓷株式会社 Key input device and portable mobile communication terminal using key input device
US20100259424A1 (en) * 2009-04-14 2010-10-14 Wang Horng-Bin Power saving method in sleep mode and keyboard controller using the same
TW201346514A (en) * 2012-05-02 2013-11-16 Generalplus Technology Inc Ultra low power wake-up circuit device
TWI568196B (en) * 2015-08-17 2017-01-21 光寶電子(廣州)有限公司 Scaning circuit of keyboard, keyboard and scaning method thereof

Also Published As

Publication number Publication date
TW202046065A (en) 2020-12-16

Similar Documents

Publication Publication Date Title
US7658562B2 (en) Modified-QWERTY letter layout for rapid data entry
US7216588B2 (en) Modified-qwerty letter layout for rapid data entry
TWI222005B (en) Punching key input device
US6356258B1 (en) Keypad
KR100805770B1 (en) Character input apparatus
JPS6318421A (en) Expansion method and apparatus for keyboard function
TWI312124B (en) Electronic device and its keyboard system and key status detecting method thereof
JPH10326138A (en) Key input device
TWI715061B (en) A scanning method for keys, a scanning method for keys scanning circuit, and an input device
CN110266319B (en) Key scanning method, scanning method for key scanning circuit and input device
US20140300498A1 (en) Method and Apparatus Pertaining to a Touch Typing-Friendly Grid-Patterned Keyboard
TWI493869B (en) Keypad module and detecting method for keypad matrix
WO2017050048A1 (en) Numeric keyboard for inputting text, english input method, and chinese character pinyin input method
WO2020243952A1 (en) Key scanning method, scanning method used for key scanning circuit, and input device
TWI395116B (en) Notebook computer and keyboard controller thereof
JP4636415B2 (en) Alphabet entry device and method using reduced keypad
US20220171472A1 (en) Key scanning method and input device implemented therewith
TW201234217A (en) Character input device
JP4190951B2 (en) Key input device, mobile phone, and key input method
JP2001331253A (en) Key inputting device and portable telephone set
CN101008870A (en) Numeric keypad for dual spelling and input method there therefor
CN1265481A (en) Jiufang phonetic Chinese character input method and its keyboard
JP3071704B2 (en) Key input device
CN107340872B (en) Key system and control method thereof
JP2001075708A (en) Key input device and method for inputting japanese