• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Adjusting sound volume with keyboard shortcuts on 68k Macs

Phipli

Well-known member
Awesome feedback thanks, clearly I have some debugging to do …. @MindWalker I think I know what’s causing that, double checking are you running with 256 colors by chance?

@BadGoldEagle what System version are you running here?
Not sure if it is pertinent, but looking at @BadGoldEagle's screenshot, as well as the language, is the font size on file names non-standard? What other UI tweaks are there?

<Edit>
I can see Power Windows for a start.
</Edit>

The finder view setting doesn't quite look... normal... either, but then I'm a creature if habit and might just not be used to options I don't use.
 
Last edited:

MindWalker

Well-known member
@MindWalker I think I know what’s causing that, double checking are you running with 256 colors by chance? I just realized I accidentally hardcoded my offscreen pixmap that saves the “underneath” pixels to a fixed 8 bits, ooops

I am actually running in 16 colors (faster on my IIcx). I just tested that in 256 color mode it works correctly, the white area/color mess happens in all other modes (b&w, 4, 16 colors).
 

Crutch

Well-known member
Great, thanks @MindWalker - that’s what I expected once I realized I hard coded 8 bit mode, oops. Already have a fix, will share here soon.
 

BadGoldEagle

Well-known member
Not sure if it is pertinent, but looking at @BadGoldEagle's screenshot, as well as the language, is the font size on file names non-standard? What other UI tweaks are there?

<Edit>
I can see Power Windows for a start.
</Edit>

The finder view setting doesn't quite look... normal... either, but then I'm a creature if habit and might just not be used to options I don't use.
Correct! I also have LiteSwitch (pretty awesome... allows you to switch between apps with Cmd-Tab) but it was not the issue.

My problem was caused by Apple's Photo CD Access extension. Once removed it works fine in Basilisk. Again, I'll have to try on a real Mac soon to verify that! @Crutch Do you have it on your development system?

Edit: If it helps I am running F-7.5.1 and I do not hear the beep before it crashes with the extension enabled.
 

Attachments

  • CD_Access.img.zip
    86 KB · Views: 1

rjkucia

Well-known member
Tested this on my SE/30, and other than the leftover "white area" mentioned earlier, it works great! Even as-is, I plan on keeping this installed and training my muscle memory on the shortcuts. Way more convenient than even the Control Strip!
 

BadGoldEagle

Well-known member
@Crutch The CD Access bug is not present on real hardware. No idea why it causes Basilisk to crash with that extension enabled. I use the same HD image...

Looking forward to the next version! Hopefully with the White Box fix and (?) with adjustable keyboard shortcuts, as using it with anything but a QWERTY Layout is a bit tricky. But who am I to complain?
 
Last edited:

Crutch

Well-known member
@BadGoldEagle it will take me a little time probably to add adjustable keyboard shortcuts - meantime is there a particular shortcut you prefer? I can hard code it any way you like for now. Call it a custom job. :)
 

BadGoldEagle

Well-known member
The thing is, I don't think there is a particular setup that makes sense for all non-AINSI users.

I am familiar with three layouts: QWERTZ (German), AZERTY (French) and to get out of a pickle when for example the tilde key is hardcoded to some function (console for example), the US AINSI Layout.

Out of the three, none use the same keys for + and - ... and I just realized that + and - are sometimes (Extended vs Standard) switched around on the numeric keypad, so this couldn't be used reliably either.

tl;dr: Is there a way to hard code the key positions instead of using the associated character?
e.g. The one to the left of backspace for volume up and the one to its left for volume down.


Edit: Tried it out again with the AZERTY Keyboard with the French layout selected in the keyboard preferences. You cannot turn the volume up without the keypad (and then there is a noticeable delay, approx 1 second before it registers it) as "=" can only be typed without pressing the shift key, "shift equal" is a plus ;) Key positions would alleviate all those issues.
 
Last edited:

Phipli

Well-known member
The thing is, I don't think there is a particular setup that makes sense for all non-AINSI users.

I am familiar with three layouts: QWERTZ (German), AZERTY (French) and to get out of a pickle when for example the tilde key is hardcoded to some function (console for example), the US AINSI Layout.

Out of the three, none use the same keys for + and - ... and I just realized that + and - are sometimes (Extended vs Standard) switched around on the numeric keypad, so this couldn't be used reliably either.

tl;dr: Is there a way to hard code the key positions instead of using the associated character?
e.g. The one to the left of backspace for volume up and the one to its left for volume down.


Edit: Tried it out again with the AZERTY Keyboard with the French layout selected in the keyboard preferences. You cannot turn the volume up without the keypad (and then there is a noticeable delay, approx 1 second before it registers it) as "=" can only be typed without pressing the shift key, "shift equal" is a plus ;) Key positions would alleviate all those issues.
I don't think key positions are inherently known. I think you'd have to look at the set keyboard language and use a lookup matrix which would need to be manually created for every combination. Key codes is much more usual.

Edit - whoops, just looked at the keycodes for other languages and their location based 🤣
 

sfiera

Well-known member
I would enjoy trying to make that happen, I am certain it’s possible, and will commit to do it quickly if someone would ship me a loaner AAK in Chicago USA for prompt return once this is done. :)
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
 

Crutch

Well-known member
I will make the key choices customizable shortly … meanwhile this version should I think fix the dumb graphics artifacts I introduced by being lazy: please let me know if it doesn’t.
 

Attachments

  • Volumator.bin
    16 KB · Views: 3

Crutch

Well-known member
Oops uploaded the wrong version above - will fix shortly, if a mod stumbles on this please delete my most recent post & attachment ….
 

Crutch

Well-known member
OK sorry about that, this is the right file and should work at any bit depth.
 

Attachments

  • Volumator.bin
    18 KB · Views: 7

MindWalker

Well-known member
No graphic artefacts anymore, works great! :)

I was playing TetrisMax and tried adjusting volume while playing. The top-bar blinked everytime I changed volume (I thought it did that only at minimum level) and while the bar-graph showed zero volume, the game music still kept playing (very quietly). This might of course be that the game is over-riding the system volume.
 

Crutch

Well-known member
Yeah this happened in my testing (also in a game … Solarian II). Would you mind trying again and confirming that the system volume (in the Control Panel) is indeed set to 0 when you exit Tetris Max (great game btw)? I think what is happening unfortunately is some (maybe older, mainly) games are using the Sound Manager or perhaps even old Sound Driver calls in a way that doesn’t respect the system volume setting. (What I am — and I think the Control Panel too — actually setting is the default device output volume. There is nothing that prevents any given app from changing the volume itself, I suspect this mainly happens with games.)
 

MindWalker

Well-known member
Yes TetrisMax is great :D (Unfortunately slightly buggy, if paused at any point I find it sometimes causing the system to freeze)

I just tested and yes it's just as you said; going to min. volume with Volumator the game still plays music and once quit the system volume slider is at minimum.

Yeah it's probably issue with some games (I remember that Lode Runner would also randomly set the volume during gameplay).
 

Crutch

Well-known member
Update: I was able to get an AAK on eBay for $49 shipped so will try to make this work with the volume keys as soon as it arrives. Configurable key choices are in the works too, but I got distracted just making the error handling routines, which nobody but me will ever see or look at, ridiculously robust and generalizable, as one does …
 

cheesestraws

Well-known member
which nobody but me will ever see or look at, ridiculously robust and generalizable, as one does …

If you ever make this open source I promise you I will go and admire your error handling :) (it's one of the bits of codebases I often read looking for tips or tricks for doing things better...)
 
Top