How to figure out sending key events? #106
Replies: 2 comments 2 replies
-
Looking at what libspnav does to figure out what to do on the hardware level, is not going to help you. There are too many layers in between. Unfortunately I have not made a HID device myself, not am I familiar with that arduino HID library, so I can't see what you're doing wrong just by looking at the code. If you're sure your report descriptor is correct, try running wireshark to see what gets actually sent over the wire, to check that your firmware doesn't send something incorrect. On second reading you're saying you're emulating a spacemouse pro. I suggest trying some other device like the space explorer instead. The spacemouse pro is one of a few devices which report strange button event numbers, or at least that's how they end up after passing hrough linux evdev, and spacenavd has a special routine to unscramble them. If you're reporting regular sequencial keys (as you should) that routine thinking it's talking to a spacemouse pro will run and scramble them up instead. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your hints in the right direction. I managed to send the proper bits as buttons in https://github.com/AndunHH/spacemouse/releases/tag/v0.6.0 What remains is finding the pins and codes that the windows driver is recognizing for all of the emulated buttons. This we will be found later on. Thanks for the helpful discussion here! |
Beta Was this translation helpful? Give feedback.
-
Hi,
I really love this project as it is the only way to include spacemouses on linux, which I found so far!
I'm working on a DIY spacemouse, similiar to the other topic already discussed here: #74
Our approach is based on four joysticks at an arduino with some keys, which got quite famous in 3d printing community:
open-source-spacemouse-space-mushroom-remix
I tried to get the source code together under proper source code control and opened this repository: https://github.com/AndunHH/spacemouse
We are emulating the wired spacemouse pro, as suggested in #74.
But sending the key events is quite random. ... I'm pretty sure, we mixed the API up, because we don't understand it. ;)
I already tried to get the clue by reading through the source code and came up to https://github.com/FreeSpacenav/libspnav/blob/d98eb8c927ec1f8f588e51e8412042d70a62dcd9/src/spnav.c#L404
But I'm still stuck, because I'm missing the basic concept / data type or enum definitions what needs to be send.
Our approach is obviously lacking some basic understanding! ;)
Can someone get my a link to a proper instruction where I can get some knowledge what the proper interface should be to send different keys without guessing around?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions