CN110362353A - Peripheral hardware control method, peripheral controller, storage medium and electronic equipment - Google Patents

Peripheral hardware control method, peripheral controller, storage medium and electronic equipment Download PDF

Info

Publication number
CN110362353A
CN110362353A CN201910598703.1A CN201910598703A CN110362353A CN 110362353 A CN110362353 A CN 110362353A CN 201910598703 A CN201910598703 A CN 201910598703A CN 110362353 A CN110362353 A CN 110362353A
Authority
CN
China
Prior art keywords
event
thread
key
incoming
touch
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201910598703.1A
Other languages
Chinese (zh)
Inventor
方攀
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910598703.1A priority Critical patent/CN110362353A/en
Publication of CN110362353A publication Critical patent/CN110362353A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

Present disclose provides a kind of peripheral hardware control method, device, storage medium and electronic equipments, belong to human-computer interaction technique field.The method is applied to touch control terminal, and the touch control terminal is connected with peripheral device;The described method includes: the incoming event in response to detecting the peripheral device, reads the primitive event data that thread obtains the incoming event by input;Based on preset mapping relations, the corresponding target touch event of the incoming event is determined in the touch event of the touch control terminal;The primitive event data of the incoming event are converted to the primitive event data of the target touch event;The primitive event data of target touch event described in thread process are handled, by a key to execute the corresponding operational order of the target touch event.The disclosure can simplify the control flow of peripheral device, reduce the load that thread is read in input, saves overhead, improves efficiency.

Description

Peripheral hardware control method, peripheral controller, storage medium and electronic equipment
Technical field
This disclosure relates to human-computer interaction technique field more particularly to a kind of peripheral hardware control method, peripheral controller, calculating Machine readable storage medium storing program for executing and electronic equipment.
Background technique
On the touch control terminals such as mobile phone, tablet computer, user is various to realize by carrying out touch control operation on touch screen Interaction.But touch control terminal is limited to screen size, the information content that can be shown is limited, and user is easy to block in operation Firmly a part of region of screen, influences usage experience.Solve the problems, such as that this scheme is using peripheral hardware, such as handle external shakes Bar etc., makes the user do not need Touch Screen, and hand is avoided to block.Therefore, peripheral hardware how is effectively controlled on touch control terminal, is improved The degree of convenience that peripheral hardware uses becomes prior art urgent problem to be solved.
It should be noted that information is only used for reinforcing the reason to the background of the disclosure disclosed in above-mentioned background technology part Solution, therefore may include the information not constituted to the prior art known to persons of ordinary skill in the art.
Summary of the invention
Present disclose provides a kind of peripheral hardware control method, peripheral controller, computer readable storage medium and electronics to set It is standby, and then improving the prior art at least to a certain extent can not be the problem of effectively controlling peripheral hardware on touch control terminal.
Other characteristics and advantages of the disclosure will be apparent from by the following detailed description, or partially by the disclosure Practice and acquistion.
According to the disclosure in a first aspect, a kind of peripheral hardware control method is provided, applied to touch control terminal, the touch control terminal It is connected with peripheral device;The described method includes: the incoming event in response to detecting the peripheral device, by inputting read line Journey obtains the primitive event data of the incoming event;Based on preset mapping relations, in the touch event of the touch control terminal The corresponding target touch event of the middle determination incoming event;The primitive event data of the incoming event are converted into the mesh Mark the primitive event data of touch event;The primitive event data of target touch event described in thread process are handled by a key, To execute the corresponding operational order of the target touch event.
Optionally, if the incoming event corresponds to multiple continuous target touch events, line is being handled by a key When the primitive event data of journey processing target touch event, successively to each mesh in the multiple continuous target touch event Mark touch event carries out the following processing: handling the entry-into-force time that the target touch event is arranged in thread by a key;It presses According to the entry-into-force time, first function is called to handle the primitive event data of the target touch event;Call second function will The target touch event is distributed to corresponding window.
Optionally, described that the entry-into-force time that the target touch event is arranged in thread is handled by a key, comprising: logical The key processing thread is crossed, the entry-into-force time of the above target touch event touches current goal plus preset interval time The entry-into-force time assignment of control event.
Optionally, each target touch event includes pressing event and lifting event, each target touch event It presses event and lifts difference set time entry-into-force time of event.
Optionally, described that the primitive event data that thread obtains the incoming event are read by input, comprising: to pass through institute It states input and reads the incoming event data that thread reads the incoming event, the incoming event data are converted into primitive event Data.
Optionally, the method also includes: setting state instruction mark is used to indicate the shape of key processing thread State, wherein if key processing thread is in operation, the state instruction mark is in operation, if a key is handled Not in operation, then the state instruction mark is the free time to thread.
Optionally, the method also includes: when detecting the incoming event of the peripheral device, check that the state refers to Indicating will;If the state instruction mark is to be not processed in operation to the incoming event;If the state instruction mark For the free time, then executes and the step of thread obtains the primitive event data of the incoming event is read by input.
According to the second aspect of the disclosure, a kind of peripheral controller is provided, is applied to touch control terminal, the touch control terminal It is connected with peripheral device;The peripheral controller includes: data acquisition module, in response to detecting the peripheral device Incoming event, thread is read by input and obtains the primitive event data of the incoming event;Event mapping block is used for base In preset mapping relations, the corresponding target touch-control thing of the incoming event is determined in the touch event of the touch control terminal Part;Data conversion module, for the primitive event data of the incoming event to be converted to the original of the target touch event Event data;Event processing module, for handling the primitive event data of target touch event described in thread process by a key, To execute the corresponding operational order of the target touch event.
Optionally, if the incoming event corresponds to multiple continuous target touch events, the event processing module Successively each target touch event in the multiple continuous target touch event is carried out the following processing: by a key The entry-into-force time of the target touch event is arranged in processing thread;According to the entry-into-force time, call described in first function processing The primitive event data of target touch event;Call second function that the target touch event is distributed to corresponding window.
Optionally, the event processing module, for handling thread by a key, the above target touch event Entry-into-force time is plus preset interval time to the entry-into-force time assignment of current goal touch event.
Optionally, each target touch event includes pressing event and lifting event, each target touch event It presses event and lifts difference set time entry-into-force time of event.
Optionally, the data acquisition module reads the defeated of the incoming event for reading thread by the input The incoming event data are converted to primitive event data by incoming event data.
Optionally, the peripheral controller further include: state management module, for state instruction mark to be arranged, to refer to Show the state of the key processing thread;Wherein, if a key handles thread in operation, the state instruction mark is In operation, if a key handles thread not in operation, the state instruction mark is the free time.
Optionally, the data acquisition module is also used to check institute when detecting the incoming event of the peripheral device State state instruction mark;If the state instruction mark is to be not processed in operation to the incoming event;If the state Warning Mark is the free time, then reads the primitive event data that thread obtains the incoming event by input.
According to the third aspect of the disclosure, a kind of computer readable storage medium is provided, computer program is stored thereon with, The computer program realizes any one of the above peripheral hardware control method when being executed by processor.
According to the fourth aspect of the disclosure, a kind of electronic equipment is provided, comprising: processor;And memory, for storing The executable instruction of the processor;Wherein, the processor is configured to above-mentioned to execute via the executable instruction is executed Any one peripheral hardware control method.
The disclosure has the advantages that
When incoming event occurs for peripheral device, thread is read by input and obtains its primitive event data, is converted to pair The primitive event data for the target touch event answered, then thread is handled by a key and is handled.In a first aspect, being from system bottom The incoming event of peripheral device is converted to touch event by layer, can directly be handled in bottom after conversion, without simulation True touch control operation avoids and writes the Touch_Panel node of touch screen, the processes such as starts to process by driving layer, thus simple The control method for having changed peripheral device has saved the expense of system resource.Second aspect reads in input and disposes one except thread Key handles thread, the processing corresponding to peripheral hardware operation, it is possible to reduce the shadow of thread is read input in the delay in treatment process It rings, reduces the load that thread is read in input, improve efficiency.The third aspect, the operation of peripheral device is in advance without writing touch screen Touch_Panel node, and its process flow path is different with true touch control operation, so as to avoid Touch_ Conflict of the write conflict and system of Panel node when handling two class incoming events, improves the validity of operation.Four directions Face configures the incoming event of peripheral device and the mapping relations of touch event from system level, realizes in system bottom unified Conversion peripheral hardware can also be operated even if being arranged in APP without the related of peripheral hardware operation and be converted to touch control operation, and distributed To APP window, peripheral hardware operation is set to come into force, APP level unaware, to realize decoupling of the peripheral device to APP, user is not necessarily to For the special setting button corresponding relationship of each APP, experience is preferable.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure Mode, and together with specification for explaining the principles of this disclosure.It should be evident that the accompanying drawings in the following description is only this public affairs The some embodiments opened for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 shows a kind of flow chart of peripheral hardware control method in this illustrative embodiment;
Fig. 2 shows the sub-process figures of peripheral hardware control method a kind of in this illustrative embodiment;
Fig. 3 shows the flow chart of another peripheral hardware control method in this illustrative embodiment;
Fig. 4 shows a kind of structural block diagram of peripheral controller in this illustrative embodiment;
Fig. 5 shows a kind of computer readable storage medium for realizing the above method in this illustrative embodiment;
Fig. 6 shows a kind of electronic equipment for realizing the above method in this illustrative embodiment.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be with a variety of shapes Formula is implemented, and is not understood as limited to example set forth herein;On the contrary, thesing embodiments are provided so that the disclosure will more Fully and completely, and by the design of example embodiment comprehensively it is communicated to those skilled in the art.Described feature, knot Structure or characteristic can be incorporated in any suitable manner in one or more embodiments.
It is by peripheral hardware key and APP (Application, application program) control command in a kind of scheme of the relevant technologies It establishes corresponding relationship and realizes peripheral hardware control.Such as establish corresponding relationship between handle key and game control command, when with When lower handle key is pressed at family, control command is searched by marking keys, then calls directly control command or control touch control terminal Control command is called to carry out game manipulation.The disadvantages of this solution is that peripheral hardware has strong dependence to APP, needs to set for different APP Different peripheral hardware key corresponding relationships is set, also needs APP to peripheral hardware authorization sometimes, increases the difficulty that user uses.
It is that peripheral hardware operation simulation is realized peripheral hardware and controlled for touch control operation in another scheme of the relevant technologies.Example When pressing lower handle key such as user, simulates true touch control operation and write the Touch_Panel node of touch screen, it is subsequent with processing The true flow processing of the touch control operation handle key-press event, realizes operational order.The disadvantages of this solution is by peripheral hardware key thing Part is converted to that write Touch_Panel node more time-consuming, and should during in case of true touch control operation, it is possible to create The write conflict of Touch_Panel node causes operation invalid.
In view of various problems above-mentioned, the illustrative embodiments of the disclosure provide firstly a kind of applied to touch control terminal Peripheral hardware control method.Touch control terminal refers to the terminal with touch-control component (such as touch screen), such as mobile phone, tablet computer, just Take formula game machine etc.;Peripheral hardware refers to the external input device for being connectable to touch control terminal, for example, handle, external rocking bar or other Game peripheral;Touch control terminal can connect peripheral device by modes such as USB, bluetooths, and the disclosure does not limit this.
Fig. 1 shows a kind of process of this illustrative embodiment, may comprise steps of S110~S140:
Step S110 reads thread by input and obtains the input thing in response to detecting the incoming event of peripheral device The primitive event data of part.
Wherein, the incoming event of peripheral device refers to the event that user is input operation instruction by peripheral device, such as with Click handle key in family;It is the thread that system is used to read event data from each input node that thread is read in input, such as can be with It is the InputReader thread in android system;Input node in this illustrative embodiment refers to that each entity input is set Standby mapping in systems, such as handle can correspond to Touch_ with the JoyStick node in correspondence system, touch screen Panel node etc.;Primitive event data are the data formats of system bottom processing event, such as in android system RawEvent。
In a kind of optional embodiment, the incoming event of peripheral device is first generated from the driving layer of peripheral device, The data format of the data format and system bottom that drive layer is typically different, and belongs to User space, and the data of driving layer are referred to as input Event data.Based on this, step S110 may include: to read the incoming event data that thread reads incoming event by input, Incoming event data are converted into primitive event data.I.e. input reading thread can be by the defeated of each peripheral device different-format Incoming event data are uniformly converted to the primitive event data of system bottom format.With android system for example, The workflow of InputReader thread is as follows: being passed through in the circulating cycle by the continuous circular treatment of loopOnce () Incoming event under EventHub- > getEvents () reading/dev/input node, specifically reading is incoming event data Input_event is put into mEventBuffer.MEventBuffer is the array that a size is 256, then again will Incoming event input_event in mEventBuffer is converted to RawEvent, if the type of input_event is EV_ KEY can then call device- > keyMap.keyLayoutMap- > mapKey function that iput_event.code is mapped as RawEvent.keyCode, as primitive event data.
Step S120 is based on preset mapping relations, and above-mentioned incoming event pair is determined in the touch event of touch control terminal The target touch event answered.
In this illustrative embodiment, the mapping relations of incoming event to the touch event of peripheral device can be filled by peripheral hardware It sets or APP manufacturer presets, setting can also be customized by the user.Such as: user can be in the X of system level setting handle Key corresponds to the click event of touch screen specific region, and no matter in which interface, which APP, user presses X key, equivalent In the touch-control clicking operation for having carried out the region.Target touch event is that incoming event detected in step S110 is corresponding Specific touch event.
The primitive event data of above-mentioned incoming event are converted to the primitive event number of target touch event by step S130 According to.
The primitive event data of touch event are usually the data that system configured in advance is crossed, and are determining target touch event Afterwards, its primitive event data is called directly, when calling, Partial Variable value therein can be modified according to the actual situation, Such as relevant variate-value of the variate-value of time correlation, operating force etc..The conversion process of step S130 is carried out in system bottom, Such as RawEvent conversion can be realized with the Native layer of android system.
To the above process for example, a key input event (OneKeyEvent), corresponding touch event occur for handle Event (key A down and key A up) is clicked for the touch-control of a-quadrant, the RawEvent of OneKeyEvent is converted into key A RawEvent, can be as follows:
//key A down event
generateOneKeyEvent(EV_ABS,ABS_MT_SLOT,handleSlot);
generateOneKeyEvent(EV_ABS,ABS_MT_TRACKING_ID,flag);
generateOneKeyEvent(EV_KEY,BTN_TOUCH,JOYSTICK_TOUCH_DOWN;
generateOneKeyEvent(EV_ABS,ABS_MT_POSITION_X,A.x);
generateOneKeyEvent(EV_ABS,ABS_MT_POSITION_Y,A.y);
generateOneKeyEvent(EV_SYN,SYN_REPORT,0);
//key A up event
generateOneKeyEvent(EV_ABS,ABS_MT_SLOT,handleSlot);
generateOneKeyEvent(EV_ABS,ABS_MT_TRACKING_ID,0xffffffff);
generateOneKeyEvent(EV_KEY,BTN_TOUCH,JOYSTICK_TOUCH_UP);
generateOneKeyEvent(EV_SYN,SYN_REPORT,0)。
Step S140 is handled the primitive event data of thread process target touch event by a key, is touched with performance objective The corresponding operational order of control event.
Wherein, key processing thread is to read to dispose except thread in input, dedicated for processing peripheral device input The thread for the touch event that event is converted, method and function needed for encapsulating event handling in the thread, can read original Beginning event data carries out business processing.Such as: in android system, it can detect peripheral device incoming event In the case of, one key of creation handles thread Onekey_Process_Thread, completes in InputReader by incoming event After RawEvent is converted to the RawEvent of target touch event, Onekey_Process_Thread is to target touch event RawEvent is handled, and the corresponding operational order of the RawEvent is executed.
It should be noted that a key handles thread dedicated for handling the touching converted by the incoming event of peripheral device Control event can be considered pseudo- touch event, if user really operates on touch screen, true touch event occurs, It is then read in input and handles its primitive event data, the i.e. acquisition of primitive event data and place in thread (such as InputReader) Reason all reads in thread in input and executes.
Based on above content, in this illustrative embodiment, when incoming event occurs for peripheral device, passes through input and read Thread obtains its primitive event data, is converted to the primitive event data of corresponding target touch event, then handle by a key Thread is handled.In a first aspect, be to be converted to touch event from system bottom by the incoming event of peripheral device, it can after conversion Directly to be handled in bottom, without simulating true touch control operation, the Touch_Panel section for writing touch screen is avoided Point the processes such as starts to process by driving layer and has saved the expense of system resource to simplify the control method of peripheral device. Second aspect, reads in input and disposes key processing thread except thread, the processing corresponding to peripheral hardware operation, it is possible to reduce processing The influence of thread is read input in delay in the process, reduces the load that thread is read in input, improves efficiency.The third aspect, The operation of peripheral device is not necessarily to write the Touch_Panel node of touch screen, and its process flow path and true touching in advance Control operation is different, so as to avoid Touch_Panel node write conflict and system when handling two class incoming events Conflict, improves the validity of operation.Fourth aspect configures the incoming event and touch event of peripheral device from system level Mapping relations realize unified conversion in system bottom, can also will be outer even if being arranged in APP without the related of peripheral hardware operation If operation is converted to touch control operation, and is distributed to APP window, peripheral hardware operation is set to come into force, APP level unaware, to realize Decoupling of the peripheral device to APP, user are not necessarily to be directed to the special setting button corresponding relationship of each APP, and experience is preferable.
In a kind of optional embodiment, if above-mentioned incoming event corresponds to multiple continuous target touch events, example Such as in gaming in order to realize that a key is even recruited, a key changes the outfit function, the LT key (Left of setting handle is may be implemented in user Trigger, left trigger are one of common function key on handle) a-quadrant of corresponding successive adopting consecutive click chemical reaction touch screen, B area and The region C, i.e. LT → key A+B+C.Based on this, in the primitive event data for handling thread process target touch event by a key When, refering to what is shown in Fig. 2, can successively in above-mentioned multiple continuous target touch events each target touch event carry out with The processing of lower step S210~S230:
Step S210 handles the entry-into-force time that target touch event is arranged in thread by a key;
Step S220 calls the primitive event data of first function processing target touch event according to the entry-into-force time;
Step S230 calls second function that target touch event is distributed to corresponding window.
Wherein, the entry-into-force time of target touch event refers to the time point that the event comes into force on touch control terminal, shows, former It may include the variable of entry-into-force time in beginning event data, such as carry now variable, as entry-into-force time in RawEvent;The One function is responsible for the processing of primitive event data, such as can be ProcessEventsLocked function;Second function is responsible for thing Part distribution, such as can be Flush function, in android system, Flush function is responsible for for RawEvent being sent to InputDispatcher thread is distributed to each window, such as the interface of application layer etc. by InputDispatcher thread.
In one embodiment, there is the interface for obtaining target touch event in system, by calling the interface can be with The more entry-into-force time of fresh target touch event.In another embodiment, thread, the above target can be handled by a key The entry-into-force time of touch event is plus preset interval time to the entry-into-force time assignment of current goal touch event.Wherein, phase The interval time of adjacent two target touch events can be set by the user, can also by system according to the type of target touch event, Quantity etc. automatically set, if target touch event be click, then interval time can suitably increase, target touch event quantity compared with More, then interval time can suitably increase shortening.It is of course also possible to be set between every adjacent two targets touch event different Interval time, for example, if incoming event corresponds to the continuous target touch events of n, be denoted as respectively K1, K2 ..., Kn, T1 is set as the interval time of K1 and K2, t2 is that interval time ... the tn-1 of K2 and K3 is the interval time of Kn-1 and Kn, for Current goal touch event Ki, entry-into-force time Ti=Ti-1+ti-1.
Further, each target touch event may include event of pressing and lift event, wherein pressing event and lift The entry-into-force time for the event of rising can differ the set time.Such as one key input event OneKeyEvent of handle above-mentioned corresponds to A Press event, key A up in touch-control click event key A down and key A up, the key A down expression a-quadrant in region Indicate the event of lifting of a-quadrant, the entry-into-force time of two events differs set time t0, i.e. now (key A up)=now (key A down)+t0.Set time can rule of thumb or touch event type etc. determines, for example, click event when, the set time can To be 5ms, the residence time that finger clicks screen when simulating true touch control operation is about 5ms.
In this illustrative embodiment, after determining target touch event corresponding to incoming event, each target is touched The dismantling of control event event and lifts event to press, such as handle LT key above-mentioned corresponds to key A+B+C, respectively by key A, Key B and key C dismantling are to press event accordingly and lift event, available queue (the key A being made of 6 events Down, key A up, key B down, key B up, key C down, key C up);LT event is obtained by calling interface RawEvent in now variate-value, be assigned to key A down now (i.e. entry-into-force time) then according to preset The now of other events is successively calculated every time, set time, such as: the interval time of setting A and B interval time t1, B and C T2, set time t0 then have following relationship:
Now (key A up)=now (key A down)+t0;
Now (key B down)=now (key A down)+t1;
Now (key B up)=now (key B down)+t0;
Now (key C down)=now (key B down)+t2;
Now (key C up)=now (key C down)+t0;
Then above-mentioned first function and second function are used, successively each event in queue is handled and divided Hair.
From the foregoing, it will be observed that when a key handles thread process target touch event, especially continuous multiple target touch events it Between have time interval in the case where, processing need the regular hour, therefore, in a kind of optional embodiment, Ke Yishe State instruction mark is set, the state of key processing thread is used to indicate: if key processing thread is in operation, state instruction mark Will is in operation, if a key handles thread not in operation, state instruction mark is the free time.For example, being directed to key processing Thread Onekey_Process_Thread, setting Onekey_Thread_Running indicate that initial value False works as Onekey_ When Process_Thread brings into operation, Onekey_Thread_Running value becomes True, when terminating operation, then becomes again False.System can be readily determined the state of key processing thread as a result, in order to carry out otherwise decision.
Further, when detecting the incoming event of peripheral device, state instruction mark can be checked;If state instruction Mark is then to be not processed to the incoming event in operation;If state instruction mark is the free time, can star shown in FIG. 1 Method flow.In other words, after the peripheral operation event switch target touch event of user's last time, thread is handled by a key Reason, in the case where also untreated end, if user carries out peripheral hardware operation again, can be identified as being spaced too short behaviour Make, it is not processed.The case where so as to avoid repeating to establish key processing thread, further decrease opening for system resource Pin.
Fig. 3 shows a kind of process of this illustrative embodiment based on android system.Step S310 is first carried out, Event is taken out from EventHub, usually input_event;If it is the incoming event of peripheral device, then follow the steps S320, detecting state Warning Mark determine the state of key processing thread;If mark is True, indicate that key processing thread exists In operation, S321 is thened follow the steps, is not processed, continues to read event in EventHub;If mark is False, one is indicated Key handles thread not in operation, thens follow the steps S322, is converted to the RawEvent of corresponding touch event;Then step is executed S323, one key of creation handle thread Onekey_Process_Thread;Then step S324 is executed, determines first key The now (entry-into-force time) of down event;Then step S325 is executed, the processing of ProcessEventsLocked function is called, calls Flush function is sent to InputDispatcher thread, to be distributed to corresponding window;Then step S326 is executed, by key The now delay 5ms of down event, executes step S327, determines the now of key up event;Then step S328 is executed, is called ProcessEventsLocked function and the processing of Flush function and distribution key up event;If subsequent, there are also other targets to touch Control event, thens follow the steps S329, is delayed according to preset interval time, with the now of the next target touch event of determination; If all target touch events are disposed, S330 is thened follow the steps, closes Onekey_Process_Thread, changes state Warning Mark continues to read event in EventHub.For the event taken out in EventHub, grasped if it is true touch-control Make, thens follow the steps S331, obtain its RawEvent;Step S332 is executed again, is called at ProcessEventsLocked function Reason;Step S333 is executed again, calls Flush function to be sent to InputDispatcher thread, to be distributed to corresponding window; Step S334 is executed again, is recycled by loopOnce, continues to read event in EventHub.
The illustrative embodiments of the disclosure additionally provide a kind of peripheral controller, can be applied to touch control terminal, should Touch control terminal is connected with peripheral device.As shown in figure 4, the peripheral controller 400 may include: data acquisition module 410, use In the incoming event in response to detecting peripheral device, the primitive event data that thread obtains incoming event are read by input; Event mapping block 420 determines that incoming event is corresponding in the touch event of touch control terminal for being based on preset mapping relations Target touch event;Data conversion module 430, for the primitive event data of incoming event to be converted to target touch event Primitive event data;Event processing module 440, for handling the primitive event of thread process target touch event by a key Data, with the corresponding operational order of performance objective touch event.
In a kind of optional embodiment, if above-mentioned incoming event corresponds to multiple continuous target touch events, Event processing module 440 successively can carry out following place to each target touch event in multiple continuous target touch events Reason: the entry-into-force time that target touch event is arranged in thread is handled by a key;According to the entry-into-force time, first function is called to handle mesh Mark the primitive event data of touch event;Call second function that target touch event is distributed to corresponding window.
In a kind of optional embodiment, event processing module 440 can be also used for handling thread by a key, with The entry-into-force time of upper target touch event is plus preset interval time to the entry-into-force time assignment of current goal touch event.
In a kind of optional embodiment, each target touch event may include event of pressing and lift event, often Difference set time entry-into-force time of a target touch event pressed event and lift event.
In a kind of optional embodiment, data acquisition module 410 can be also used for reading thread reading by input Incoming event data are converted to primitive event data by the incoming event data of incoming event.
In a kind of optional embodiment, peripheral controller 400 can also include: state management module (in figure not Show), for state instruction mark to be arranged, to indicate the state of key processing thread;Wherein, if key processing thread is being run In, then state instruction mark is in operation, if a key handles thread not in operation, state instruction mark is the free time.
In a kind of optional embodiment, data acquisition module 410 can be also used for detect the defeated of peripheral device When incoming event, state instruction mark is checked, if state instruction mark is to be not processed to incoming event, in operation if state Warning Mark is the free time, then reads the primitive event data that thread obtains incoming event by input.
The detail of each module has been described in detail in method some embodiments in above-mentioned apparatus, undisclosed side Case detail content may refer to the embodiment content of method part, thus repeat no more.
Person of ordinary skill in the field it is understood that various aspects of the disclosure can be implemented as system, method or Program product.Therefore, various aspects of the disclosure can be with specific implementation is as follows, it may be assumed that complete hardware embodiment, complete The embodiment combined in terms of full Software Implementation (including firmware, microcode etc.) or hardware and software, can unite here Referred to as circuit, " module " or " system ".
The illustrative embodiments of the disclosure additionally provide a kind of computer readable storage medium, and being stored thereon with can be real The program product of existing this specification above method.In some possible embodiments, various aspects of the disclosure can also be real It is now a kind of form of program product comprising program code, when program product is run on the terminal device, program code is used In executing terminal device described in above-mentioned " illustrative methods " part of this specification according to the various exemplary implementations of the disclosure The step of mode.
Refering to what is shown in Fig. 5, describing the program for realizing the above method according to an exemplary embodiment of the present disclosure Product 500, can be using portable compact disc read only memory (CD-ROM) and including program code, and can set in terminal It is standby, such as run on PC.However, the program product of the disclosure is without being limited thereto, in this document, readable storage medium storing program for executing can With to be any include or the tangible medium of storage program, the program can be commanded execution system, device or device use or Person is in connection.
Program product can be using any combination of one or more readable mediums.Readable medium can be readable signal Jie Matter or readable storage medium storing program for executing.Readable storage medium storing program for executing for example can be but be not limited to electricity, magnetic, optical, electromagnetic, infrared ray or partly lead System, device or the device of body, or any above combination.More specific example (the non exhaustive column of readable storage medium storing program for executing Table) it include: the electrical connection with one or more conducting wires, portable disc, hard disk, random access memory (RAM), read-only storage Device (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read only memory (CD- ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, In carry readable program code.The data-signal of this propagation can take various forms, including but not limited to electromagnetic signal, Optical signal or above-mentioned any appropriate combination.Readable signal medium can also be any readable Jie other than readable storage medium storing program for executing Matter, the readable medium can send, propagate or transmit for by instruction execution system, device or device use or and its The program of combined use.
The program code for including on readable medium can transmit with any suitable medium, including but not limited to wirelessly, have Line, optical cable, RF etc. or above-mentioned any appropriate combination.
Can with any combination of one or more programming languages come write for execute the disclosure operation program Code, programming language include object oriented program language-Java, C++ etc., further include conventional process Formula programming language-such as " C " language or similar programming language.Program code can be calculated fully in user It executes in equipment, partly execute on a user device, executing, as an independent software package partially in user calculating equipment Upper part executes on a remote computing or executes in remote computing device or server completely.It is being related to remotely counting In the situation for calculating equipment, remote computing device can pass through the network of any kind, including local area network (LAN) or wide area network (WAN), it is connected to user calculating equipment, or, it may be connected to external computing device (such as utilize ISP To be connected by internet).
The illustrative embodiments of the disclosure additionally provide a kind of electronic equipment that can be realized the above method.Referring to Fig. 6 describes the electronic equipments 600 of this illustrative embodiments according to the disclosure.The electronic equipment 600 that Fig. 6 is shown is only An example, should not function to disclosure embodiment and use scope bring any restrictions.
As shown in fig. 6, electronic equipment 600 can be showed in the form of universal computing device.The component of electronic equipment 600 can To include but is not limited to: at least one above-mentioned processing unit 610, connects not homologous ray group at least one above-mentioned storage unit 620 The bus 630 and display unit 640 of part (including storage unit 620 and processing unit 610).
Storage unit 620 is stored with program code, and program code can be executed with unit 610 processed, so that processing unit 610 execute the step described in above-mentioned " illustrative methods " part of this specification according to the various illustrative embodiments of the disclosure Suddenly.For example, processing unit 610 can execute Fig. 1 to method and step shown in Fig. 3 etc..
Storage unit 620 may include the readable medium of volatile memory cell form, such as Random Access Storage Unit (RAM) 621 and/or cache memory unit 622, it can further include read-only memory unit (ROM) 623.
Storage unit 620 can also include program/utility 624 with one group of (at least one) program module 625, Such program module 625 includes but is not limited to: operating system, one or more application program, other program modules and It may include the realization of network environment in program data, each of these examples or certain combination.
Bus 630 can be to indicate one of a few class bus structures or a variety of, including storage unit bus or storage Cell controller, peripheral bus, graphics acceleration port, processing unit use any bus structures in a variety of bus structures Local bus.
Electronic equipment 600 can also be with one or more external equipments 700 (such as keyboard, sensing equipment, bluetooth equipment Deng) communication, can also be enabled a user to one or more equipment interact with the electronic equipment 600 communicate, and/or with make Any equipment (such as the router, modulation /demodulation that the electronic equipment 600 can be communicated with one or more of the other calculating equipment Device etc.) communication.This communication can be carried out by input/output (I/O) interface 650.Also, electronic equipment 600 can be with By network adapter 660 and one or more network (such as local area network (LAN), wide area network (WAN) and/or public network, Such as internet) communication.As shown, network adapter 660 is communicated by bus 630 with other modules of electronic equipment 600. It should be understood that although not shown in the drawings, other hardware and/or software module can not used in conjunction with electronic equipment 600, including but not Be limited to: microcode, device driver, redundant processing unit, external disk drive array, RAID system, tape drive and Data backup storage system etc..
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the disclosure The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating Equipment (can be personal computer, server, terminal installation or network equipment etc.) is executed according to the exemplary implementation of the disclosure The method of mode.
In addition, above-mentioned attached drawing is only the schematic theory of the processing according to included by the method for disclosure illustrative embodiments It is bright, rather than limit purpose.It can be readily appreciated that the time that above-mentioned processing shown in the drawings did not indicated or limited these processing is suitable Sequence.In addition, be also easy to understand, these processing, which can be, for example either synchronously or asynchronously to be executed in multiple modules.
It should be noted that although being referred to several modules or list for acting the equipment executed in the above detailed description Member, but this division is not enforceable.In fact, according to an exemplary embodiment of the present disclosure, above-described two Or more the feature and function of module or unit can be embodied in a module or unit.Conversely, above-described One module or the feature and function of unit can be to be embodied by multiple modules or unit with further division.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the disclosure His embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.Specification and embodiments are considered only as illustratively, and the true scope and spirit of the disclosure are by right It is required that pointing out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the attached claims.

Claims (10)

1. a kind of peripheral hardware control method, is applied to touch control terminal, the touch control terminal is connected with peripheral device;It is characterized in that, The described method includes:
In response to detecting the incoming event of the peripheral device, thread is read by input and obtains the original of the incoming event Event data;
Based on preset mapping relations, the corresponding target touching of the incoming event is determined in the touch event of the touch control terminal Control event;
The primitive event data of the incoming event are converted to the primitive event data of the target touch event;
The primitive event data of target touch event described in thread process are handled, by a key to execute the target touch event Corresponding operational order.
2. the method according to claim 1, wherein if the incoming event corresponds to multiple continuous target touchings Control event, then when handling the primitive event data of thread process target touch event by a key, successively to the multiple company Each target touch event in continuous target touch event carries out the following processing:
The entry-into-force time that the target touch event is arranged in thread is handled by a key;
According to the entry-into-force time, first function is called to handle the primitive event data of the target touch event;
Call second function that the target touch event is distributed to corresponding window.
3. according to the method described in claim 2, it is characterized in that, described handle the thread setting target by a key The entry-into-force time of touch event, comprising:
Thread is handled by a key, the entry-into-force time of the above target touch event is plus preset interval time to current The entry-into-force time assignment of target touch event.
4. according to the method described in claim 3, it is characterized in that, each target touch event includes pressing event and lift The event of rising, difference set time entry-into-force time of each target touch event pressed event and lift event.
5. the method according to claim 1, wherein described read the thread acquisition incoming event by input Primitive event data, comprising:
The incoming event data that thread reads the incoming event are read by the input, by the incoming event data conversion For primitive event data.
6. the method according to claim 1, wherein the method also includes:
State instruction mark is set, the state of the key processing thread is used to indicate, wherein if key processing thread exists In operation, then the state instruction mark is in operation, if key processing thread is not in operation, the state instruction Mark is the free time.
7. according to the method described in claim 6, it is characterized in that, the method also includes:
When detecting the incoming event of the peripheral device, the state instruction mark is checked;
If the state instruction mark is to be not processed in operation to the incoming event;
If the state instruction mark is the free time, executes and the primitive event that thread obtains the incoming event is read by input The step of data.
8. a kind of peripheral controller, is applied to touch control terminal, the touch control terminal is connected with peripheral device;It is characterized in that, Described device includes:
Data acquisition module reads thread by input and obtains for the incoming event in response to detecting the peripheral device The primitive event data of the incoming event;
Event mapping block, for being based on preset mapping relations, determination is described defeated in the touch event of the touch control terminal The corresponding target touch event of incoming event;
Data conversion module, for the primitive event data of the incoming event to be converted to the original of the target touch event Event data;
Event processing module, for handling the primitive event data of target touch event described in thread process by a key, to hold The corresponding operational order of the row target touch event.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt Claim 1-7 described in any item methods are realized when processor executes.
10. a kind of electronic equipment characterized by comprising
Processor;And
Memory, for storing the executable instruction of the processor;
Wherein, the processor is configured to require 1-7 described in any item via executing the executable instruction and carry out perform claim Method.
CN201910598703.1A 2019-07-04 2019-07-04 Peripheral hardware control method, peripheral controller, storage medium and electronic equipment Pending CN110362353A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910598703.1A CN110362353A (en) 2019-07-04 2019-07-04 Peripheral hardware control method, peripheral controller, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910598703.1A CN110362353A (en) 2019-07-04 2019-07-04 Peripheral hardware control method, peripheral controller, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN110362353A true CN110362353A (en) 2019-10-22

Family

ID=68217865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910598703.1A Pending CN110362353A (en) 2019-07-04 2019-07-04 Peripheral hardware control method, peripheral controller, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110362353A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399739A (en) * 2020-03-11 2020-07-10 努比亚技术有限公司 Touch event conversion processing method, terminal and computer readable storage medium
CN115639920A (en) * 2021-12-24 2023-01-24 荣耀终端有限公司 Drawing method, electronic device and readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681845A (en) * 2012-04-24 2012-09-19 深圳创维数字技术股份有限公司 Method and device for managing input events
CN102790918A (en) * 2012-08-17 2012-11-21 中国科学院声学研究所 Smart television and method for receiving remote controller input by smart television
CN107219940A (en) * 2017-03-31 2017-09-29 青岛海信电器股份有限公司 The conversion method and control device of a kind of sky mouse button and the Action Events of remote keying
CN108992924A (en) * 2018-08-21 2018-12-14 苏州蜗牛数字科技股份有限公司 A method of triggering orderly touch screen operation event
CN109260701A (en) * 2018-07-10 2019-01-25 广州小鸡快跑网络科技有限公司 A kind of conversion method and device of Android system standard incoming event
CN109714618A (en) * 2017-10-26 2019-05-03 卓望数码技术(深圳)有限公司 A kind of remote keying monitor method and device based on android set top box
CN109788356A (en) * 2018-12-19 2019-05-21 深圳市金锐显数码科技有限公司 A kind of smart television screen sliding method, apparatus and smart television based on remote controler

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681845A (en) * 2012-04-24 2012-09-19 深圳创维数字技术股份有限公司 Method and device for managing input events
CN102790918A (en) * 2012-08-17 2012-11-21 中国科学院声学研究所 Smart television and method for receiving remote controller input by smart television
CN107219940A (en) * 2017-03-31 2017-09-29 青岛海信电器股份有限公司 The conversion method and control device of a kind of sky mouse button and the Action Events of remote keying
CN109714618A (en) * 2017-10-26 2019-05-03 卓望数码技术(深圳)有限公司 A kind of remote keying monitor method and device based on android set top box
CN109260701A (en) * 2018-07-10 2019-01-25 广州小鸡快跑网络科技有限公司 A kind of conversion method and device of Android system standard incoming event
CN108992924A (en) * 2018-08-21 2018-12-14 苏州蜗牛数字科技股份有限公司 A method of triggering orderly touch screen operation event
CN109788356A (en) * 2018-12-19 2019-05-21 深圳市金锐显数码科技有限公司 A kind of smart television screen sliding method, apparatus and smart television based on remote controler

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399739A (en) * 2020-03-11 2020-07-10 努比亚技术有限公司 Touch event conversion processing method, terminal and computer readable storage medium
CN111399739B (en) * 2020-03-11 2022-04-19 努比亚技术有限公司 Touch event conversion processing method, terminal and computer readable storage medium
CN115639920A (en) * 2021-12-24 2023-01-24 荣耀终端有限公司 Drawing method, electronic device and readable storage medium
CN115639920B (en) * 2021-12-24 2023-12-22 荣耀终端有限公司 Drawing method, electronic device, and readable storage medium

Similar Documents

Publication Publication Date Title
CN103415835B (en) The processing method of a kind of touch screen-device user interface and touch screen-device
CN104967550B (en) unread message display method and device
CN103294187A (en) Apparatus and method for switching active application
CN105477854B (en) Applied to the handle control method of intelligent terminal, apparatus and system
CN107656620B (en) Virtual object control method and device, electronic equipment and storage medium
CN104303145B (en) Touch input is changed into local input by the conversion configuration file according to application
CN109460179B (en) Virtual object control method and device, electronic equipment and storage medium
US20220152476A1 (en) Method and device for processing information in game, storage medium and electronic device
CN108771862A (en) Information processing method and device, electronic equipment, storage medium
CN103345303B (en) A kind of Intelligent mobile equipment substitutes system and the implementation method of mouse-keyboard entirely
CN108595220A (en) Processing method, equipment and the computer readable storage medium of application component
KR102091509B1 (en) Method for processing character input and apparatus for the same
CN109491562A (en) A kind of interface display method and terminal device of voice assistant application program
CN108635854A (en) Technical ability releasing control method and device, storage medium, electronic equipment
US20140164186A1 (en) Method for providing application information and mobile terminal thereof
CN113396378A (en) System and method for a multipurpose input device for two-dimensional and three-dimensional environments
CN110362353A (en) Peripheral hardware control method, peripheral controller, storage medium and electronic equipment
CN108434732A (en) Virtual object control method and device, storage medium, electronic equipment
CN112882850A (en) Key event processing method, device, equipment and storage medium
CN108815843B (en) Control method and device of virtual rocker
CN106873847A (en) Interface operation method, system and mobile terminal when a kind of touch-screen fails
US20130249810A1 (en) Text entry mode selection
CN105007377A (en) Cellphone remote control device, system and method
KR100909468B1 (en) Method for representing multipoint contacting at touch panel in screen
CN105393214B (en) Self-revealing symbolic gestures

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191022