Disclosure of Invention
The invention aims to overcome the defects of the prior art, and provides a soft input method position adjusting method, a device, a storage medium and a large-screen all-in-one machine, which are applied to the large-screen all-in-one machine, so that when the large-screen all-in-one machine of a user performs input operation, the position which is most suitable for the user to input is selected to call the soft input method, and friendly user input experience is obtained.
In order to solve the technical problem, an embodiment of the present invention provides a position adjustment method of a soft input method applied to a large-screen all-in-one machine, where the method includes:
when a user clicks an input box on the all-in-one machine equipment to call a soft input method, obtaining click coordinate point information of the user clicking the input box; and the number of the first and second groups,
obtaining first coordinate information of the upper left corner of the input box and height information of the input box;
calculating to obtain second coordinate information of the top left corner vertex of the soft input method based on the click coordinate point information, the first coordinate information and the height information of the input box;
judging whether the ordinate in the second coordinate information meets a preset condition or not;
and if so, adjusting and displaying on the screen of the all-in-one machine based on the second coordinate information and the preset width and the preset height of the soft input method.
Optionally, the obtaining, by calculation based on the click coordinate point information, the first coordinate information, and the height information of the input box, second coordinate information of a vertex at an upper left corner of the soft input method includes:
calculating to obtain a first abscissa based on the abscissa in the click coordinate point information and the preset width of the soft input method;
calculating to obtain a first vertical coordinate based on the vertical coordinate in the first coordinate information, the height information of the input frame, the preset height of the soft input method and the preset spacing distance;
and forming second coordinate information of the vertex at the upper left corner of the soft input method based on the first horizontal coordinate and the first vertical coordinate.
Optionally, the obtaining a first abscissa by calculation based on the abscissa in the click coordinate point information and the preset width of the soft input method includes:
judging whether the sum of the abscissa in the click coordinate point information and the preset width of the soft input method is larger than the screen resolution width of the all-in-one machine equipment or not;
if so, subtracting the preset width of the soft input method from the screen resolution width of the all-in-one machine equipment to calculate to obtain a first abscissa;
and if not, directly taking the abscissa in the click coordinate point information as the first abscissa.
Optionally, the calculating based on the ordinate in the first coordinate information, the height information of the input box, the preset height of the soft input method, and the preset separation distance to obtain the first ordinate includes:
judging whether the sum of the vertical coordinate in the first coordinate information, the height information of the input frame, the preset height of the soft input method and the preset spacing distance is larger than the screen resolution height of the all-in-one machine equipment or not;
if so, calculating by sequentially subtracting the preset height of the soft input method and the preset spacing distance from the vertical coordinate in the first coordinate information to obtain a first vertical coordinate, and constructing a coordinate system by taking any one point in any two vertexes of a frame on a screen of the all-in-one machine equipment as an origin; or the like, or, alternatively,
sequentially subtracting the height information of the input frame and the calculation of the preset spacing distance from the vertical coordinate in the first coordinate information to obtain a first vertical coordinate, and constructing a coordinate system by taking any one point in any two vertexes of a lower frame of a screen of the all-in-one machine equipment as an origin;
if not, calculating the sum of the vertical coordinate in the first coordinate information, the height information of the input frame and the preset spacing distance to obtain a first vertical coordinate, and when an arbitrary point in any two vertexes of a frame on a screen of the all-in-one machine equipment is used as an origin to construct a coordinate system; or the like, or, alternatively,
and calculating the sum of the vertical coordinate in the first coordinate information, the preset height of the soft input method and the preset spacing distance to obtain a first vertical coordinate, and when an arbitrary point in any two vertexes of a lower frame of a screen of the all-in-one machine equipment is used as an origin to construct a coordinate system.
Optionally, the preset spacing distance is one sixth of the screen resolution height of the all-in-one machine device.
Optionally, the method further includes:
if the vertical coordinate in the second coordinate information does not meet the preset condition, adjusting the second coordinate information according to a preset adjustment rule, and adjusting and displaying on the screen of the all-in-one machine after the adjustment is finished;
the preset adjustment rule comprises the following steps:
averagely dividing the large screen of the all-in-one machine equipment into six areas;
determining positions of the click coordinate point information in six areas;
if the clicked coordinate point information falls in the upper left area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of the top left vertex of the soft input method to be 0 in abscissa and the height of the divided area in ordinate;
if the clicked coordinate point information falls in the upper right area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of the top left corner vertex of the soft input method to the abscissa which is the width of the screen minus the preset width of the soft input method, and the ordinate which is the height of the divided area;
if the clicked coordinate point information falls in the large screen middle area of the all-in-one machine equipment, adjusting second coordinate information of the top left corner vertex of the soft input method to be 0 on the abscissa, and adjusting the ordinate to be twice the height of the divided areas;
if the clicked coordinate point information falls in the large screen middle right area of the all-in-one machine equipment, adjusting second coordinate information of a top left corner vertex of the soft input method to be that an abscissa is the width of the screen minus a preset width of the soft input method, and an ordinate is twice the height of the divided areas;
if the clicked coordinate point information falls in the left lower area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of a top left corner vertex of the soft input method to be 0 in abscissa and adjusting the ordinate to be the height of the divided area;
if the clicked coordinate point information falls in the right lower area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of the top left corner vertex of the soft input method to the point that the abscissa is the width of the screen minus the preset width of the soft input method, and the ordinate is the height of the divided area;
the large screen of the all-in-one machine equipment is averagely divided into six areas, the width of each area is one half of the width of the screen, and the height of each area is one third of the height of the screen.
Optionally, the preset condition is that the abscissa in the second coordinate information is greater than or equal to 0 and the height of the ordinate of the second coordinate information plus the preset height of the soft input method is less than or equal to the height of the screen.
In addition, the embodiment of the invention also provides a soft input method position adjusting device applied to the large-screen all-in-one machine, and the device comprises:
a first obtaining module: the method comprises the steps that when a user clicks an input box on all-in-one machine equipment to call a soft input method, click coordinate point information of the user clicking the input box is obtained; and the number of the first and second groups,
a second obtaining module: the first coordinate information of the upper left corner of the input box and the height information of the input box are obtained;
a calculation module: the second coordinate information of the top left corner vertex of the soft input method is obtained through calculation based on the click coordinate point information, the first coordinate information and the height information of the input box;
a judging module: the second coordinate information is used for judging whether the vertical coordinate in the second coordinate information meets a preset condition or not;
adjusting the display module: and adjusting and displaying the screen of the all-in-one machine based on the second coordinate information and the preset width and the preset height of the soft input method when the vertical coordinate in the second coordinate information is judged to meet the preset condition.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the soft input method position adjustment method described in any one of the above.
In addition, an embodiment of the present invention further provides a large-screen all-in-one machine, which includes:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: and executing the soft input method position adjusting method.
In the embodiment of the invention, when the user performs input operation on the large-screen all-in-one machine, the position most suitable for the user to input is selected to call the soft input method, so that friendly user input experience is obtained.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Examples
Referring to fig. 1, fig. 1 is a schematic flow chart of a soft input method position adjustment method applied to a large-screen all-in-one machine in an embodiment of the present invention.
As shown in fig. 1, a soft input method position adjustment method applied to a large-screen all-in-one machine includes:
s11: when a user clicks an input box on the all-in-one machine equipment to call a soft input method, obtaining click coordinate point information of the user clicking the input box;
in the specific implementation process of the invention, the all-in-one machine equipment is large-screen all-in-one machine equipment for education, when in application, a user (generally a teacher) needs to click an input box with a hand or a writing pen to call a soft input method when inputting corresponding information on a screen, and when the user clicks the input box, click coordinate information (touch X, touch Y) of the position of the clicked input box is read through an algorithm built in the all-in-one machine.
S12: acquiring first coordinate information of the upper left corner of the input box, width information of the input box and height information of the input box;
in the specific implementation process of the invention, the position and the size of the input box displayed on the all-in-one machine equipment are preset, and the first coordinate information (ViewX, ViewY) of the upper left corner in the input box, the width information ViewW of the input box, the height information ViewH of the input box and the like can be obtained through reading of a corresponding algorithm or program.
S13: calculating to obtain second coordinate information of the top left corner vertex of the soft input method based on the click coordinate point information, the first coordinate information and the height information of the input box;
in a specific implementation process of the present invention, the calculating and obtaining second coordinate information of a vertex at an upper left corner of the soft input method based on the click coordinate point information, the first coordinate information, and the height information of the input box includes: calculating to obtain a first abscissa based on the abscissa in the click coordinate point information and the preset width of the soft input method; calculating to obtain a first vertical coordinate based on the vertical coordinate in the first coordinate information, the height information of the input frame, the preset height of the soft input method and the preset spacing distance; and forming second coordinate information of the vertex at the upper left corner of the soft input method based on the first horizontal coordinate and the first vertical coordinate.
Further, the calculating to obtain the first abscissa based on the abscissa in the click coordinate point information and the preset width of the soft input method includes: judging whether the sum of the abscissa in the click coordinate point information and the preset width of the soft input method is larger than the screen resolution width of the all-in-one machine equipment or not; if so, subtracting the preset width of the soft input method from the screen resolution width of the all-in-one machine equipment to calculate to obtain a first abscissa; and if not, directly taking the abscissa in the click coordinate point information as the first abscissa.
Further, the obtaining of the first ordinate through calculation based on the ordinate in the first coordinate information, the height information of the input box, the preset height of the soft input method, and the preset spacing distance includes: judging whether the sum of the vertical coordinate in the first coordinate information, the height information of the input frame, the preset height of the soft input method and the preset spacing distance is larger than the screen resolution height of the all-in-one machine equipment or not; if so, calculating by sequentially subtracting the preset height of the soft input method and the preset spacing distance from the vertical coordinate in the first coordinate information to obtain a first vertical coordinate, and constructing a coordinate system by taking any one point in any two vertexes of a frame on a screen of the all-in-one machine equipment as an origin; or sequentially subtracting the height information of the input frame and the calculation of the preset spacing distance from the vertical coordinate in the first coordinate information to obtain a first vertical coordinate, and constructing a coordinate system by taking any one point in any two vertexes of the lower frame of the screen of the all-in-one machine equipment as an origin; if not, calculating the sum of the vertical coordinate in the first coordinate information, the height information of the input frame and the preset spacing distance to obtain a first vertical coordinate, and when an arbitrary point in any two vertexes of a frame on a screen of the all-in-one machine equipment is used as an origin to construct a coordinate system; or, the first ordinate is obtained by calculating the sum of the ordinate in the first coordinate information, the preset height of the soft input method and the preset spacing distance, and when a coordinate system is constructed by taking any one point of any two vertexes of a lower frame of a screen of the all-in-one machine device as an origin.
Furthermore, the preset spacing distance is one sixth of the screen resolution height of the all-in-one machine equipment.
Specifically, the android system soft input method pops up a flow, EditText inherits TextView, when a user clicks an input box, the user requests to call out the soft input method, and the InputMethodManager performs focus detection on the input box to determine whether the user continues to call out the soft input method; in the embodiment of the invention, adding the absolute coordinate value of View in the transmitted EditorInfo, namely the first coordinate information (View x, View y), the width (View w, View h) and the absolute coordinate value (TouchX, TouchY) of the user click event; using the data to adjust the position of the soft input method; if the automatically adjusted position still cannot meet the habit of the user, the user can perform manual dragging for adjustment.
In general, the coordinate system may be established by using any one of four corners of the screen of the all-in-one machine as an origin, or by using any one point of the screen of the all-in-one machine as the origin; in the embodiment of the invention, the embodiment is given in which any one of four corners of a screen of the all-in-one machine is taken as an origin, and coordinate points in a coordinate system take positive values; and in the present invention, the width of the screen generally refers to the screen resolution width; screen height generally refers to screen resolution height.
The default display position calculation method of the soft input method is defined as follows: the screen resolution width = ScreenWidth; screen resolution is high = ScreenHeight; distance (preset spacing) = ScreenHeight/6; the Distance is 1/6 size of the screen, the value is fixed, and can be adjusted according to the requirement of a client, mainly aiming at adjusting the input method to the most suitable position of a person, and the Distance is found to be the optimal value through experiments; the width of the soft input method represents InputW, and the height of the soft input method represents InputH; second coordinate information of the top left vertex of the Soft input method (InputX, InputY)
For calculation of the InputX, firstly, judging whether the sum of an abscissa TouchX in click coordinate point information (TouchX, TouchY) and a preset width InputW of a soft input method is larger than a screen resolution width ScreenWidth of the all-in-one machine equipment or not; when the resolution ratio is larger than the preset width, the screen resolution ratio width ScreenWidth of the all-in-one machine equipment is subtracted by the preset width InputW of the soft input method to obtain a first horizontal coordinate InputX; and when the value is less than the first value, directly taking the abscissa TouchX in the click coordinate point information (TouchX, TouchY) as the first abscissa InputX.
For the calculation of the first vertical coordinate InputY, it needs to be judged whether the sum of the vertical coordinate ViewY, the height information ViewH of the input frame, the preset height InputH of the soft input method and the preset spacing distance in the first coordinate information (ViewX, ViewY) is greater than the screen resolution height of the all-in-one machine device; if the first coordinate information is larger than the second coordinate information, sequentially subtracting the preset height InputH of the soft input method and the calculation of the preset spacing distance from the vertical coordinate ViewY of the first coordinate information (ViewX, ViewY) to obtain a first vertical coordinate InputY, and constructing a coordinate system by taking any one point of any two vertexes of a frame on a screen of the all-in-one machine equipment as an origin; and sequentially subtracting the height information ViewH of the input frame and the calculation of the preset spacing distance from the vertical coordinate ViewY in the first coordinate information (ViewX, ViewY) to obtain a first vertical coordinate InputY, and constructing a coordinate system by taking any one point in any two vertexes of the lower frame of the screen of the all-in-one machine equipment as an origin.
If the coordinate is smaller than or equal to the preset coordinate, adding the vertical coordinate ViewY in the first coordinate information (ViewX, ViewY), the height information ViewH of the input frame and the preset spacing distance to obtain a first vertical coordinate InputY, and constructing a coordinate system by taking any one point in any two vertexes of a frame on a screen of the all-in-one machine equipment as an origin; or, the first vertical coordinate InputY is obtained by calculating the sum of the vertical coordinate ViewY in the first coordinate information (ViewX, ViewY), the preset height InputH of the soft input method and the preset spacing distance, and when a coordinate system is constructed by taking any one point in any two vertexes of the lower frame of the screen of the all-in-one machine device as an origin.
The predetermined separation distance is generally one sixth of the screen resolution height of the all-in-one machine device.
S14: judging whether the ordinate in the second coordinate information meets a preset condition or not;
in the specific implementation process of the invention, the preset condition is that the abscissa in the second coordinate information is greater than or equal to 0 and the height of the ordinate of the second coordinate information plus the preset height of the soft input method is less than or equal to the height of the screen; and matching the ordinate in the second coordinate information with the known condition to judge whether the ordinate in the second coordinate information meets the preset condition.
S15: if so, adjusting and displaying on the screen of the all-in-one machine based on the second coordinate information and the preset width and the preset height of the soft input method;
in the specific implementation process of the invention, if the preset conditions are met, the all-in-one machine equipment adjusts and displays on the screen of the all-in-one machine equipment according to the second coordinate information and the preset width and the preset height of the soft input method.
S16: and if the vertical coordinate in the second coordinate information does not meet the preset condition, adjusting the second coordinate information according to a preset adjustment rule, and adjusting and displaying on the screen of the all-in-one machine after the adjustment is finished.
If the vertical coordinate in the second coordinate information is judged not to meet the preset condition, adjusting the second coordinate information according to a preset adjustment rule, and adjusting and displaying on the screen of the all-in-one machine after the adjustment is finished; the preset adjustment rule comprises the following steps: averagely dividing the large screen of the all-in-one machine equipment into six areas; determining positions of the click coordinate point information in six areas; if the clicked coordinate point information falls in the upper left area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of the top left vertex of the soft input method to be 0 in abscissa and the height of the divided area in ordinate; if the clicked coordinate point information falls in the upper right area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of the top left corner vertex of the soft input method to the abscissa which is the width of the screen minus the preset width of the soft input method, and the ordinate which is the height of the divided area; if the clicked coordinate point information falls in the large screen middle area of the all-in-one machine equipment, adjusting second coordinate information of the top left corner vertex of the soft input method to be 0 on the abscissa, and adjusting the ordinate to be twice the height of the divided areas; if the clicked coordinate point information falls in the large screen middle right area of the all-in-one machine equipment, adjusting second coordinate information of a top left corner vertex of the soft input method to be that an abscissa is the width of the screen minus a preset width of the soft input method, and an ordinate is twice the height of the divided areas; if the clicked coordinate point information falls in the left lower area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of a top left corner vertex of the soft input method to be 0 in abscissa and adjusting the ordinate to be the height of the divided area; if the clicked coordinate point information falls in the right lower area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of the top left corner vertex of the soft input method to the point that the abscissa is the width of the screen minus the preset width of the soft input method, and the ordinate is the height of the divided area; the large screen of the all-in-one machine equipment is averagely divided into six areas, the width of each area is one half of the width of the screen, and the height of each area is one third of the height of the screen.
Specifically, the preset adjustment rule is as follows: referring to fig. 4, the large screen of the all-in-one machine device is averagely divided into six regions, and fig. 4 is a schematic diagram of averagely dividing the large screen of the all-in-one machine device into six regions in the embodiment of the present invention.
For this case, the whole screen is divided into 6 areas on average, and since the area 1 and the area 2 require high raising hands, the input experience is generally considered to be poor, so the default display position of the soft input method will not appear in the area 1 and the area 2.
The screen resolution width = ScreenWidth; high screen resolution = screen height
The divided region width RegionW = Screen Width/2, and the divided region height RegionH = Screen height/3; that is, in the region 1, in the display position of the soft input method, in the click coordinate point information (TouchX, TouchY): InputX = 0, InputY = RegionH, if click coordinate point information (TouchX, TouchY) is in region 2, the display position of the soft input method: InputX = ScreenWidth-InputW; InputY = RegionH, if click coordinate point information (TouchX, TouchY) is in region 3, the display position of the soft input method: InputX = 0; InputY = RegionH 2; if the click coordinate point information (TouchX, TouchY) is in area 4, the display position of the soft input method: InputX = ScreenWidth-InputW; input y = region h × 2, if click coordinate point information (TouchX, TouchY) is in region 5, the display position of the soft input method: InputX = 0; InputY = region h; if the click coordinate point information (TouchX, TouchY) is in area 6, the display position of the soft input method: InputX = ScreenWidth-InputW; InputY = region h.
In the embodiment of the invention, when the user performs input operation on the large-screen all-in-one machine, the position most suitable for the user to input is selected to call the soft input method, so that friendly user input experience is obtained.
Examples
Referring to fig. 2, fig. 2 is a schematic structural composition diagram of a soft input method position adjustment device applied to a large-screen all-in-one machine in the embodiment of the present invention.
As shown in fig. 2, a soft input method position adjustment device applied to a large-screen all-in-one machine, the device includes:
the first obtaining module 21: the method comprises the steps that when a user clicks an input box on all-in-one machine equipment to call a soft input method, click coordinate point information of the user clicking the input box is obtained;
in the specific implementation process of the invention, the all-in-one machine equipment is large-screen all-in-one machine equipment for education, when in application, a user (generally a teacher) needs to click an input box with a hand or a writing pen to call a soft input method when inputting corresponding information on a screen, and when the user clicks the input box, click coordinate information (touch X, touch Y) of the position of the clicked input box is read through an algorithm built in the all-in-one machine.
The second obtaining module 22: the first coordinate information of the upper left corner of the input box and the height information of the input box are obtained;
in the specific implementation process of the invention, the position and the size of the input box displayed on the all-in-one machine equipment are preset, and the first coordinate information (ViewX, ViewY) of the upper left corner in the input box, the width information ViewW of the input box, the height information ViewH of the input box and the like can be obtained through reading of a corresponding algorithm or program.
The calculation module 23: the second coordinate information of the top left corner vertex of the soft input method is obtained through calculation based on the click coordinate point information, the first coordinate information and the height information of the input box;
in a specific implementation process of the present invention, the calculating and obtaining second coordinate information of a vertex at an upper left corner of the soft input method based on the click coordinate point information, the first coordinate information, and the height information of the input box includes: calculating to obtain a first abscissa based on the abscissa in the click coordinate point information and the preset width of the soft input method; calculating to obtain a first vertical coordinate based on the vertical coordinate in the first coordinate information, the height information of the input frame, the preset height of the soft input method and the preset spacing distance; and forming second coordinate information of the vertex at the upper left corner of the soft input method based on the first horizontal coordinate and the first vertical coordinate.
Further, the calculating to obtain the first abscissa based on the abscissa in the click coordinate point information and the preset width of the soft input method includes: judging whether the sum of the abscissa in the click coordinate point information and the preset width of the soft input method is larger than the screen resolution width of the all-in-one machine equipment or not; if so, subtracting the preset width of the soft input method from the screen resolution width of the all-in-one machine equipment to calculate to obtain a first abscissa; and if not, directly taking the abscissa in the click coordinate point information as the first abscissa.
Further, the obtaining of the first ordinate through calculation based on the ordinate in the first coordinate information, the height information of the input box, the preset height of the soft input method, and the preset spacing distance includes: judging whether the sum of the vertical coordinate in the first coordinate information, the height information of the input frame, the preset height of the soft input method and the preset spacing distance is larger than the screen resolution height of the all-in-one machine equipment or not; if so, calculating by sequentially subtracting the preset height of the soft input method and the preset spacing distance from the vertical coordinate in the first coordinate information to obtain a first vertical coordinate, and constructing a coordinate system by taking any one point in any two vertexes of a frame on a screen of the all-in-one machine equipment as an origin; or sequentially subtracting the height information of the input frame and the calculation of the preset spacing distance from the vertical coordinate in the first coordinate information to obtain a first vertical coordinate, and constructing a coordinate system by taking any one point in any two vertexes of the lower frame of the screen of the all-in-one machine equipment as an origin; if not, calculating the sum of the vertical coordinate in the first coordinate information, the height information of the input frame and the preset spacing distance to obtain a first vertical coordinate, and when an arbitrary point in any two vertexes of a frame on a screen of the all-in-one machine equipment is used as an origin to construct a coordinate system; or, the first ordinate is obtained by calculating the sum of the ordinate in the first coordinate information, the preset height of the soft input method and the preset spacing distance, and when a coordinate system is constructed by taking any one point of any two vertexes of a lower frame of a screen of the all-in-one machine device as an origin.
Furthermore, the preset spacing distance is one sixth of the screen resolution height of the all-in-one machine equipment.
Specifically, the android system soft input method pops up a flow, EditText inherits TextView, when a user clicks an input box, the user requests to call out the soft input method, and the InputMethodManager performs focus detection on the input box to determine whether the user continues to call out the soft input method; in the embodiment of the invention, adding the absolute coordinate value of View in the transmitted EditorInfo, namely the first coordinate information (View x, View y), the width (View w, View h) and the absolute coordinate value (TouchX, TouchY) of the user click event; using the data to adjust the position of the soft input method; if the automatically adjusted position still cannot meet the habit of the user, the user can perform manual dragging for adjustment.
In general, the coordinate system may be established by using any one of four corners of the screen of the all-in-one machine as an origin, or by using any one point of the screen of the all-in-one machine as the origin; in the embodiment of the invention, the embodiment is given in which any one of four corners of a screen of the all-in-one machine is taken as an origin, and coordinate points in a coordinate system take positive values; and in the present invention, the width of the screen generally refers to the screen resolution width; screen height generally refers to screen resolution height.
The default display position calculation method of the soft input method is defined as follows: the screen resolution width = ScreenWidth; screen resolution is high = ScreenHeight; distance (preset spacing) = ScreenHeight/6; the Distance is 1/6 size of the screen, the value is fixed, and can be adjusted according to the requirement of a client, mainly aiming at adjusting the input method to the most suitable position of a person, and the Distance is found to be the optimal value through experiments; the width of the soft input method represents InputW, and the height of the soft input method represents InputH; second coordinate information of the top left vertex of the Soft input method (InputX, InputY)
For calculation of the InputX, firstly, judging whether the sum of an abscissa TouchX in click coordinate point information (TouchX, TouchY) and a preset width InputW of a soft input method is larger than a screen resolution width ScreenWidth of the all-in-one machine equipment or not; when the resolution ratio is larger than the preset width, the screen resolution ratio width ScreenWidth of the all-in-one machine equipment is subtracted by the preset width InputW of the soft input method to obtain a first horizontal coordinate InputX; and when the value is less than the first value, directly taking the abscissa TouchX in the click coordinate point information (TouchX, TouchY) as the first abscissa InputX.
For the calculation of the first vertical coordinate InputY, it needs to be judged whether the sum of the vertical coordinate ViewY, the height information ViewH of the input frame, the preset height InputH of the soft input method and the preset spacing distance in the first coordinate information (ViewX, ViewY) is greater than the screen resolution height of the all-in-one machine device; if the first coordinate information is larger than the second coordinate information, sequentially subtracting the preset height InputH of the soft input method and the calculation of the preset spacing distance from the vertical coordinate ViewY of the first coordinate information (ViewX, ViewY) to obtain a first vertical coordinate InputY, and constructing a coordinate system by taking any one point of any two vertexes of a frame on a screen of the all-in-one machine equipment as an origin; and sequentially subtracting the height information ViewH of the input frame and the calculation of the preset spacing distance from the vertical coordinate ViewY in the first coordinate information (ViewX, ViewY) to obtain a first vertical coordinate InputY, and constructing a coordinate system by taking any one point in any two vertexes of the lower frame of the screen of the all-in-one machine equipment as an origin.
If the coordinate is smaller than or equal to the preset coordinate, adding the vertical coordinate ViewY in the first coordinate information (ViewX, ViewY), the height information ViewH of the input frame and the preset spacing distance to obtain a first vertical coordinate InputY, and constructing a coordinate system by taking any one point in any two vertexes of a frame on a screen of the all-in-one machine equipment as an origin; or, the first vertical coordinate InputY is obtained by calculating the sum of the vertical coordinate ViewY in the first coordinate information (ViewX, ViewY), the preset height InputH of the soft input method and the preset spacing distance, and when a coordinate system is constructed by taking any one point in any two vertexes of the lower frame of the screen of the all-in-one machine device as an origin.
The predetermined separation distance is generally one sixth of the screen resolution height of the all-in-one machine device.
The judging module 24: the second coordinate information is used for judging whether the vertical coordinate in the second coordinate information meets a preset condition or not;
in the specific implementation process of the invention, the preset condition is that the abscissa in the second coordinate information is greater than or equal to 0 and the height of the ordinate of the second coordinate information plus the preset height of the soft input method is less than or equal to the height of the screen; and matching the ordinate in the second coordinate information with the known condition to judge whether the ordinate in the second coordinate information meets the preset condition.
Adjusting the display module 25: the display device is used for adjusting and displaying on the screen of the all-in-one machine based on the second coordinate information and the preset width and the preset height of the soft input method when the vertical coordinate in the second coordinate information is judged to meet the preset condition;
in the specific implementation process of the invention, if the preset conditions are met, the all-in-one machine equipment adjusts and displays on the screen of the all-in-one machine equipment according to the second coordinate information and the preset width and the preset height of the soft input method.
Adjusting the display module 26: and the display device is also used for adjusting the second coordinate information according to a preset adjustment rule if the vertical coordinate in the second coordinate information is judged not to meet the preset condition, and adjusting and displaying on the screen of the all-in-one machine after the adjustment is finished.
If the vertical coordinate in the second coordinate information is judged not to meet the preset condition, adjusting the second coordinate information according to a preset adjustment rule, and adjusting and displaying on the screen of the all-in-one machine after the adjustment is finished; the preset adjustment rule comprises the following steps: averagely dividing the large screen of the all-in-one machine equipment into six areas; determining positions of the click coordinate point information in six areas; if the clicked coordinate point information falls in the upper left area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of the top left vertex of the soft input method to be 0 in abscissa and the height of the divided area in ordinate; if the clicked coordinate point information falls in the upper right area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of the top left corner vertex of the soft input method to the abscissa which is the width of the screen minus the preset width of the soft input method, and the ordinate which is the height of the divided area; if the clicked coordinate point information falls in the large screen middle area of the all-in-one machine equipment, adjusting second coordinate information of the top left corner vertex of the soft input method to be 0 on the abscissa, and adjusting the ordinate to be twice the height of the divided areas; if the clicked coordinate point information falls in the large screen middle right area of the all-in-one machine equipment, adjusting second coordinate information of a top left corner vertex of the soft input method to be that an abscissa is the width of the screen minus a preset width of the soft input method, and an ordinate is twice the height of the divided areas; if the clicked coordinate point information falls in the left lower area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of a top left corner vertex of the soft input method to be 0 in abscissa and adjusting the ordinate to be the height of the divided area; if the clicked coordinate point information falls in the right lower area of the large screen of the all-in-one machine equipment, adjusting second coordinate information of the top left corner vertex of the soft input method to the point that the abscissa is the width of the screen minus the preset width of the soft input method, and the ordinate is the height of the divided area; the large screen of the all-in-one machine equipment is averagely divided into six areas, the width of each area is one half of the width of the screen, and the height of each area is one third of the height of the screen.
Specifically, the preset adjustment rule is as follows: referring to fig. 4, the large screen of the all-in-one machine device is averagely divided into six regions, and fig. 4 is a schematic diagram of averagely dividing the large screen of the all-in-one machine device into six regions in the embodiment of the present invention.
For this case, the whole screen is divided into 6 areas on average, and since the area 1 and the area 2 require high raising hands, the input experience is generally considered to be poor, so the default display position of the soft input method will not appear in the area 1 and the area 2.
The screen resolution width = ScreenWidth; high screen resolution = screen height
The divided region width RegionW = Screen Width/2, and the divided region height RegionH = Screen height/3; that is, in the region 1, in the display position of the soft input method, in the click coordinate point information (TouchX, TouchY): InputX = 0, InputY = RegionH, if click coordinate point information (TouchX, TouchY) is in region 2, the display position of the soft input method: InputX = ScreenWidth-InputW; InputY = RegionH, if click coordinate point information (TouchX, TouchY) is in region 3, the display position of the soft input method: InputX = 0; InputY = RegionH 2; if the click coordinate point information (TouchX, TouchY) is in area 4, the display position of the soft input method: InputX = ScreenWidth-InputW; input y = region h × 2, if click coordinate point information (TouchX, TouchY) is in region 5, the display position of the soft input method: InputX = 0; InputY = region h; if the click coordinate point information (TouchX, TouchY) is in area 6, the display position of the soft input method: InputX = ScreenWidth-InputW; InputY = region h.
In the embodiment of the invention, when the user performs input operation on the large-screen all-in-one machine, the position most suitable for the user to input is selected to call the soft input method, so that friendly user input experience is obtained.
The computer-readable storage medium stores thereon a computer program, and when the computer program is executed by a processor, the computer program implements the position adjustment method of the soft input method according to any one of the embodiments. The computer-readable storage medium includes, but is not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks, ROMs (Read-Only memories), RAMs (Random AcceSS memories), EPROMs (EraSable Programmable Read-Only memories), EEPROMs (Electrically EraSable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards. That is, a storage device includes any medium that stores or transmits information in a form readable by a device (e.g., a computer, a cellular phone), and may be a read-only memory, a magnetic or optical disk, or the like.
The embodiment of the invention also provides a computer application program which runs on a computer and is used for executing the soft input method position adjusting method of any one of the above embodiments.
In addition, fig. 3 is a schematic structural composition diagram of the large-screen all-in-one machine in the embodiment of the present invention.
The embodiment of the invention also provides a large-screen all-in-one machine, which is shown in figure 3. The large-screen all-in-one machine comprises a processor 302, a memory 303, an input unit 304, a display unit 305 and the like. Those skilled in the art will appreciate that the device configuration means shown in fig. 3 do not constitute a limitation of all devices and may include more or less components than those shown, or some components in combination. The memory 303 may be used to store the application 301 and various functional modules, and the processor 302 executes the application 301 stored in the memory 303, thereby performing various functional applications of the device and data processing. The memory may be internal or external memory, or include both internal and external memory. The memory may comprise read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), flash memory, or random access memory. The external memory may include a hard disk, a floppy disk, a ZIP disk, a usb-disk, a magnetic tape, etc. The disclosed memory includes, but is not limited to, these types of memory. The disclosed memory is by way of example only and not by way of limitation.
The input unit 304 is used for receiving input of signals and receiving keywords input by a user. The input unit 304 may include a touch panel and other input devices. The touch panel can collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel by using any suitable object or accessory such as a finger, a stylus and the like) and drive the corresponding connecting device according to a preset program; other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., play control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like. The display unit 305 may be used to display information input by a user or information provided to the user and various menus of the terminal device. The display unit 305 may take the form of a liquid crystal display, an organic light emitting diode, or the like. The processor 302 is a control center of the terminal device, connects various parts of the entire device using various interfaces and lines, and performs various functions and processes data by operating or executing software programs and/or modules stored in the memory 302 and calling data stored in the memory.
As an embodiment, the large screen all-in-one machine comprises: one or more processors 302, a memory 303, and one or more applications 301, wherein the one or more applications 301 are stored in the memory 303 and configured to be executed by the one or more processors 302, and wherein the one or more applications 301 are configured to perform the soft input method position adjustment method in any of the above embodiments.
In the embodiment of the invention, when the user performs input operation on the large-screen all-in-one machine, the position most suitable for the user to input is selected to call the soft input method, so that friendly user input experience is obtained.
In addition, the method, the device, the storage medium and the large-screen all-in-one machine for adjusting the position of the soft input method applied to the large-screen all-in-one machine provided by the embodiment of the present invention are described in detail above, a specific example should be adopted herein to explain the principle and the implementation manner of the present invention, and the description of the above embodiment is only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.