TWI475472B - System for drawing on touch screen and method thereof - Google Patents
System for drawing on touch screen and method thereof Download PDFInfo
- Publication number
- TWI475472B TWI475472B TW101148242A TW101148242A TWI475472B TW I475472 B TWI475472 B TW I475472B TW 101148242 A TW101148242 A TW 101148242A TW 101148242 A TW101148242 A TW 101148242A TW I475472 B TWI475472 B TW I475472B
- Authority
- TW
- Taiwan
- Prior art keywords
- touch
- event
- touch event
- module
- drawing operation
- Prior art date
Links
Landscapes
- User Interface Of Digital Computer (AREA)
Description
一種繪圖系統及其方法,特別係指一種在觸控螢幕中提供繪圖操作之系統及其方法。A drawing system and method thereof, in particular, a system and method for providing a drawing operation in a touch screen.
隨著觸控螢幕的發展成熟,大部分的行動裝置,例如個人數位助理(PDA)、手機、平板電腦等,都設置了觸控螢幕,藉以提供使用者輸入使用,如此,使用者可以透過觸控螢幕選擇被顯示在觸控螢幕上的按鍵(button)、圖示(icon)等物件(object)、進行手寫輸入,甚至可以直接在觸控螢幕上繪圖。With the development of touch screens, most mobile devices, such as personal digital assistants (PDAs), mobile phones, and tablets, have been equipped with touch screens to provide user input, so that users can touch The control screen selects objects such as buttons, icons, etc. displayed on the touch screen, performs handwriting input, and can even draw directly on the touch screen.
目前,在部份的行動裝置的作業系統中,有提供如「InkPresenter」的繪圖元件可以使用,因此,在執行於這些行動裝置之作業系統的文字處理程式中開發繪圖功能是非常容易的,不過,在部分行動裝置的作業系統中,便沒有提供繪圖元件,也就是說,若要在執行於這些行動裝置之作業系統的文字處理程式中開發繪圖功能,便需要由開發者自行實做繪圖元件。At present, in some operating systems of mobile devices, drawing elements such as "InkPresenter" can be used. Therefore, it is very easy to develop a drawing function in a word processing program of an operating system of these mobile devices, but In the operating system of some mobile devices, no drawing components are provided, that is, if the drawing function is to be developed in the word processing program of the operating system of the mobile device, the developer needs to implement the drawing component by himself. .
由於某些行動裝置之作業系統中沒有提供繪圖元件,因此,開發者必須要修改這些作業系統所提供之元件的觸控事件處理功能,藉以實作出繪圖元件,如此,被修改後的元件雖然具有繪圖功能,但卻失去原有之觸控操作的功能,除了不容易讓開發者繼承使用之外,還可能會造成使用者在操作上的困擾。Since the drawing elements are not provided in the operating system of some mobile devices, the developer must modify the touch event processing function of the components provided by these operating systems, thereby realizing the drawing components, and thus, the modified components have The drawing function, but it loses the original touch operation function, in addition to not easily letting the developer inherit the use, it may also cause the user to operate.
綜上所述,可知先前技術中長期以來一直存在自行實做出之繪圖元件往往不包含原有之觸控操作功能的問題,因此有必要提出改進的技術手段,來解決此一問題。In summary, it can be seen that the drawing elements that have been self-made in the prior art often do not contain the original touch operation function, so it is necessary to propose an improved technical means to solve this problem.
有鑒於先前技術存在自行實做出之繪圖元件不包含原有之觸控操作功能的問題,本發明遂揭露一種在觸控螢幕中提供繪圖操作之系統及其方法,其中:In view of the problem that the prior art drawing elements do not include the original touch operation function, the present invention discloses a system and method for providing a drawing operation in a touch screen, wherein:
本發明所揭露之在觸控螢幕中提供繪圖操作之系統,應用於文字處理程式中,文字處理程式執行於行動裝置之作業系統上,該系統至少包含:觸控事件分派模組,用以依序接收在文字處理程式之編輯界面上被輸入之多個觸控事件;觸控事件攔截模組,用以於觸控事件分派模組所接收到之觸控事件為離開行為(ACTION_UP)事件時,攔截(intercept)離開行為事件,及用以於間隔時間符合間隔預定值前,觸控事件分派模組所接收到之觸控事件為接觸行為(ACTION_DOWN)事件時,攔截接觸行為事件,並攔截後續所接收到之觸控事件,直到間隔時間符合間隔預定值為止;觸控事件處理模組,用以於觸控事件分派模組所接收到之觸控事件為離開行為事件時,更新觸控(touch)區域,並計算間隔時間,及用以於間隔時間符合間隔預定值時,依據所攔截之觸控事件產生觸控軌跡,並依據觸控軌跡執行繪圖操作。The system for providing a drawing operation in a touch screen is applied to a word processing program, and the word processing program is executed on a mobile device operating system, and the system includes at least: a touch event dispatching module for Receiving a plurality of touch events input on the editing interface of the word processing program; the touch event intercepting module is configured to: when the touch event received by the touch event dispatching module is a departure behavior (ACTION_UP) event The interception behavior event is intercepted and used to intercept the contact behavior event and intercept the touch event received by the touch event dispatching module before the interval is equal to the predetermined interval value. The touch event is received until the interval time meets the predetermined interval value; the touch event processing module is configured to update the touch event when the touch event received by the touch event dispatching module is a leaving event event (touch) the area, and calculate the interval time, and when the interval time meets the predetermined interval value, the touch track is generated according to the intercepted touch event, and According to touch track drawing operations.
本發明所揭露之在觸控螢幕中提供繪圖操作之方法,應用於文字處理程式中,文字處理程式執行於行動裝置之作業系統上,其步驟至少包括:接收在文字處理程式之編輯界面上被輸入的觸控事件;判斷接收到之觸控事件為離開行為事件時,更新觸控區域,並計算間隔時間,及攔截離開行為事件;在間隔時間未符合間隔預定值前,判斷接收到之觸控事件為接觸行為事件時,攔截接觸行為事件,並攔截後續所接收到之觸控事件,直到間隔時間 符合間隔預定值為止;依據所攔截之觸控事件產生觸控軌跡;依據觸控軌跡執行繪圖操作。The method for providing a drawing operation in a touch screen disclosed in the present invention is applied to a word processing program, and the word processing program is executed on the operating system of the mobile device, and the steps include at least: receiving the editing interface on the word processing program Input touch event; determine that the received touch event is a departure behavior event, update the touch area, calculate the interval time, and intercept the leaving behavior event; determine the received touch before the interval time does not meet the predetermined interval value When the control event is a contact behavior event, the contact behavior event is intercepted, and the subsequent touch event is intercepted until the interval time The touch interval is generated according to the intercepted touch event; the drawing operation is performed according to the touch track.
本發明所揭露之系統與方法如上,與先前技術之間的差異在於本發明透過在接收到之觸控事件為離開行為事件前,執行原有之觸控功能,當接收到之觸控事件為離開行為事件時,計算間隔時間,而後,在間隔時間未符合間隔預定值前,接收到之觸控事件為接觸行為事件時,攔截所接收到之觸控事件,直到間隔時間符合間隔預定值為止,在間隔時間符合間隔預定值時,依據所攔截之觸控事件產生觸控軌跡,並依據觸控軌跡執行繪圖操作,藉以解決先前技術所存在的問題,並可以達成提高實做出之元件被繼承使用之實用性的技術功效。The system and method disclosed in the present invention are as above, and the difference between the prior art and the prior art is that the present invention performs the original touch function before receiving the touch event as the exit behavior event, when the received touch event is When the behavior event is left, the interval time is calculated, and then, before the interval time does not meet the predetermined interval value, when the received touch event is a contact behavior event, the received touch event is intercepted until the interval time meets the predetermined interval value. When the interval time meets the predetermined interval value, the touch track is generated according to the intercepted touch event, and the drawing operation is performed according to the touch track, thereby solving the problems existing in the prior art, and the components that can be improved can be achieved. Inherit the practical technical effects of using.
以下將配合圖式及實施例來詳細說明本發明之特徵與實施方式,內容足以使任何熟習相關技藝者能夠輕易地充分理解本發明解決技術問題所應用的技術手段並據以實施,藉此實現本發明可達成的功效。The features and embodiments of the present invention will be described in detail below with reference to the drawings and embodiments, which are sufficient to enable those skilled in the art to fully understand the technical means to which the present invention solves the technical problems, and The achievable effects of the present invention.
本發明應用於執行在手機作業系統上的文字處理程式,可以讓文字處理程式在文字的編輯介面中保留原有觸控操作的情況下,根據觸控事件(touch event)產生觸控軌跡,並依據觸控軌跡執行繪圖操作,藉以增加繪圖功能。The present invention is applied to a word processing program executed on a mobile phone operating system, which allows a word processing program to generate a touch track according to a touch event while retaining the original touch operation in the text editing interface. Perform drawing operations based on the touch track to increase the drawing function.
本發明所提之觸控事件,為使用者在文字處理程式之文字的編輯介面上進行觸控操作時,接觸手機之觸控螢幕後所產生的一連串事件,依序為接觸觸控螢幕之瞬間所產生的接觸行為(ACTION_DOWN)事件、在觸控螢幕上滑動時產生的移動行為 (ACTION_MOVE)事件、以及離開觸控螢幕之瞬間所產生的離開行為(ACTION_UP)事件。The touch event proposed by the present invention is a series of events generated after the user touches the touch screen of the mobile phone during the touch operation on the editing interface of the text processing program, and sequentially touches the touch screen. The resulting contact behavior (ACTION_DOWN) event, the movement behavior that occurs when sliding on the touch screen (ACTION_MOVE) event, and the departure behavior (ACTION_UP) event that occurs when the touch screen is removed.
特別值得一提的是,繪圖操作時,在短時間內所產生的觸控事件至少包含一個接觸行為事件與一個移動行為事件,而非繪圖操作時,則通常只有一個接觸行為事件與一個移動行為事件,另外,在繪圖操作時,通常會在觸控區域中大幅度的移動,所以,移動行為事件所產生之觸控軌跡的範圍通常會較非繪圖操作所產生之觸控軌跡的範圍來的大,因此,在本發明中,會透過對時間以及觸控軌跡的範圍進行判斷,藉以決定使用者的觸控操作為原本的觸控操作,或是繪圖操作。It is particularly worth mentioning that during the drawing operation, the touch event generated in a short time includes at least one contact behavior event and one mobile behavior event. When the drawing operation is not performed, there is usually only one contact behavior event and one movement behavior. Events, in addition, during the drawing operation, usually move greatly in the touch area, so the range of the touch track generated by the mobile behavior event is usually smaller than the range of the touch track generated by the non-drawing operation. Therefore, in the present invention, the time and the range of the touch track are determined to determine whether the touch operation of the user is the original touch operation or the drawing operation.
以下先以「第1圖」本發明所提之在觸控螢幕中提供繪圖操作之系統架構圖來說明本發明的系統運作。如「第1圖」所示,本發明之系統含有子類別(Class)100以及上層元件200。The system operation of the present invention will be described below with reference to the system architecture diagram of the present invention for providing a drawing operation in a touch screen. As shown in "FIG. 1", the system of the present invention includes a sub-class 100 and an upper element 200.
子類別100繼承自父類別,在文字處理程式執行後,可以接收並處理觸控事件,並在某些情況下將所接收的觸控事件提供給父類別處理。其中,父類別即為被修改之原有元件。The subcategory 100 inherits from the parent category and, after execution of the word processing program, can receive and process touch events and, in some cases, provide the received touch events to the parent category for processing. Among them, the parent category is the original component that was modified.
子類別100更包含觸控事件分派(dispatchTouchEvent)模組110、觸控事件攔截(onInterceptTouchEvent)模組120、以及觸控事件處理(onTouchEvent)模組130。其中,觸控事件分派模組110以及觸控事件攔截模組120與父類別相同,而觸控事件處理模組130則經過覆寫(override)。The subcategory 100 further includes a touch event dispatch module 110, a touch event interception module (onInterceptTouchEvent) module 120, and a touch event processing (onTouchEvent) module 130. The touch event dispatching module 110 and the touch event intercepting module 120 are the same as the parent category, and the touch event processing module 130 is overridden.
觸控事件分派模組110負責接收嵌入子類別100之上層元件200所傳送的觸控事件。其中,嵌入子類別100之上層元件200可能是「View」物件,也可能是文字處理程式的使用者介面程式 (User Interface Program),例如「Activity」物件,但本發明並沒有特別的限制。The touch event dispatch module 110 is responsible for receiving touch events transmitted by the layer element 200 embedded in the sub-category 100. The embedded component sub-class 100 upper layer component 200 may be a "View" object, or may be a user interface program of a word processing program. (User Interface Program), for example, "Activity" object, but the present invention is not particularly limited.
觸控事件分派模組110也負責判斷提供所接收到之觸控事件的對象,也就是判斷要將所接收到的觸控事件提供給觸控事件攔截模組120、觸控事件處理模組130、或是上層元件200。The touch event dispatching module 110 is also responsible for determining the object that provides the received touch event, that is, determining that the received touch event is to be provided to the touch event intercepting module 120 and the touch event processing module 130. Or the upper element 200.
其中,觸控事件分派模組110會在所接收到的觸控事件為離開行為事件前,也就是接收到的觸控事件為接觸行為事件或移動行為事件時,將所接收到的觸控事件提供給觸控事件處理模組130,而在所接收到的觸控事件為離開行為事件時,將所接收到的離開行為事件提供給觸控事件攔截模組120,觸控事件分派模組110也會在接收到離開行為事件後,再次接收到接觸行為事件時,判斷觸控事件處理模組130所計算之間隔時間是否符合間隔預定值,若間隔時間不符合間隔預定值,也就是是間隔時間符合間隔預定值前,將所接收到的接觸行為事件提供給觸控事件攔截模組120,直到間隔時間符合間隔預定值為止,當間隔時間符合間隔預定值時,觸控事件分派模組110會將所接收到的觸控事件提供給觸控事件處理模組130。The touch event dispatching module 110 will receive the touch event before the received touch event is an exit behavior event, that is, when the received touch event is a contact behavior event or a mobile behavior event. Provided to the touch event processing module 130, and when the received touch event is a leaving behavior event, the received leaving behavior event is provided to the touch event intercepting module 120, and the touch event dispatching module 110 When the contact behavior event is received again, the interval event calculated by the touch event processing module 130 is determined to meet the predetermined interval value. If the interval time does not meet the predetermined interval value, that is, the interval is Before the time meets the predetermined interval value, the received contact behavior event is provided to the touch event intercepting module 120 until the interval time meets the predetermined interval value. When the interval time meets the predetermined interval value, the touch event dispatching module 110 The received touch event is provided to the touch event processing module 130.
觸控事件攔截模組120負責攔截觸控事件分派模組110所提供的觸控事件,使得觸控事件不再向上層元件200或嵌入子類別100中的下層元件(圖中未示)傳遞。The touch event intercepting module 120 is responsible for intercepting the touch event provided by the touch event dispatching module 110, so that the touch event is no longer transmitted to the lower layer component 200 or the lower layer component (not shown) embedded in the subcategory 100.
觸控事件處理模組130負責處理觸控事件分派模組110所提供的觸控事件。The touch event processing module 130 is responsible for processing the touch events provided by the touch event dispatching module 110.
在觸控事件分派模組110所提供的觸控事件為離開行為事件前,觸控事件處理模組130會在接收到觸控事件時,更新觸控 (touch)區域以即時反映觸控操作,藉以計算觸控軌跡在觸控區域上的涵蓋範圍,並呼叫父類別的觸控事件處理方法(method),使得父類別的觸控事件處理方法依據觸控事件處理模組130所接收到的觸控事件執行原有之觸控操作的功能。Before the touch event provided by the touch event dispatching module 110 is the exit behavior event, the touch event processing module 130 updates the touch when receiving the touch event. The (touch) area reflects the touch operation in real time, thereby calculating the coverage of the touch track on the touch area, and calling the touch event processing method of the parent category, so that the touch event processing method of the parent category is based on the touch The touch event received by the event processing module 130 performs the function of the original touch operation.
當觸控事件分派模組110所提供的觸控事件為離開行為事件時,觸控事件處理模組130會更新觸控區域,並開始計算間隔時間,直到所計算之間隔時間符合間隔預定值時,依據觸控事件攔截模組120所攔截的移動行為(ACTION_MOVE)事件等觸控事件產生觸控軌跡,並依據所產生的觸控軌跡執行繪圖操作,藉以提供繪圖功能。When the touch event provided by the touch event dispatching module 110 is an exit behavior event, the touch event processing module 130 updates the touch area and starts calculating the interval time until the calculated interval time meets the predetermined interval value. The touch track is generated according to a touch event such as a motion behavior (ACTION_MOVE) event intercepted by the touch event interception module 120, and a drawing operation is performed according to the generated touch track, thereby providing a drawing function.
其中,觸控事件分派模組110接收到離開行為事件(觸控事件分派模組110提供給觸控事件處理模組130的觸控事件為離開行為事件)後,至觸控事件處理模組130所計算之間隔時間符合間隔預定值時,若觸控事件分派模組110再也沒有接收到觸控事件,則觸控事件處理模組130可以判斷所產生之觸控軌跡在觸控區域上的涵蓋範圍是否達到範圍預定值,若是,表示為繪圖操作,則觸控事件處理模組130可以執行繪圖操作,若否,表示為定位操作,則觸控事件處理模組130可以呼叫父類別的觸控事件處理方法,並將觸控事件攔截模組120所攔截的觸控事件提供給父類別的觸控事件處理方法,使得父類別的觸控事件處理方法依據觸控事件攔截模組120所攔截的觸控事件執行原有之觸控操作的功能。After the touch event dispatching module 110 receives the leaving behavior event (the touch event sent by the touch event dispatching module 110 to the touch event processing module 130 is a leaving behavior event), the touch event processing module 130 is received. If the calculated interval time meets the predetermined interval value, if the touch event dispatching module 110 no longer receives the touch event, the touch event processing module 130 can determine that the generated touch track is on the touch area. The touch event processing module 130 can perform a drawing operation, and if not, the touch event processing module 130 can call the touch of the parent category. The event processing method is provided, and the touch event intercepted by the touch event intercepting module 120 is provided to the touch event processing method of the parent category, so that the touch event processing method of the parent category is intercepted according to the touch event intercepting module 120. The touch event performs the function of the original touch operation.
另外,當觸控事件分派模組110在接收到離開行為事件後,再次接收到接觸行為事件時,觸控事件處理模組130會開始計算 按壓時間,當觸控事件分派模組110再次接收到離開行為事件時,觸控事件處理模組130會判斷所計算之按壓時間不符合按壓預定值時,取消計算按壓時間,而當觸控事件處理模組130判斷所計算之按壓時間符合按壓預定值時,表示為長按操作,觸控事件處理模組130會執行與長按操作對應的功能。In addition, when the touch event dispatching module 110 receives the contact behavior event again after receiving the leaving behavior event, the touch event processing module 130 starts to calculate. When the touch event dispatching module 110 receives the leaving behavior event again, the touch event processing module 130 determines that the calculated pressing time does not meet the predetermined pressing value, and cancels the calculating pressing time, and when the touch event occurs When the processing module 130 determines that the calculated pressing time meets the predetermined pressing value, it indicates that the pressing event processing module 130 performs a function corresponding to the long pressing operation.
由上述可知,觸控事件處理模組130會根據觸控操作的操作時間以及觸控軌跡在觸控區域上的涵蓋範圍判斷是否為繪圖操作,若為繪圖操作,則觸控事件處理模組可以執行對應的繪圖操作,若觸控操作並非繪圖操作,則觸控事件處理模組130可以將觸控事件傳給父類別的觸控事件處理模組,使得父類別的觸控事件處理模組執行文字編輯介面中原有的定位操作和長按操作,如此,便可以在不影響文字編輯介面原有功能上實現繪圖操作。As can be seen from the above, the touch event processing module 130 can determine whether the drawing operation is based on the operation time of the touch operation and the coverage of the touch track on the touch area. If the drawing operation is performed, the touch event processing module can If the touch operation is not a drawing operation, the touch event processing module 130 can transmit the touch event to the touch event processing module of the parent category, so that the touch event processing module of the parent category performs The original positioning operation and long press operation in the text editing interface, so that the drawing operation can be realized without affecting the original function of the text editing interface.
接著以一個實施例來解說本發明的運作系統與方法,並請參照「第2A圖」本發明所提之在觸控螢幕中提供繪圖操作之方法流程圖。在本實施例中,假設使用者在手機之觸控螢幕所顯示的文字編輯介面中,所進行之觸控操作為繪圖操作。Next, an operational system and method of the present invention will be described with reference to an embodiment. Referring to FIG. 2A, a flowchart of a method for providing a drawing operation in a touch screen according to the present invention is provided. In this embodiment, it is assumed that the touch operation performed by the user in the text editing interface displayed on the touch screen of the mobile phone is a drawing operation.
在手機作業系統中執行的文字處理程式執行包含本發明的子類別100後,文字處理程式中會產生觸控事件分派模組110、觸控事件攔截模組120、以及觸控事件處理模組130。After the word processing program executed in the mobile phone operating system executes the sub-category 100 of the present invention, the touch event dispatching module 110, the touch event intercepting module 120, and the touch event processing module 130 are generated in the word processing program. .
在觸控事件分派模組110產生後,可以持續地接收觸控事件。由於使用者每一次接觸手機的觸控螢幕時,會依序產生接觸行為事件、移動行為事件(如果使用者有滑動)、以及離開行為事件,因此,觸控事件分派模組110會依據接收到接觸行為事件、移動行為事件(如果使用者有滑動)、以及離開行為事件。After the touch event dispatch module 110 is generated, the touch event can be continuously received. Each time the user touches the touch screen of the mobile phone, the contact behavior event, the mobile behavior event (if the user has a slide), and the leaving behavior event are sequentially generated, so the touch event dispatching module 110 receives the Contact behavior events, mobile behavior events (if the user has a slide), and departure behavior events.
當觸控事件分派模組110接收到觸控事件後,可以先判斷所接收到的觸控事件是否為離開行為事件(步驟310)。若觸控事件分派模組110所接收到觸控事件為接觸行為事件以及移動行為事件,則觸控事件分派模組110可以將所接收到的觸控事件提供給觸控事件處理模組130,觸控事件處理模組130可以如「第2B圖」所示之流程,更新觸控區域(步驟341),並呼叫父類別的觸控事件處理方法,藉以將所接收到的觸控事件提供給父類別的觸控事件處理方法處理(步驟345),如此,父類別的觸控事件處理方法可以依據觸控事件處理模組130所接收到的觸控事件執行原有之觸控操作的功能。After the touch event dispatching module 110 receives the touch event, it may first determine whether the received touch event is a leaving behavior event (step 310). If the touch event dispatching module 110 receives the touch event and the mobile event event, the touch event dispatching module 110 can provide the received touch event to the touch event processing module 130. The touch event processing module 130 can update the touch area according to the process shown in FIG. 2B (step 341), and call the touch event processing method of the parent category to provide the received touch event to the touch event. The touch event processing method of the parent category is processed (step 345). Thus, the touch event processing method of the parent category can perform the function of the original touch operation according to the touch event received by the touch event processing module 130.
繼續回到「第2A圖」,在觸控事件分派模組110接收到之觸控事件為離開行為事件後,觸控事件分派模組110可以將所接收到的觸控事件提供給觸控事件攔截模組120,觸控事件攔截模組120可以攔截離開行為事件(步驟336),並將所攔截的離開行為事件提供給觸控事件處理模組130,觸控事件處理模組130可以更新觸控區域(步驟320),並開始計算間隔時間(步驟332)。Continuing back to FIG. 2A, after the touch event received by the touch event dispatching module 110 is a leaving event, the touch event dispatching module 110 can provide the received touch event to the touch event. The intercepting module 120, the touch event intercepting module 120 can intercept the leaving behavior event (step 336), and provide the intercepted leaving behavior event to the touch event processing module 130, and the touch event processing module 130 can update the touch The area is controlled (step 320) and the interval is calculated (step 332).
之後,若觸控事件分派模組110可以持續的判斷觸控事件處理模組130所計算之間隔時間是否符合間隔預定值(步驟352),並持續的判斷是否再次接收到接觸行為事件(步驟356)。After that, the touch event dispatching module 110 can continuously determine whether the interval time calculated by the touch event processing module 130 meets the interval predetermined value (step 352), and continuously determines whether the contact behavior event is received again (step 356). ).
若觸控事件分派模組110再次接收到接觸行為事件時,觸控事件處理模組130所計算之間隔時間還不符合間隔預定值,也就是說,在觸控事件處理模組130所計算之間隔時間符合間隔預定值前,觸控事件分派模組110再次接收到接觸行為事件時,表示使用者進行繪圖操作,因此,觸控事件分派模組110可以將所接 收到的接觸行為事件提供給觸控事件攔截模組120,觸控事件攔截模組120可以攔截所接收到的接觸行為事件(步驟361)。If the touch event dispatching module 110 receives the contact behavior event again, the interval calculated by the touch event processing module 130 does not meet the predetermined interval value, that is, calculated by the touch event processing module 130. Before the interval time meets the predetermined interval value, the touch event dispatching module 110 receives the contact behavior event again, indicating that the user performs the drawing operation. Therefore, the touch event dispatching module 110 can connect the touch event. The received contact behavior event is provided to the touch event interception module 120, and the touch event interception module 120 can intercept the received contact behavior event (step 361).
事實上,觸控事件分派模組110將所接收到的接觸行為事件提供給觸控事件攔截模組120後,可以持續的判斷觸控事件處理模組130所計算之間隔時間是否符合間隔預定值(步驟365),若否,則觸控事件分派模組110可以持續的將所接收到的接觸行為事件提供給觸控事件攔截模組120,使得觸控事件攔截模組120可以持續的攔截所接收到的觸控事件(步驟361),直到觸控事件分派模組110判斷觸控事件處理模組130所計算之間隔時間符合間隔預定值為止。In fact, after the touch event dispatching module 110 provides the received contact behavior event to the touch event intercepting module 120, it can continuously determine whether the interval time calculated by the touch event processing module 130 meets the predetermined interval value. (Step 365), if not, the touch event dispatching module 110 can continuously provide the received contact behavior event to the touch event intercepting module 120, so that the touch event intercepting module 120 can continuously intercept the The touch event is received (step 361) until the touch event dispatching module 110 determines that the interval time calculated by the touch event processing module 130 meets the predetermined interval value.
觸控事件處理模組130可以在所計算之間隔時間符合間隔預定值時,依據觸控事件攔截模組120在間隔時間符合間隔預定值前所攔截的觸控事件,如移動行為事件,產生觸控軌跡(步驟372),並依據所產生的觸控軌跡執行繪圖操作(步驟376)。The touch event processing module 130 may generate a touch according to a touch event intercepted by the touch event interception module 120 before the interval time meets the predetermined interval value, such as a mobile behavior event, when the calculated interval time meets the predetermined interval value. The trajectory is controlled (step 372) and a drawing operation is performed in accordance with the generated touch trajectory (step 376).
而若在觸控事件分派模組110持續的判斷觸控事件處理模組130所計算之間隔時間是否符合間隔預定值(步驟352)時,在觸控事件處理模組130所計算之間隔時間符合間隔預定值前,觸控事件分派模組110都沒有接收到觸控事件,則觸控事件處理模組130可以如「第2C圖」之流程所示,在所計算之間隔時間符合間隔預定值時,依據觸控事件攔截模組120所攔截的觸控事件,如移動行為事件,產生觸控軌跡(步驟381),並判斷所產生之觸控軌跡在觸控區域的涵蓋範圍是否達到範圍預定值(步驟385),若否,則觸控事件處理模組130可以呼叫父類別的觸控事件處理方法,藉以將觸控事件攔截模組120所攔截的觸控事件提供給父類 別的觸控事件處理方法處理(步驟387),如此,父類別的觸控事件處理方法可以依據觸控事件處理模組130所接收到的觸控事件執行原有之觸控操作的功能。If the interval time calculated by the touch event processing module 130 continues to determine whether the interval calculated by the touch event processing module 130 meets the predetermined interval value (step 352), the interval calculated by the touch event processing module 130 is met. Before the touch event dispatching module 110 receives the touch event, the touch event processing module 130 can meet the predetermined interval value at the calculated interval time as shown in the flow of the "2C chart". The touch track is generated according to the touch event intercepted by the touch event intercepting module 120, such as a mobile behavior event (step 381), and it is determined whether the coverage of the generated touch track in the touch area reaches a predetermined range. The value (step 385), if not, the touch event processing module 130 can call the touch event processing method of the parent category to provide the touch event intercepted by the touch event intercepting module 120 to the parent class. The other touch event processing method is processed (step 387). Thus, the touch event processing method of the parent category can perform the function of the original touch operation according to the touch event received by the touch event processing module 130.
而若觸控事件處理模組130判斷所產生之觸控軌跡在手機之觸控螢幕的涵蓋範圍達到範圍預定值,則觸控事件處理模組130可以依據所產生的觸控軌跡執行繪圖操作(步驟376)。If the touch event processing module 130 determines that the touch track generated by the touch screen reaches a predetermined range of the touch screen of the mobile phone, the touch event processing module 130 can perform the drawing operation according to the generated touch track ( Step 376).
在上述的實施例中,當觸控事件分派模組110判斷所接收到之觸控事件為接觸行為事件(步驟356)時,觸控事件處理模組130可以開始計算按壓時間,直到觸控事件分派模組110判斷所接收到之觸控事件為離開行為事件時,觸控事件處理模組130可以判斷所計算的按壓時間,藉以判斷使用者所進行的觸控操作是否為長按操作,當按壓時間未符合按壓預定值時,表示使用者並非進行長按操作,觸控事件處理模組130可以取消計算按壓時間,而若按壓時間符合按壓預定值,則表示使用者進行長按操作,觸控事件處理模組130可以執行與長按操作對應的處理程序。In the above embodiment, when the touch event dispatching module 110 determines that the received touch event is a contact behavior event (step 356), the touch event processing module 130 may start calculating the pressing time until the touch event. When the dispatching module 110 determines that the received touch event is a leaving behavior event, the touch event processing module 130 can determine the calculated pressing time to determine whether the touch operation performed by the user is a long press operation. When the pressing time does not meet the predetermined pressing value, it means that the user does not perform the long pressing operation, and the touch event processing module 130 can cancel the calculation of the pressing time, and if the pressing time meets the predetermined pressing value, the user performs a long pressing operation and touches The control event processing module 130 can execute a processing program corresponding to the long press operation.
另外,觸控事件處理模組130也可以在按壓時間符合按壓預定值時,進一步判斷觸控軌跡的範圍是否符合範圍預定值,若觸控軌跡的範圍符合範圍預定值則表示使用者進行繪圖操作,而若觸控軌跡的範圍不符合範圍預定值,則表示使用者進行長按操作。In addition, the touch event processing module 130 may further determine whether the range of the touch track conforms to a predetermined range when the pressing time meets the predetermined pressing value, and if the range of the touch track meets the predetermined value, the user performs a drawing operation. If the range of the touch track does not meet the predetermined range, the user performs a long press operation.
綜上所述,可知本發明與先前技術之間的差異在於具有在接收到之觸控事件為離開行為事件前,執行原有之觸控功能,當接收到之觸控事件為離開行為事件時,計算間隔時間,而後,在間隔時間未符合間隔預定值前,接收到之觸控事件為接觸行為事件時,攔截所接收到之觸控事件,直到間隔時間符合間隔預定值為 止,在間隔時間符合間隔預定值時,依據所攔截之觸控事件產生觸控軌跡,並依據觸控軌跡執行繪圖操作之技術手段,藉由此一技術手段可以解決先前技術所存在自行實做出之繪圖元件不包含原有之觸控操作功能的問題,進而達成提高實做出之元件被繼承使用之實用性的技術功效。In summary, it can be seen that the difference between the present invention and the prior art is that the touch function is executed before the received touch event is an exit behavior event, and when the received touch event is a departure behavior event, And calculating the interval time, and then, before the interval time does not meet the predetermined interval value, when the received touch event is a contact behavior event, intercepting the received touch event until the interval time meets the interval predetermined value When the interval time meets the predetermined interval value, the touch trajectory is generated according to the intercepted touch event, and the technical operation of the drawing operation is performed according to the touch trajectory, thereby solving the prior art self-realization by using a technical means The drawing component does not include the problem of the original touch operation function, and thus achieves the technical effect of improving the practicality of the actual component being inherited.
再者,本發明之在觸控螢幕中提供繪圖操作之方法,可在電腦系統中以集中方式實現或以不同元件散佈於若干互連之電腦系統的分散方式實現。Furthermore, the method of the present invention for providing a drawing operation in a touch screen can be implemented in a centralized manner in a computer system or in a distributed manner in which different components are interspersed among a number of interconnected computer systems.
雖然本發明所揭露之實施方式如上,惟所述之內容並非用以直接限定本發明之專利保護範圍。任何本發明所屬技術領域中具有通常知識者,在不脫離本發明所揭露之精神和範圍的前提下,對本發明之實施的形式上及細節上作些許之更動潤飾,均屬於本發明之專利保護範圍。本發明之專利保護範圍,仍須以所附之申請專利範圍所界定者為準。While the embodiments of the present invention have been described above, the above description is not intended to limit the scope of the invention. Any modification of the form and details of the practice of the present invention, which is a matter of ordinary skill in the art to which the present invention pertains, is a patent protection of the present invention. range. The scope of the invention is to be determined by the scope of the appended claims.
100‧‧‧子類別100‧‧‧Subcategory
110‧‧‧觸控事件分派模組110‧‧‧Touch event dispatch module
120‧‧‧觸控事件攔截模組120‧‧‧Touch event interception module
130‧‧‧觸控事件處理模組130‧‧‧Touch event processing module
200‧‧‧上層元件200‧‧‧Upper components
步驟310‧‧‧判斷接收到之觸控事件是否為離開行為事件Step 310‧‧‧ Determine whether the received touch event is a departure behavior event
步驟320‧‧‧更新觸控區域Step 320‧‧‧Update touch area
步驟332‧‧‧計算間隔時間Step 332‧‧‧ Calculation interval
步驟336‧‧‧攔截離開行為事件Step 336‧‧‧ Intercepting the departure behavior event
步驟341‧‧‧更新觸控區域Step 341‧‧‧Update touch area
步驟345‧‧‧提供所接收到之觸控事件給上層之父類別的觸控事件處理方法Step 345‧‧‧ A touch event processing method for providing the received touch event to the parent class of the upper layer
步驟352‧‧‧判斷間隔時間是否符合間隔預定值Step 352‧‧‧Determination of whether the interval time meets the predetermined interval value
步驟356‧‧‧判斷是否接收到接觸行為事件Step 356‧‧‧Determine whether a contact behavior event has been received
步驟361‧‧‧攔截所接收到之觸控事件Step 361‧‧‧ intercept the received touch event
步驟365‧‧‧判斷間隔時間是否符合間隔預定值Step 365‧‧‧ Determine whether the interval time meets the predetermined interval value
步驟372‧‧‧依據所攔截之觸控事件產生觸控軌跡Step 372‧‧‧ Generate touch track based on the intercepted touch event
步驟376‧‧‧依據觸控軌跡執行繪圖操作Step 376‧‧‧Drawing operation according to the touch track
步驟381‧‧‧依據所攔截之觸控事件產生觸控軌跡Step 381‧‧‧ Generate touch trajectory based on the intercepted touch event
步驟385‧‧‧判斷觸控軌跡之涵蓋範圍是否達到範圍預定值Step 385‧‧‧ Determine whether the coverage of the touch track reaches a predetermined range
步驟387‧‧‧提供被攔截之觸控事件給上層之父類別的觸控事件處理方法Step 387‧‧‧ A touch event processing method that provides intercepted touch events to the parent class of the upper layer
第1圖為本發明所提之在觸控螢幕中提供繪圖操作之系統架構圖。FIG. 1 is a system architecture diagram of a drawing operation provided in a touch screen according to the present invention.
第2A圖為本發明所提之在觸控螢幕中提供繪圖操作之方法流程圖。FIG. 2A is a flow chart of a method for providing a drawing operation in a touch screen according to the present invention.
第2B及2C圖為本發明所提之執行原有觸控操作之附加方法流程圖。2B and 2C are flow charts of an additional method for performing an original touch operation according to the present invention.
步驟310‧‧‧判斷接收到之觸控事件是否為離開行為事件Step 310‧‧‧ Determine whether the received touch event is a departure behavior event
步驟320‧‧‧更新觸控區域Step 320‧‧‧Update touch area
步驟332‧‧‧計算間隔時間Step 332‧‧‧ Calculation interval
步驟336‧‧‧攔截離開行為事件Step 336‧‧‧ Intercepting the departure behavior event
步驟352‧‧‧判斷間隔時間是否符合間隔預定值Step 352‧‧‧Determination of whether the interval time meets the predetermined interval value
步驟356‧‧‧判斷是否接收到接觸行為事件Step 356‧‧‧Determine whether a contact behavior event has been received
步驟361‧‧‧攔截所接收到之觸控事件Step 361‧‧‧ intercept the received touch event
步驟365‧‧‧判斷間隔時間是否符合間隔預定值Step 365‧‧‧ Determine whether the interval time meets the predetermined interval value
步驟372‧‧‧依據所攔截之觸控事件產生觸控軌跡Step 372‧‧‧ Generate touch track based on the intercepted touch event
步驟376‧‧‧依據觸控軌跡執行繪圖操作Step 376‧‧‧Drawing operation according to the touch track
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW101148242A TWI475472B (en) | 2012-12-19 | 2012-12-19 | System for drawing on touch screen and method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW101148242A TWI475472B (en) | 2012-12-19 | 2012-12-19 | System for drawing on touch screen and method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201426490A TW201426490A (en) | 2014-07-01 |
TWI475472B true TWI475472B (en) | 2015-03-01 |
Family
ID=51725554
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW101148242A TWI475472B (en) | 2012-12-19 | 2012-12-19 | System for drawing on touch screen and method thereof |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI475472B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110597509B (en) * | 2018-10-10 | 2023-10-03 | 苏州沁游网络科技有限公司 | Cross-platform GUI touch event analysis method in Unity environment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080036743A1 (en) * | 1998-01-26 | 2008-02-14 | Apple Computer, Inc. | Gesturing with a multipoint sensing device |
TW201017264A (en) * | 2008-10-16 | 2010-05-01 | Tpo Displays Corp | Electronic apparatus with a capacitive touch sensor |
CN201583916U (en) * | 2009-03-02 | 2010-09-15 | 升达科技股份有限公司 | Touch module |
CN102246132A (en) * | 2008-12-11 | 2011-11-16 | 诺基亚公司 | Method and apparatus for providing a predictive model for drawing using touch screen devices |
-
2012
- 2012-12-19 TW TW101148242A patent/TWI475472B/en not_active IP Right Cessation
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080036743A1 (en) * | 1998-01-26 | 2008-02-14 | Apple Computer, Inc. | Gesturing with a multipoint sensing device |
TW201017264A (en) * | 2008-10-16 | 2010-05-01 | Tpo Displays Corp | Electronic apparatus with a capacitive touch sensor |
CN102246132A (en) * | 2008-12-11 | 2011-11-16 | 诺基亚公司 | Method and apparatus for providing a predictive model for drawing using touch screen devices |
CN201583916U (en) * | 2009-03-02 | 2010-09-15 | 升达科技股份有限公司 | Touch module |
Also Published As
Publication number | Publication date |
---|---|
TW201426490A (en) | 2014-07-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6695395B2 (en) | Event recognition | |
CN104679436B (en) | Suspension key and device based on touch screen | |
NL2007993C2 (en) | Event recognition. | |
KR101892315B1 (en) | Touch event anticipation in a computing device | |
CN102981763B (en) | The method running application program under touch screen lock-out state | |
CN108463792A (en) | A kind of false-touch prevention method and terminal | |
CN109857303B (en) | Interaction control method and device | |
US20160041674A1 (en) | Apparatus and method for controlling a touchscreen display for one hand operation | |
CN107066188B (en) | A kind of method and terminal sending screenshot picture | |
JP6105818B2 (en) | Apparatus, method, and mobile terminal for adaptively adjusting layout of touch input panel | |
CN105487809A (en) | Terminal control method and device | |
JP2016540299A (en) | Application program control method and related apparatus | |
CN103870156A (en) | Method and device for processing object | |
CN104850319A (en) | Method and device for dynamically adjusting icon on touch screen | |
KR20160020486A (en) | Independent hit testing for touchpad manipulations and double-tap zooming | |
WO2018046000A1 (en) | Touch operation method and device | |
CN106155452A (en) | The implementation method of a kind of one-handed performance and terminal | |
TWI475472B (en) | System for drawing on touch screen and method thereof | |
CN113885749A (en) | Icon display method and device and electronic equipment | |
CN104461258B (en) | For operating computer method and system | |
US20160162276A1 (en) | System and Methods for Touch Pattern Detection and User Interface Adaptation | |
CN110908573B (en) | Algorithm model training method, device, equipment and storage medium | |
CN111638827B (en) | Display control method, display control device and electronic equipment | |
CN107562363A (en) | touch operation method, device and terminal | |
CN105404439B (en) | Folder creating method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |