API Reference for Enthought Tool Suite 3.2.0

Creates a key specification to facilitate tools interacting with the keyboard. A tool can declare either a class attribute:

magic_key = KeySpec("Right", "control")

or a trait:

magic_key = Instance(KeySpec, args=("Right", "control"))

and then check to see if the key was pressed by calling:

if self.magic_key.match(event):
    # do stuff...

The names of the keys come from Enable, so both examples above are specifying the user pressing Ctrl + Right_arrow.

Method summary

Methods

© Copyright 2002-2009 Enthought, Inc.