EVRButtonId is always 0(k_EButton_System)
See original GitHub issueWhile I keep runningpollNextEvent(event)
, event.data.controller.button
or EVRButtonId is always zero even though I press different buttons. Am I missing something?
Regarding EVREventType, event.eventType
shows 200 or VREvent_ButtonPress, which seems fine.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
EVRButtonId is always 0(k_EButton_System) #569 - GitHub
While I keep runningPollNextEvent, EVRButtonId (under event's data -> controller -> button) is always zero even though I press different ...
Read more >Enum EVRButtonId | SteamVR Unity Plugin
Enum EVRButtonId. Namespace: Valve.VR. Assembly: Assembly-CSharp.dll. Syntax. public enum EVRButtonId. Fields. Name, Description. k_EButton_A.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is a patch to openvr/init.py (version 1.0.1301) to add pack = 4 to VREvent_t on Linux so that VR controller button press events have correct values for event.data.controller.button that identify which button is pressed. The patch is the same as was done for VRControllerState_t in pyopenvr 1.0.1301. I’ve tested this on CentOS 7 and Ubuntu 18.0.4. I attach the patch as a zip file because GitHub will not accept attachments with suffix .patch.
openvr_linux_button.patch.zip
That’s good to hear!
For a permanent solution we may need to add
_pack_ = 4
to the relevant structs when Linux or OSX. As opposed to the C# here in Python we can just to that and runtime when Linux or OSX, so we don’t need such an elaborate solution using the union like in C#.Judging from the “Terrible Hack” comments in https://github.com/ValveSoftware/openvr/blob/bcac1bfbe2be3c1ff37e4f62b8e412fcdf29248e/headers/openvr_api.cs I think these are
VRControllerState_t
andVREvent_t
.But looking at https://github.com/cmbruns/pyopenvr/blob/1c4fefe/src/translate/openvr_capi.h I see two more structs that are aligned on 4 bytes using
pragma pack
when Linux or OSX:RenderModel_TextureMap_t
andRenderModel_t
.@cmbruns What do you think?