Login  •  Register


The time is now: Sat Dec 16, 2017 2:56 pm

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 1 [ 16 posts ]
Print view Previous topic  |  Next topic
Author Message
PostPosted: Fri Jun 23, 2017 12:10 am 
Offline
Student Driver
User avatar

Joined: Sat Feb 04, 2017 5:12 am
Posts: 17
Location: Argentina
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?

_________________
Compact Macs will rule supreme for all eternity! :twisted:


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Jun 23, 2017 4:19 am 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1864
The mac power button is hex code 0x66 -- I'm not sure what this is in the keycodes file, but that should help.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Jun 23, 2017 8:04 pm 
Offline
Student Driver
User avatar

Joined: Sat Feb 04, 2017 5:12 am
Posts: 17
Location: Argentina
Forgot to mention it, the format in the Keycodes file is like this: <SDL scancode> <Mac keycode>

_________________
Compact Macs will rule supreme for all eternity! :twisted:


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sat Jun 24, 2017 11:23 am 
Offline
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4872
Location: Amsterdam, Netherlands
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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sat Jun 24, 2017 12:27 pm 
Offline
Mac Mechanic

Joined: Wed Apr 10, 2013 9:32 am
Posts: 193
I use a Macally keyboard that still has the power button:
Image

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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Jun 25, 2017 8:02 am 
Offline
Student Driver
User avatar

Joined: Sat Feb 04, 2017 5:12 am
Posts: 17
Location: Argentina
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.

_________________
Compact Macs will rule supreme for all eternity! :twisted:


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Jun 25, 2017 10:42 am 
Offline
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 4872
Location: Amsterdam, Netherlands
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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Jun 25, 2017 11:59 am 
Offline
Mac Mechanic

Joined: Wed Apr 10, 2013 9:32 am
Posts: 193
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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Jun 25, 2017 6:47 pm 
Offline
Mac Mechanic

Joined: Wed Apr 10, 2013 9:32 am
Posts: 193
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:
Code:
# Quartz (1:1 translation actually)
#
sdl Quartz

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?

EDIT:
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?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sat Jul 01, 2017 10:30 pm 
Offline
Student Driver
User avatar

Joined: Sat Feb 04, 2017 5:12 am
Posts: 17
Location: Argentina
I'm in a Windows machine. I want to assign the DEL key for it to be the Power button.

_________________
Compact Macs will rule supreme for all eternity! :twisted:


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Jul 02, 2017 11:23 am 
Offline
Mac Mechanic

Joined: Wed Apr 10, 2013 9:32 am
Posts: 193
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
Code:
211   117   # Delete
and change 117 to 127, as that is the code for the power key:
Code:
211   127   # Delete

Does that make the DEL key work as power key for you?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Jul 02, 2017 8:19 pm 
Offline
Student Driver
User avatar

Joined: Sat Feb 04, 2017 5:12 am
Posts: 17
Location: Argentina
Nope, it does not work.

_________________
Compact Macs will rule supreme for all eternity! :twisted:


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Jul 02, 2017 9:39 pm 
Offline
Mac Mechanic

Joined: Wed Apr 10, 2013 9:32 am
Posts: 193
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.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Jul 03, 2017 11:45 pm 
Offline
Student Driver
User avatar

Joined: Sat Feb 04, 2017 5:12 am
Posts: 17
Location: Argentina
Don't worry about it, it was just a lost cause.

_________________
Compact Macs will rule supreme for all eternity! :twisted:


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Aug 01, 2017 10:37 pm 
Offline
Inquisitive Elf

Joined: Wed Jul 26, 2017 10:50 pm
Posts: 26
Hi all,

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!


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Aug 03, 2017 12:15 pm 
Offline
Tinkerer

Joined: Wed Mar 31, 2010 11:55 pm
Posts: 62
Location: Maine, U.S.
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.


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 16 posts ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group