#1
|
|||
|
|||
Question about input from virtual keyboard.
Hi, I run into a problem and need your help.
I created a 3D virtual keyboard that allow users to click on the virtual keys to input information. When user hits the virual "Enter" key, the entered string will be saved in a variable. My applicaiton uses HMD, it's not convenient for user to use the physical keyboard. My problem is, when I use this virtual keyboard in my system, how can I make my program wait (halt) until the virtual "return" key is pressed (just like the viz.input())? I tried to use event, viztask and signal system to do the synchronization, but somehow can't make it work. Please give me some help. Thanks, |
#2
|
|||
|
|||
Can you post some code to show how you set up the virtual keyboard?
|
#3
|
|||
|
|||
If each key is its own node3D object you could use vizact.onpick to call a function that saves your data when the enter object is clicked on.
|
#4
|
|||
|
|||
Quote:
myKeyboard = VRKeyboard() #declare an instance of the class myKeyboard.Show() #make the 3D keyboard appear on the screen #The VR keyboard always faces the viewpoint. User now can use mouse # to click on the keys just like he types on the real keyboard. All the # key values will be saved in a variable: self.inputString # When the "Enter" key is pressed, the vr keyboard is hidden. # I WANT MY PROGRAM TO WAIT HERE UNTIL THE VR KEYBOARD # INPUT FINISHES. That means I want my program to sit here until # the user presses the "Enter" on the virtual keyboard. (I tried to put the VRKeyboard operation in the viz.director(), then use a while statement here to wait for the keyboard input ends. But the while statement freezes the system, including the keyboard input. ). Do we have any way to make the program stops here while still allow user to click the virtual keys, and after "Enter" is clicked, keep on executing the following sentences? #Now I can use the myKeyboard.inputString value to do what I want in the # following sentences. print myKeyboard.inputString #display the user's input from the VR keyboard. |
#5
|
|||
|
|||
Try using viztask to keep track of the flow of your program. You can yield until a signal is sent when your enter node3D is clicked on.
Code:
import viztask s = viztask.Signal() def MyTask(): yield s.wait() #save your data viztask.schedule( MyTask() ) vizact.onpick(enter_node, s.send) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Gps input for viewpoint location? | realvision | Vizard | 3 | 03-19-2008 12:37 PM |
General question and question regarding arrays | dan12345 | Vizard | 1 | 01-15-2008 10:15 AM |
Human FOV and VIrtual FOV | giancamati | Vizard | 0 | 12-14-2006 03:33 AM |
Timer vs. Keyboard input | Wenamun | Vizard | 1 | 01-23-2006 09:04 PM |
problem with input boxes | shai | Vizard | 6 | 08-15-2005 10:51 AM |