Fehler in der API Documentation vrKey Modifier

Fehler in der API Documentation vrKey Modifier

Anonymous
Not applicable
575 Views
2 Replies
Message 1 of 3

Fehler in der API Documentation vrKey Modifier

Anonymous
Not applicable

Die VRED Python API Documentation gibt für den modifier im Konstruktor des vrKey(key,modifier) falsche Schlüsselwörter an.

 

Laut API sind es die folgenden:

(Key_Alt, Key_Control, Key_Meta and/or Key_Shift)

 

Diese funktionieren nicht, dafür aber diese:

- AltButton

- ControlButton

- ShiftButton

Was auch immer der Key_Meta Button ist, lehne ich mich mal aus dem Fenster und behaupte er heisst so:

- MetaButton (ungetestet)

 

Auch die Kombination der modifier wird nicht, wie durch die API Documentation beschrieben, durch den logischen Operator "or" kombiniert, sondern durch ein "+"

 

Beispiel:

keyK = vrKey(Key_K,ShiftButton+ControlButton)
keyK.connect("print 'Yolo'")

Accepted solutions (1)
576 Views
2 Replies
Replies (2)
Message 2 of 3

marcus_fritzen
Autodesk
Autodesk

Hi Eduardt,

 

thanks for the hint. You are right, when talking about modifier keys you need to use ShiftButton, AltButton, ControlButton and so on. However, the 'logical or' works fine e.g. ShiftButton | ControlButton.

Key_Meta is the Windows Key respectively Cmd Key on macOS. Currently there is no modifier implemented for this key.

We will update the documentation for the next release.

 

Thanks,

Marcus



Marcus Fritzen
Principal Engineer
Message 3 of 3

marcus_fritzen
Autodesk
Autodesk
Accepted solution

I have to correct myself because I simply codied the text and haven't thought about it. It is not a "logical or" it is a "bit-wise or". So, it is not either or, instead it is an accumulation of the modifiers. We will also correct that. Thanks for the tip, Sinje.

 

Cheers,

Marcus



Marcus Fritzen
Principal Engineer