WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 09-15-2003, 12:38 PM
FlyingWren FlyingWren is offline
Join Date: Mar 2003
Location: Fargo, North Dakota, USA
Posts: 48
Python keycode constants

Is there a list of Python keycode constants available for reference somewhere? Doing an if key == 'c' is easy enough, but it's trickier when you want to use the "weirder" keys like Insert and Delete.

If no one's done it already, we should compile one. I've already had to figure out a few of them already myself, so...
Reply With Quote
Old 09-15-2003, 01:01 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849

Vizard already handles special keys. For example, if you want to check for the insert and delete key being pressed you would do the following:

def onkeydown(key):
    if key == viz.KEY_INSERT:
        print 'Insert key pressed'
    elif key == viz.KEY_DELETE:
        print 'Delete key pressed'
There is a list of all the special keys in the documentation under "User Guide -> Appendix -> Keyboard Codes"

Hope this helps!
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 08:27 PM.

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