• Hello MLAers! We've re-enabled auto-approval for accounts. If you are still waiting on account approval, please check this thread for more information.

Adjusting sound volume with keyboard shortcuts on 68k Macs

For the price of round-trip shipping from Japan you could probably buy your own… But in another thread cheesestraws alerted me to the existence of the ADB Parser tool. Using that I found:
  • The media keys use command $7c (instead of the $2c command used for normal keyboard input)
  • The key codes are:
    • $00: microphone
    • $01: mute
    • $02: volume down
    • $03: volume up
Thanks for this. I think this means the keyboard is using ADB address 0x07 for the audio buttons (0x0C is just the ADB “talk” command byte). Which is interesting, ADB thanks the audio buttons are a totally separate device.

I wonder if it’s always true that audio buttons come in as ADB address 0x07? Or if that’s at least the “original ADB address” one can query using the ADB manager in case the device gets reassigned? More likely I need to check the device handler ID for these keyboards … will try that once the one I got on eBay for $49 shipped arrives sometime soon …
 
Thanks for this. I think this means the keyboard is using ADB address 0x07 for the audio buttons (0x0C is just the ADB “talk” command byte). Which is interesting, ADB thanks the audio buttons are a totally separate device.

@tashtari is probably the person to ask here: I believe they have working media key emulation in one of their PIC projects.
 
The AAK appears to the ADB as two devices, a standard keyboard at address 0x2 (handler ID 0x10) and a special "media keys" device at address 0x7 (handler ID 0x02). The media keys device behaves similarly to a keyboard in its own right except it only has the four keys that @sfiera identified. My writeup on the AAK's media keys is below, let me know if there's any more info I can add to help.

 
Thanks @tashtari that’s extremely helpful. Being new to working with these devices … is the right protocol to check the original device address, or the device handler ID, or both? I assume just checking the ADB address == 0x07 is not sufficient, since if someone had multiple ADB devices connected they could in theory get something else assigned to address 0x07 (though I assume the AAK’s original ADB address could still be verified as 0x07, also why do I keep writing ‘0x07’ instead of just ‘7’?)
 
An ADB device is identified by a combination of its original address (the one it powers up with before any reassignment has taken place) and its original handler ID - the handler ID is only 8 bits, so combining it with the original address multiplies that address space.
 
Excellent thanks! Garden upload coming once I get to 1.0 …. Next version will be a little faster due to saving the ‘speaker’ bitmap in a resource (currently drawn on the fly).
 
Cool! Will check those out. Noting the first one is from 1990, it is likely that it doesn’t work with modern systems or audio devices, since it probably uses the old SetSoundVolume routine which really just controls the level of the system beep.
 
Back
Top