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'")
Solved! Go to Solution.
Solved by marcus_fritzen. Go to Solution.
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
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
Can't find what you're looking for? Ask the community or share your knowledge.