This is also my preferred approach, but maybe not for those who want to do *everything* in Pd and/or need to write to devices.

joyosc

https://github.com/danomatika/joyosc

> joystick & game controller hid device event to Open Sound Control daemon and associated tools

Cross-platform using SDL2.

On Sep 6, 2022, at 7:07 PM, pd-list-request@lists.iem.at wrote:

Message: 4
Date: Tue, 6 Sep 2022 10:07:09 -0700
From: Daniel Iglesia <daniel.iglesia@gmail.com>
To: Alexandre Torres Porres <porres@gmail.com>
Cc: "Peter P." <peterparker@fastmail.com>, Pd-List
<pd-list@lists.iem.at>
Subject: Re: [PD] Reading/writing a HID device current best practice?
Message-ID:
<CANZ10W0dhw1uDp0hacR7S-fFAZABR+5WL5Wo1LbqoLsWvDY4BQ@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I know this isn't the desired answer, but my strategy (a few years ago, on
Raspberry Pi, haven't tried HID since then) was to launch a python script
to listen for HID messages, then route them via UDP into a local port on
which Pd would listen and consume the messages. I don't recall if I had to
do some message unpacking in the python script or if I could just route the
raw data and unpack everything in Pd.

--------
Dan Wilcox
@danomatika
danomatika.com
robotcowboy.com