Disclosure of Invention
Aiming at the problems, the invention further improves the virtual keyboard technology in the existing virtual reality scene, and controls the selection mode of keys and the response and function execution process of the selected keys when the virtual keyboard is operated, so that the virtual keyboard is more convenient to operate and more accurate to execute.
The specific technical scheme of the invention is as follows:
a virtual keyboard input method based on virtual reality scene designs the virtual keyboard operation space in a layered manner, takes the bottom surface of the keyboard as a reference surface, and is divided into a selection layer, a locking layer and a triggering layer from far to near according to the distance from the bottom surface of the keyboard; the input method based on the virtual keyboard comprises the following steps:
s1, displaying a virtual keyboard in a virtual reality space;
s2, detecting an operation device, and starting a first response by a key corresponding to the contact position of the operation device when the operation device is detected to reach a selection layer of the virtual keyboard;
s3, judging whether the operation device leaves the selection layer; if the key leaves the selection layer, the key at the contacted position starts a second response, wherein the second response is a reverse operation process of the first response, and the key state of the first response is restored; if the key leaves the selection layer and then continues to downwards reach the locking layer, the key is locked;
s4, judging whether the operating device continuously reaches the trigger layer downwards, and if so, triggering the key; if not, and detecting that the operating device returns to the selection layer, returning to the step S2, and if detecting that the operating device exits from the selection layer, returning to the step S1.
In step S2, if the system activates the first response button instead of the button to be selected by the user, the system may perform reselection by moving in the selection layer. When the operating device is positioned on the selection layer, judging whether the operating device translates on the selection layer, and if the operating device translates to other key positions, starting a second response by the key corresponding to the original position, and starting a first response by the key corresponding to the new position.
When key input is performed, some keys need to be input repeatedly, especially the function keys such as delete key and space key. If each input needs to be operated step by step, the input efficiency is low. Therefore, the invention designs an operation mode of automatic multiple triggering, namely in step S5, after the operation device reaches the triggering layer, the time of staying in the triggering layer is detected at the same time, and if the time exceeds the set time, the key is automatically triggered multiple times. A time interval can be set between the triggers, and key input is performed once every time interval until the operating device is detected to leave the virtual keyboard trigger layer.
The invention also designs a function for preventing the shaking false triggering of the operation device, which specifically comprises the following two schemes:
the first scheme is as follows: and a judging layer is further arranged on one side of the selecting layer, which is far away from the bottom surface of the keyboard, a certain distance is reserved between the judging layer and the selecting layer, and if the operating device is separated from the selecting layer and lifted to the judging layer, the key at the original contact position starts a second response.
The second scheme is as follows: setting a height threshold value on one side of the selection layer far away from the bottom surface of the keyboard, and lifting the operation device upwards after the operation device contacts the selection layer, wherein when the lifting height is smaller than the height threshold value, the system does not react; and when the lifting height is greater than or equal to the height threshold value, starting a second response by the key at the original contact position.
According to the scheme, whether the operation device briefly leaves the selection layer due to shaking is judged by judging the lifting height of the operation device after leaving the selection layer, so that frequent triggering of the first response due to shaking is avoided.
In order to prevent the operation device from triggering a plurality of key responses when contacting the selection layer, the invention selects keys according to the principle of first contact, only selects one key contacted first, sets the reaction time, contacts the other key in the reaction time, and the system does not respond. Ensuring that only one key can be selected at a time and preventing more than two keys from being popped up.
Further, in order to improve the display effect of key triggering, a layer of virtual keyboard is further arranged below the bottom surface of the keyboard, the keys on the virtual keyboard are in one-to-one correspondence with the keys on the bottom surface of the keyboard, if the operation device is detected to reach the triggering layer in the step S5, the keys at the contacted positions and the keys symmetrically arranged below the bottom surface of the keyboard synchronously move towards the bottom surface of the keyboard, and when the two keys are overlapped, a corresponding voice effect is emitted and the corresponding function of the keys is executed.
In the method, the system starts the first response to enable the selected key to be in different states from other unselected keys so as to know whether the key selection identified by the system is correct in advance. The first response may be one or more effects of the corresponding key being raised or enlarged or illuminated.
In the above method, the system starts the second response to restore the selected key to the same state as the other keys. The second response may be one or more of a decrease or a zoom out or a darkening of the corresponding key.
The virtual keyboard input system based on the virtual reality scene comprises an operation device, a virtual keyboard input device and a virtual keyboard input device, wherein the operation device is used for controlling an operation icon to move in a virtual keyboard space and selecting and triggering a virtual key;
the detection module is used for detecting the relative position of the operating device and the virtual keyboard area and sending the relative position to the control module;
the virtual keyboard comprises a virtual keyboard, wherein the bottommost surface displays a keyboard partition and key contents, and the virtual keyboard is divided into a selection layer, a locking layer and a triggering layer from far to near with reference to the bottom surface of the keyboard;
and the control module is used for controlling the response made by the virtual keyboard according to the relative position of the operating device and the virtual keyboard area.
The data detected by the detection module comprises:
whether the distance between the operating device and the virtual keyboard is smaller than a set threshold value or not;
the operating device translates at the level of the virtual keyboard space and at the selection level.
The input system of the invention also comprises a timing module which is used for calculating the stay time of the operating device at the selection layer or the locking layer of the virtual keyboard and sending the stay time to the control module.
The control module controlling the response of the virtual keyboard comprises:
when the distance between the operating device and the virtual keyboard is smaller than a set threshold value, the virtual keyboard area is lightened, and an operating icon is displayed in a virtual reality space;
when the operating device is positioned on the selection layer of the virtual keyboard, controlling a key corresponding to the contact position of the operating device to start a first response;
when the operation device moves in the selection layer, the original position key is controlled to start the second response, and the new position key starts the first response;
when the operating device is positioned on the locking layer of the virtual keyboard, locking a key corresponding to the position;
executing the function of the position key when the operating device is positioned on the triggering layer of the virtual keyboard;
and when the stay time of the operating device on the trigger layer exceeds the set time, executing the functions of the position keys for a plurality of times.
Preferably, the operating device is a hand or hand-worn device.
The invention has the beneficial effects that:
(1) Divide into the multilayer with virtual keyboard space, designed selection layer, locking layer and trigger layer, through the level that detects operating means and locate, just when touching virtual keyboard selection layer, know in advance whether the button of selecting is correct to in time change, lock the button after further pushing down simultaneously, can not change again, until reaching the trigger layer, trigger the button, will trigger button operation substep realization, effectively prevent the button misconnection, and through setting up response effect, make operation process more directly perceived more convenient.
(2) By setting selection principle and reaction time for the virtual keyboard selection layer, only one key can be selected at a time to perform first response, and final input errors caused by popping up a plurality of keys at a time are avoided.
(3) By setting the height threshold value for the virtual keyboard selection layer, the phenomenon that the selection layer is frequently triggered by hand shake is prevented from happening.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
Example 1
The virtual keyboard input system based on the virtual reality scene comprises an operation device 2, a virtual keyboard 4, a detection module 3, a control module 1 and a timing module 5, wherein the operation device 2 can be a hand or hand-worn device, and an operation icon moves in a virtual keyboard space through movement of the operation device, so that virtual keys are selected and triggered. The detection module 3 may be an infrared sensor or a camera for detecting the position of the operating means and sending it to the control module. The bottommost surface of the virtual keyboard 4 displays the keyboard partition and key content, and is divided into a judging layer 6, a selecting layer 7, a locking layer 8 and a triggering layer 9 from far to near by referring to the keyboard bottom surface 10, and the layers are separated by a certain distance. The timing module 5 is used for calculating the stay time of the operating device at the selection layer or the locking layer of the virtual keyboard and sending the stay time to the control module. The control module 1 is used for controlling the response made by the virtual keyboard according to the relative positions of the operating device and the virtual keyboard area.
Example 2
A virtual keyboard input method based on a virtual reality scene, as shown in FIG. 3, comprises the following steps:
s1, initializing a system, and displaying a virtual keyboard in a virtual reality space.
And S2, when the finger is detected to be close to the virtual keyboard (the distance is smaller than the set threshold value), displaying the finger icon in the virtual reality space, reflecting the position of the finger icon in the virtual keyboard area in real time, and simultaneously lighting the keyboard of the finger close area.
And S3, when the finger is detected to reach the selection layer of the virtual keyboard, the key corresponding to the contact position of the finger is vertically lifted and is clung to the finger.
The selection layer determines the selected keys according to the principle of first contact. The key at the first contact position of the finger is lifted, and the key contacted again in a short time cannot respond, so that the effect that only one key can be selected at a time is achieved, and more than two keys are prevented from being popped up at the same time.
The system can be realized by setting the reaction time of the system to be 0.2 seconds, for example, after one key is selected, the next key is selected to be effective only at intervals of more than 0.2 seconds, and the selection made within 0.2 seconds is regarded as invalid operation, so that the system does not respond.
S4, after the finger selects the key at the selection layer, judging whether the finger translates to other key positions, if so, returning to S3, descending the original key, returning to the original position, and lifting and displaying the newly selected key; if the finger does not translate, the next step is entered.
S5, detecting whether the finger leaves the selection layer; if the user leaves the selection layer, lifting the displayed key to descend and return to the original position; if the finger is detected to leave the selection layer and then continuously reach the locking layer downwards, the key is also lowered to the original position, the key is locked at the same time, and other keys cannot be replaced through translation after the key is locked.
S6, detecting whether the finger passes through the locking layer and continuously reaches the triggering layer downwards, if so, triggering the key, inputting information corresponding to the key or executing corresponding functions; if not, returning to the step S3 and reselecting the key after detecting that the finger returns to the selection layer; if the finger is detected to exit the selection layer, the system returns to the initial state.
Example 3
A virtual keyboard input method based on a virtual reality scene comprises the following steps:
s1, initializing a system, and displaying a virtual keyboard in a virtual reality space.
And S2, when the finger is detected to be close to the virtual keyboard (the distance is smaller than the set threshold value), displaying the finger icon in the virtual reality space, reflecting the position of the finger icon in the virtual keyboard area in real time, and simultaneously lighting the keyboard of the finger close area.
And S3, when the finger is detected to reach the selection layer of the virtual keyboard, the key corresponding to the finger contact position is enlarged.
The selection layer determines the selected keys according to the principle of first contact. The key at the first contact position of the finger is enlarged, and the key contacted again in a short time cannot respond, so that the effect that only one key can be selected at a time is achieved, and more than two keys are prevented from being popped up at the same time.
The system can be realized by setting the reaction time of the system to be 0.2 seconds, for example, after one key is selected, the next key is selected to be effective only at intervals of more than 0.2 seconds, and the selection made within 0.2 seconds is regarded as invalid operation, so that the system does not respond.
The system provides for preventing finger jitter from causing frequent triggering of the select layer function. The function is realized by the following scheme:
firstly, designing a judging layer at one side of the virtual keyboard selecting layer far away from the bottom surface of the keyboard at a certain distance, wherein when a finger reaches the judging layer for the first time, the system does not react; when the finger reaches the selection layer, after the selected key is enlarged, the finger slightly lifts up again, and if the finger does not reach the judgment layer, the system does not react; if the finger exceeds the height of the judging layer, the user considers that the finger leaves the keyboard operation and the key state is restored.
And secondly, setting a height threshold value on one side of the virtual keyboard selection layer far away from the bottom surface of the keyboard, lifting the virtual keyboard after the finger contacts the selection layer, and if the height of the lifting does not exceed the height threshold value, not responding by the system. Only when the height of the finger is raised above the height threshold, the system considers that the finger is to leave the keyboard, and the selected key is restored.
S4, after the finger selects the key at the selection layer, judging whether the finger translates to other key positions, if so, returning to S3, wherein the original key is smaller, and the newly selected key is larger; if the finger does not translate, the next step is entered.
S5, detecting whether the finger leaves the selection layer; if the key leaves the selection layer, the key displayed in a larger size is reduced; if the finger is detected to leave the selection layer and then continuously reach the locking layer downwards, the key is reduced and restored, the key is locked at the same time, and other keys cannot be replaced through translation after the key is locked.
S6, detecting whether the finger passes through the locking layer and continuously reaches the triggering layer downwards, if so, triggering the key, inputting information corresponding to the key or executing corresponding functions; if not, returning to the step S3 and reselecting the key after detecting that the finger returns to the selection layer; if the finger is detected to exit the selection layer, the system returns to the initial state.
S7, after the finger reaches the trigger layer, detecting the stay time of the finger at the trigger layer, setting a time threshold (such as 1 second), and if the time is not exceeded, executing one input; if the set time is exceeded, the system starts to trigger the key operation for a plurality of times, and a time interval is set between the plurality of times of input, for example, after the 2 nd time of input of the key, no finger removal is detected at the interval of 0.1 second, the 3 rd time of input is continued, and after the finger removal is detected, the input is stopped.
For the multi-triggering implementation of step S7, it may also be determined whether to start the multi-triggering by detecting whether the finger continues to press down after touching the triggering layer.
Example 4
A virtual keyboard input method based on virtual reality scene designs the virtual keyboard operation space in a layered manner, takes the bottom surface of the keyboard as a reference surface, and is divided into a selection layer, a locking layer and a triggering layer from far to near according to the distance from the bottom surface of the keyboard; the input method comprises the following steps:
s1, initializing a system, and displaying a virtual keyboard in a virtual reality space.
And S2, when the finger is detected to be close to the virtual keyboard (the distance is smaller than the set threshold value), displaying the finger icon in the virtual reality space, reflecting the position of the finger icon in the virtual keyboard area in real time, and simultaneously lighting the keyboard of the finger close area.
And S3, when the finger is detected to reach the selection layer of the virtual keyboard, the key corresponding to the contact position of the finger is lightened.
The selection layer determines the selected keys according to the principle of first contact. The key at the first contact position of the finger is lightened, and the key contacted again in a short time cannot respond, so that the effect that only one key can be selected at a time is achieved, and more than two keys are prevented from being popped up at the same time.
The system can be realized by setting the reaction time of the system to be 0.2 seconds, for example, after one key is selected, the next key is selected to be effective only at intervals of more than 0.2 seconds, and the selection made within 0.2 seconds is regarded as invalid operation, so that the system does not respond.
The system provides for preventing finger jitter from causing frequent triggering of the select layer function. The function is realized by the following scheme:
firstly, designing a judging layer at one side of the virtual keyboard selecting layer far away from the bottom surface of the keyboard at a certain distance, wherein when a finger reaches the judging layer for the first time, the system does not react; when the finger reaches the selection layer, after the selected key is lightened, the finger slightly lifts up again, and if the finger does not reach the judgment layer, the system does not react; if the finger exceeds the height of the judging layer, the user considers that the finger leaves the keyboard operation and the key state is restored.
And secondly, setting a height threshold value on one side of the virtual keyboard selection layer far away from the bottom surface of the keyboard, lifting the virtual keyboard after the finger contacts the selection layer, and if the height of the lifting does not exceed the height threshold value, not responding by the system. Only when the height of the finger is raised above the height threshold, the system considers that the finger is to leave the keyboard, and the selected key is restored.
S4, after the finger selects the key at the selection layer, judging whether the finger translates to other key positions, if so, returning to S3, darkening the original key, and brightening the reselected new key; if the finger does not translate, the next step is entered.
S5, detecting whether the finger leaves the selection layer; if the user leaves the selection layer, the key which is highlighted is darkened and restored; if the finger is detected to leave the selection layer and then continuously reach the locking layer downwards, the key is darkened and restored, meanwhile, the key is locked, and other keys cannot be replaced through translation after the key is locked.
S6, detecting whether the finger passes through the locking layer and continuously reaches the triggering layer downwards, if so, triggering the key, inputting information corresponding to the key or executing corresponding functions; if not, returning to the step S3 and reselecting the key after detecting that the finger returns to the selection layer; if the finger is detected to exit the selection layer, the system returns to the initial state.
In order to improve the display effect of the triggering keys, a layer of virtual keyboard is arranged below the bottom surface of the keyboard, the keys on the virtual keyboard are in one-to-one correspondence with the keys on the bottom surface of the keyboard, if the operation device is detected to reach the triggering layer, the keys at the contacted positions and the keys symmetrically arranged below the bottom surface of the keyboard synchronously move towards the bottom surface of the keyboard, and when the two keys are overlapped, the corresponding voice effect is sent out, and the corresponding functions of the keys are executed. (as in FIG. 4)
S7, after the finger reaches the trigger layer, detecting the stay time of the finger at the trigger layer, setting a time threshold (such as 1 second), and if the time is not exceeded, executing one input; if the set time is exceeded, the system starts to trigger the key operation for a plurality of times, and a time interval is set between the plurality of times of input, for example, after the 2 nd time of input of the key, no finger removal is detected at the interval of 0.1 second, the 3 rd time of input is continued, and after the finger removal is detected, the input is stopped. When triggering for many times, a certain sound effect can be set to prompt the user.