Author Topic: Is it even possible to input/output to a USB HID device from qb64?  (Read 5766 times)

0 Members and 1 Guest are viewing this topic.

Offline doppler

  • Forum Regular
  • Posts: 241
    • View Profile
Re: Is it even possible to input/output to a USB HID device from qb64?
« Reply #15 on: December 03, 2020, 09:14:35 am »
I happen to have one, but it's provided by my employer and I can't really mess with it. I wonder if anyone with one would be able to actually mess with theirs if they use it for actual security purposes.

That's the problem with security FOB's, and the main reason I can't divulge anything.  Companies that use FOB as part of the business control tightly use and distribution.  If you get terminated, the first thing they get from you is the FOB.  They care less about other equipment.

In government the FBI is in charge of security clearances and go "HANDS" on with recover/seizure.  Don't mess with the 3 letter alphabet agencies.  My present boss told about a guy in a agency who got booted one day.  Two agents.  His two arms.  Grab'ed and  speed escorted out of sight.  They do this in high visibility, to show everyone what happens to dodgy people.
 

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Is it even possible to input/output to a USB HID device from qb64?
« Reply #16 on: December 03, 2020, 09:39:51 am »
They have some kind of security fobs online on Amazon but I'm not sure if they would/could be used in the same manner. Oh well. And like you were saying about things being locked down; it would probably be nigh impossible to find documentation on the device to figure out what packets to send. I'm just excited that this topic is gaining attention from Luke and Fellippe. That gives me hope that it could lead to further USB (or even Bluetooth) implementation in QB64's future builds.
« Last Edit: December 03, 2020, 09:46:43 am by SpriggsySpriggs »
Shuwatch!

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Is it even possible to input/output to a USB HID device from qb64?
« Reply #17 on: December 04, 2020, 11:20:29 am »
@doppler

I've made more progress with the HID API but don't have the stuff here to show you. I'm at work and don't have the files. If you were on the Discord you would be able to see some videos I posted last night that showed me decoding packets from the Nintendo Switch Pro Controller using only the HID library. I'm still working on the analog sticks, though. Oh, and it was all through Bluetooth connection to my PC.
Shuwatch!

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Is it even possible to input/output to a USB HID device from qb64?
« Reply #18 on: December 05, 2020, 01:20:19 am »
@doppler

To definitively answer your question.... It is very possible to input/output to a USB HID device from QB64. However, I used Bluetooth. Same concept, just different packets. I figure you probably don't have the controller to test this with but if you look at the code it should at least give you some insight as to what is going on. The code is made with InForm and then merged so it's quite large. Scroll down towards the bottom section for the code I wrote. Below is also a video showing me using the test program I created using the hidapi library.

My source code --->  [ You are not allowed to view this attachment ]  
« Last Edit: December 05, 2020, 01:21:30 am by SpriggsySpriggs »
Shuwatch!

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
    • View Profile
Re: Is it even possible to input/output to a USB HID device from qb64?
« Reply #19 on: December 09, 2020, 03:18:20 pm »
This is an interesting discussion, I am trying to get QB64 to read separate input from 2 or more USB mice plugged into the PC:
To do that would I need to get into device drivers and lower level stuff, or is that just because you're talking about specialized hardware like game controllers? I'm just interested in your standard wired USB optical wheel mouse.