About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.
Fri Jun 23, 2017 12:10 am
As many of you may know, old Macs used to have a Power Button on their keyboards (at least until the iMac came around) that turned off the system. I know that I can configure the Power button to work in both Basilisk II and SheepShaver (cause someone said it made it work) so I looked at the BasiliskII_keycodes file, but I can't figure the file out. Just a bunch of numbers and letters that I don't know their meaning. Can someone help me? Why it has to be so damn difficult to get a button working?
Fri Jun 23, 2017 4:19 am
The mac power button is hex code 0x66 -- I'm not sure what this is in the keycodes file, but that should help.
Fri Jun 23, 2017 8:04 pm
Forgot to mention it, the format in the Keycodes file is like this: <SDL scancode> <Mac keycode>
Sat Jun 24, 2017 11:23 am
macplus wrote:old Macs used to have a Power Button on their keyboards (at least until the iMac came around) that turned off the system.
Some older machines needed to be turned off physically after shutdown. If I remember well, pressing the power button while the system was still running would bring up the shutdown/sleep/restart dialog, while ctrl-cmd-opt-power would result in shutdown without dialog.
Sat Jun 24, 2017 12:27 pm
I use a Macally keyboard
that still has the power button:
Ronald P. Regensburg wrote:If I remember well, pressing the power button while the system was still running would bring up the shutdown/sleep/restart dialog, while ctrl-cmd-opt-power would result in shutdown without dialog.
I wasn't aware of the latter. Just tested it and it works as advertised. That is, on Mountain Lion.
Sun Jun 25, 2017 8:02 am
Well, thanks for the info, but that wasn't what I was asking for! Just tell me how to configure the button and that's it. End of story.
Sun Jun 25, 2017 10:42 am
I don't think there is a way to use a power key inside these emulators.
The equivalent of pressing the power key on a real hardware Mac is stopping the emulator.
Stopping the emulator will bring up the restart/shutdown (or restart/sleep/shutdown) dialog.
Stopping the emulator with ctrl-cmd-op pressed will make the emulator shut down without dialog.
Sun Jun 25, 2017 11:59 am
In my case, when pressing the power button the shutdown dialog appears in both, the host macOS and Mac OS in SheepShaver. I use the standard keycodes file provided with SheepShaver.
You could have an AppleScript or LauchDaemon watch the shutdown dialog in your host macOS. (If you use a bash script to start SheepShaver, e.g. for tap networking, you could make the AppleScript start with SheepShaver automatically.) Once the dialog appears the script checks for SheepShaver being the frontmost application. If it is, the script closes the dialog in your host system. (Not the most beautiful solution, but it should work.)
If the dialog does not also appear in SheepShaver in your case (which isn't entirely clear to me from what I read), you could make the script tell SheepShaver to quit in order to trigger the dialog within SheepShaver.
Sun Jun 25, 2017 6:47 pm
macplus wrote:Well, thanks for the info, but that wasn't what I was asking for!
The Macally story was just a detour as part of what Ronald wrote was new to me.
But I tend to need a bit longer until I understand what others really mean. So my last post also seems to have missed the point. Sorry.
What I found in the keycodes file is this:
# Quartz (1:1 translation actually)
127 127 # Power
So the hex code 0x66 mentioned by adespoton seems to translate into 127 for the keycodes file. Is that what you were looking for?
I suppose you're on a Mac. Which key on your keyboard is the one you would like to use as power key for SheepShaver?
Sat Jul 01, 2017 10:30 pm
I'm in a Windows machine. I want to assign the DEL key for it to be the Power button.
Sun Jul 02, 2017 11:23 am
In the "BasiliskII_keycodes" file (for SheepShaver the name should be similar) there are four tables, the last one being titled "Windows". In that last table, scroll to the line
211 117 # Delete
and change 117 to 127, as that is the code for the power key:
211 127 # Delete
Does that make the DEL key work as power key for you?
Sun Jul 02, 2017 8:19 pm
Nope, it does not work.
Sun Jul 02, 2017 9:39 pm
Then I don't know a solution, I'm afraid. This works on a Mac, but I don't know much about Windows.
Maybe there's a Windows tool that could watch your keystrokes when SheepShaver is active and trigger an action to be performed or script to be ran. You could have it tell SheepShaver to quit, as this will make the restart/sleep/shutdown dialog appear in the emulated Mac OS, as Ronald wrote earlier. Maybe there is someone here who could tell you how to do that.
Mon Jul 03, 2017 11:45 pm
Don't worry about it, it was just a lost cause.
Tue Aug 01, 2017 10:37 pm
Just as a followup to this, from someone who is trying to get MacsBug working in Basilisk:
The Mac power key is 0x7f (or 127 in decimal), not 0x66. I am unsure what 0x66 is. Possibly an SDL key code or scan code, perhaps? It's not the power key, though. Only when I mapped something to Mac key 0x7f did MacsBug launch (it runs when Mac-side Command + Power is pressed).
I hope this helps!
Thu Aug 03, 2017 12:15 pm
I remember being able to configure the power button to F15 for build 142 years ago, and it worked, being able to enter MacsBug via Alt-F15. (The incomplete 68k CPU emulation broke instruction stepping in MacsBug, but having a debugger is better than not having one.)
As far as I know, the problem here is an old one, in the key code reader.
I conducted a test using the 2015 build of Basilisk II. I changed the prefs file to use the key codes file, and set the (forward) Delete key to Power (#127). I typed a few characters into a text box and hit Delete in the middle. The result: "." was typed. Some other keys were incorrectly producing number keys.
It appears the bug where bit #7 is ignored is still present in the code, making the right hand side of the keyboard map to the lower keys in the key code file.
Powered by phpBB © phpBB Group.
phpBB Mobile / SEO by Artodia.