Code Monkey home page Code Monkey logo

Comments (10)

Dreamsorcerer avatar Dreamsorcerer commented on May 27, 2024

You don't need to figure out those details, actually. And the existing mouse filter is not actually a general filter, it fails with most devices I've personally used.

Can you try out the process of updating the sdp_record.xml as described at: #31 (comment)

from bthidhub.

Dreamsorcerer avatar Dreamsorcerer commented on May 27, 2024

Also: #11 (comment)

from bthidhub.

Wheels00 avatar Wheels00 commented on May 27, 2024

Thanks @Dreamsorcerer ! So per your suggestion , I swapped the big long hex number in sdp_record.xml to the one in the report description for my trackball. I think I only have one report id and so I assume there's nothing else to change? (btw, i only want to use a mouse; no keyboard necessary).

The result feels somewhat like progress in that x/y movement is sort of coming through to the host if I use "default" filter, but the moment jumps around all over the place. It's definitely not usable .

So next I will try to get hid-tools running on the host (Windows) as well and if I succeed i'll post the two outputs here. But, if the SDP record is the same and bthidhub is just forwarding the data through to the host, i don't understand where the problem could be.

from bthidhub.

Wheels00 avatar Wheels00 commented on May 27, 2024

ok, i'm struggling to work out how to run hid-tools or similar on Windows. Any tips?

from bthidhub.

Dreamsorcerer avatar Dreamsorcerer commented on May 27, 2024

I've just realised that @ruundii changed the mouse filter code. So my other comment about the mouse filter should be to change the filter code to just:

    def filter_message_to_host(self, msg):
        return b'\xa1\x03' + msg

But, sdp_record.xml was also changed, so not sure if there are other changes needed. I still don't have anything running to retest with the new code.

from bthidhub.

Dreamsorcerer avatar Dreamsorcerer commented on May 27, 2024

ok, i'm struggling to work out how to run hid-tools or similar on Windows. Any tips?

No. I don't use Windows and am only familiar with hid-tools in so far as I have run it to see the output from my own devices. Sorry.

from bthidhub.

Dreamsorcerer avatar Dreamsorcerer commented on May 27, 2024

Download an Ubuntu disk and just boot Ubuntu off a USB drive? You can just test it from there without installing anything on your machine.

from bthidhub.

Wheels00 avatar Wheels00 commented on May 27, 2024

Good idea re: usb drive ubuntu.

from bthidhub.

Wheels00 avatar Wheels00 commented on May 27, 2024

Per @Dreamsorcerer 's excellent suggestion i ran hid-tools from an Ubuntu USB drive.

The difference between the HID events from the mouse directly versus via bthidhub is somewhat illuminating.

Direct:

# ReportID: 1 / Button: 0  0  0  0  0 | # | X:     0 | Y:     0 
#             | Wheel:    0 | AC Pan:    0 | 0x10168:    0 
E: 000000.000000 8 01 00 00 00 00 00 00 00
# ReportID: 1 / Button: 0  0  0  0  0 | # | X:     0 | Y:    -3 
#             | Wheel:    0 | AC Pan:    0 | 0x10168:    0 
E: 000000.159625 8 01 00 00 d0 ff 00 00 00
# ReportID: 1 / Button: 0  0  0  0  0 | # | X:     0 | Y:    -1 
#             | Wheel:    0 | AC Pan:    0 | 0x10168:    0 
E: 000000.163695 8 01 00 00 f0 ff 00 00 00
# ReportID: 1 / Button: 0  0  0  0  0 | # | X:     0 | Y:    -2 
#             | Wheel:    0 | AC Pan:    0 | 0x10168:    0 
E: 000000.175529 8 01 00 00 e0 ff 00 00 00
# ReportID: 1 / Button: 0  0  0  0  0 | # | X:     0 | Y:    -4 
#             | Wheel:    0 | AC Pan:    0 | 0x10168:    0 
E: 000000.179489 8 01 00 00 c0 ff 00 00 00
# ReportID: 1 / Button: 0  0  0  0  0 | # | X:    -2 | Y:    -9 
#             | Wheel:    0 | AC Pan:    0 | 0x10168:    0 
E: 000000.191567 8 01 00 fe 7f ff 00 00 00
# ReportID: 1 / Button: 0  0  0  0  0 | # | X:    -6 | Y:   -12 
#             | Wheel:    0 | AC Pan:    0 | 0x10168:    0 
E: 000000.195507 8 01 00 fa 4f ff 00 00 00

Via bthidhub:

# ReportID: 1 / Button: 1  0  0  0  0 | # | X:   256 | Y:   256 
#             | Wheel:    0 | AC Pan:    0 | 0x10168:    0 
E: 000000.000000 9 01 01 00 01 10 00 00 00 00
# ReportID: 1 / Button: 1  0  0  0  0 | # | X:     0 | Y:  -256 
#             | Wheel:   -1 | AC Pan:    0 | 0x10168:    0 
E: 000001.028618 9 01 01 00 00 f0 ff 00 00 00
# ReportID: 1 / Button: 1  0  0  0  0 | # | X: -1536 | Y:  2047 
#             | Wheel:   -1 | AC Pan:    0 | 0x10168:    0 
E: 000001.079712 9 01 01 00 fa 7f ff 00 00 00
# ReportID: 1 / Button: 1  0  0  0  0 | # | X:  -256 | Y:  -257 
#             | Wheel:   -1 | AC Pan:    0 | 0x10168:    0 
E: 000001.109602 9 01 01 00 ff ef ff 00 00 00
# ReportID: 1 / Button: 1  0  0  0  0 | # | X:  -512 | Y:  -769 
#             | Wheel:   -1 | AC Pan:    0 | 0x10168:    0 
E: 000001.149613 9 01 01 00 fe cf ff 00 00 00
# ReportID: 1 / Button: 1  0  0  0  0 | # | X:  -256 | Y:  -257 
#             | Wheel:   -1 | AC Pan:    0 | 0x10168:    0 
E: 000001.201166 9 01 01 00 ff ef ff 00 00 00
# ReportID: 1 / Button: 1  0  0  0  0 | # | X:  -256 | Y:  -257 
#             | Wheel:   -1 | AC Pan:    0 | 0x10168:    0 
E: 000001.231032 9 01 01 00 ff ef ff 00 00 00
# ReportID: 1 / Button: 1  0  0  0  0 | # | X:     0 | Y:  -256 
#             | Wheel:   -1 | AC Pan:    0 | 0x10168:    0 
E: 000001.268584 9 01 01 00 00 f0 ff 00 00 00

Now i'm no computer scientist, but via bthidhub the x and y coordinates seem to be multiples of 256, which I think must mean that the x and y bytes are 8-bits out of alignment .

So how do I fix that?

from bthidhub.

Dreamsorcerer avatar Dreamsorcerer commented on May 27, 2024

So, I see in the first one:
E: 000000.163695 8 01 00 00 f0 ff 00 00 00
And, in the second one:
E: 000001.028618 9 01 01 00 00 f0 ff 00 00 00

Appears there is an extra 0x01 being added. Have you updated the mouse filter code as I mentioned? Maybe try printing out the msg going through that function to confirm exactly what is happening.

from bthidhub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.