WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Keyboard Shorcut (https://forum.worldviz.com/showthread.php?t=4077)

madeinjava 12-15-2011 06:59 AM

Keyboard Shorcut
 
Hi all,

I need to make some keyboard shortcut (instead a single button) into my VR world. Its work fine when only using single button shortcut like this:
...
def onKeyDown(key):
...
if key == 'c':
print 'Hello World!'
...

However I want to assign a standard windows shortcut, like: Ctrl+z, Ctrl+v, or maybe just 2 or 3 button combinations ('a'+'b' button, etc.)etc.
How I can implement this? I tried using:
...
if key == viz.key.allDown(['a','b']):
print 'Hello World!'
...
I tried using anyDown() as well but none of this works.
Any suggestion what should I do? or I made a mistake there?

Thanks alot!

madeinjava 12-20-2011 04:34 AM

Solved! :)
 
Quote:

Originally Posted by madeinjava (Post 13337)
Hi all,

I need to make some keyboard shortcut (instead a single button) into my VR world. Its work fine when only using single button shortcut like this:
...
def onKeyDown(key):
...
if key == 'c':
print 'Hello World!'
...

However I want to assign a standard windows shortcut, like: Ctrl+z, Ctrl+v, or maybe just 2 or 3 button combinations ('a'+'b' button, etc.)etc.
How I can implement this? I tried using:
...
if key == viz.key.allDown(['a','b']):
print 'Hello World!'
...
I tried using anyDown() as well but none of this works.
Any suggestion what should I do? or I made a mistake there?

Thanks alot!

Problem solved!
Basically I need to 'listen' first from keypress (using onKeyDown) and then checks every keyhits on allDown or anyDown function.

Ps. thanks to clevr team for give me the hint :D


All times are GMT -7. The time now is 05:13 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC