This doesn't necessarily work. I've modified the basic keyboard example to just send the "volume down" code alongside "A" every second. I see the As appearing on the screen, but the volume does not decrease.
It's explained on other forums (and in a convoluted way in the USB spec that the scancodes are purely for American keyboard mappings. That is to say, if you have a French keyboard driver installed and you press the Q button on your American keyboard, it will print the "A" character.
I have no doubt that the DigiSpark is sending the keyboard scan code 0x81, but the keyboard driver doesn't necessarily know what to do with that unless the computer has a driver installed which will perform some action when the code is sent.
In the cases where the project works, I suspect it's because the keyboard driver which is installed is coded to adjust the volume when it receives the appropriate scan code.
This doesn't necessarily work. I've modified the basic keyboard example to just send the "volume down" code alongside "A" every second. I see the As appearing on the screen, but the volume does not decrease.
It's explained on other forums (and in a convoluted way in the USB spec that the scancodes are purely for American keyboard mappings. That is to say, if you have a French keyboard driver installed and you press the Q button on your American keyboard, it will print the "A" character.
I have no doubt that the DigiSpark is sending the keyboard scan code 0x81, but the keyboard driver doesn't necessarily know what to do with that unless the computer has a driver installed which will perform some action when the code is sent.
In the cases where the project works, I suspect it's because the keyboard driver which is installed is coded to adjust the volume when it receives the appropriate scan code.