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, |
Can you post some code to show how you set up the virtual keyboard?
|
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.
|
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. :confused:). 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. |
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 |
All times are GMT -7. The time now is 03:23 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC