I have a drive with a button like this but due to my transient state the drive is in storage (I feel like there's a joke to be had there) and I have never researched the button before. What I'm about to say could be completely incorrect.
If I were to guess what was going on, I'd say the drive consisted of three things:
- A USB hub controller
- A USB storage controller
- A simple USB HID device
You can check this with
sudo lshw | less.
The hub and storage device will be as standard as possible so that anything can use them. The HID button might work in Linux without a driver but it won't be connected up to any known event. If it does automatically work, it should have registered a device in
/dev/input/. If that's a case, it's fairly simple to hook an event around it.
If there isn't a device registered automatically, it might be a very non-standard USB device that needs a custom driver for itself. I can't help you past this stage.
In Windows, you would install some software that would likely include the driver for the HID device, add a listener and tie the lot together.