you could set a variable that is true when one is inside or false when outside of the hotspot. Then if the door key is pressed and the value is true you open the door.
here is a link to some code that keeps track of whether you have entered or left a hotspot. it also draws a circle where one of the hotspots is. Look at the code at the end of the post
http://www.worldviz.com/forum/showth...hlight=hotspot
then you could add something like
Code:
def onKeyDown(key):
if key == 'e' and inHotspot == True:
print "open the door"
viz.callback(viz.KEYDOWN_EVENT,onKeyDown)