Send custom HID values instead of keys
HID is a strange beast to get your head around.
It operates by way of &quot;Report Descriptors&quot;. These are &quot;maps&quot; that lay out what the values you send mean. It's these descriptors that make a keyboard a keyboard and a mouse a mouse.
When you use Keyboard.h you attach a Keyboard report descriptor to the USB HID endpoint, and the computer knows to interpret the data coming in as keypresses. When you use Mouse.h you attach a Mouse report descriptor and the computer knows to interpret the data coming in as mouse movements and button presses.
If you want your computer to ignore the data that you send and allow your own program to be able to receive the raw data instead then you need to use a descriptor that the computer doesn't recognise. In such a case it just ignores the data.
There's a &quot;Raw HID&quot; library for Arduino that does that - it uses a &quot;blank&quot; report descriptor that just gives you a plain 64 byte block of data to do what you want with.
There's a good HID library by Nico Hood that implements the raw mode (as well as others).
For receiving the data on your computer you will have to have your program directly interface with the USB HID system. There's plenty of libraries for most languages to do this for you (hidapi in C / C++, hid in Python, hid4java for Java, etc).