Basilisk II would like to receive keystrokes from any app?

About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
MacJon
Space Cadet
Posts: 3
Joined: Sun Oct 27, 2019 9:48 pm
Location: California

Basilisk II would like to receive keystrokes from any app?

Post by MacJon »

I recently installed MacOS Catalina. When I now open Basilisk II, I get a message that says, "BasiliskII.app would like to receive keystrokes from any application." What exactly does this mean and why would Basilisk want to receive keystrokes from any app?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

All kinds of interactions between applications that would happen silently in earlier OSX/macOS versions are blocked in Catalina until the user allows it. It looks like this is one of those.

Which BasiliskII build do you use in Catalina?
MacJon
Space Cadet
Posts: 3
Joined: Sun Oct 27, 2019 9:48 pm
Location: California

Re: Basilisk II would like to receive keystrokes from any ap

Post by MacJon »

Thank you for the reply. it is Basilisk II 1.0, SDL2 port. Requesting access to keystrokes sounds fishy to me.
MacJon
Space Cadet
Posts: 3
Joined: Sun Oct 27, 2019 9:48 pm
Location: California

Re: Basilisk II would like to receive keystrokes from any ap

Post by MacJon »

Also, when I deny access it seems to function fine.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

"Basilisk II 1.0, SDL2 port" does not identify the build. Please tell us the build date.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Basilisk II would like to receive keystrokes from any ap

Post by emendelson »

That message about receiving keystrokes is standard with BII and SheepShaver in Catalina. You can avoid it by adding the app to System Preferences/Security & Privacy/Privacy/Accessibility. (My prebuilt System761, System755, and MacOS9 apps prompt you do that when you first run them under Catalina.) As you say, you can ignore the prompt, and everything works anyway.

Ronald, this isn't affected by the build - it has something to do with the way BasiliskII and SheepShaver work, but I can't imagine exactly what it might be.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Cat_7 »

Might it have to do with sdl? Perhaps the keycodes file or other sdl input/event monitoring issues?
There is some mentioning of sdl down in this post, but I'm not sure it is related:
https://nvidia.custhelp.com/app/answers ... rent-mouse

Best,
Cat_7
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

I have also been thinking that this could be related to the feature of using raw keycodes and the keycodes file that uses SDL2 to convert keystrokes between different keyboard layouts.
If this is indeed what it is about, anyone using an US-English (or similar) QWERTY keyboard will not notice problems when the prompt is ignored. But someone using for instance an AZERTY keyboard would not be able to use that keyboard to enter text properly.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Cat_7 »

See this remark from the mace page:
https://mace.software/news/

MacOS Catalina support tweaks

As the new macOS Catalina was released recently, it was discovered that there was a unnecessary privilege used by the SDL2: It was listening to background key presses solely to track state of the caps lock key. Luckily, there was already a patch for this issue in SDL 2.0.10, so updating the SDL2 library (and adjusting some caps lock support code) fixed this problem.


Best,
Cat_7
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

Nice find! This is really interesting. It seems that BasiliskII and SheepShaver need to be able to somehow track the state of the Caps Lock key.

Around October 10, we (emendelson and I) both created SheepShaver and BasiliskII builds with SDL2 2.0.10. However, these builds had a serious caps-lock issue: After using the Caps Lock key once, Caps Lock could not be released again. We asked kanjitalk755 to have a look at the issue, but he could not resolve the issue in the BasiliskII and SheepShaver source code. After only a week we replaced our builds with new builds, again with SDL2 2.0.9.

I wonder if ignoring the "keystrokes from any application" message will result in the Caps Lock key not functioning correctly.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Cat_7 »

I guess our builds, when using SDL 2.10, could benefit from the fixes Mace implemented?

Best,
Cat_7
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

Cat_7 wrote:I guess our builds, when using SDL 2.10, could benefit from the fixes Mace implemented?
On the contrary. Apparently the "fixes" in SDL 2.0.10 caused a serious problem in BasiliskII and SheepShaver. See above.
(I suppose you mean 2.0.10, not 2.10.)
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Basilisk II would like to receive keystrokes from any ap

Post by emendelson »

Ronald P. Regensburg wrote:
Cat_7 wrote:I guess our builds, when using SDL 2.10, could benefit from the fixes Mace implemented?
On the contrary. Apparently the "fixes" in SDL 2.0.10 caused a serious problem in BasiliskII and SheepShaver. See above.
(I suppose you mean 2.0.10, not 2.10.)
I think this means that the fixes that Mace implemented to work around the 2.0.10 changes might be applicable to SS and BII. But we can't figure out what those fixes are because source code is not available.

I looked at the SS/BII source code (and I know nothing about how to fix this), and CapsLock works like any other key in video_sdl2.cpp. Possibly, for 2.0.10, when SDL2 is not listening for the CapsLock key, SS/BII needs some added code to do something more when the CapsLock key is pressed? But of course I'm only guessing wildly here.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

I asked kanjitalk755 to have a look at this topic.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Cat_7 »

The link to mace says that when they used SDL they had a keys-related problem. Which went away when they used a recent? SDL 2.0.10 AND fixed some issues in their own code.

Perhaps a PM or a direct mail to could help us see their additional fixes?

Best,
Cat_7
User avatar
Toni_
Space Cadet
Posts: 3
Joined: Fri Sep 06, 2019 7:36 pm

Re: Basilisk II would like to receive keystrokes from any ap

Post by Toni_ »

Hi,

I'm Toni, the guy who is helping Pukka in creation of the M.A.C.E. environment mentioned above. I noticed this discussion earlier, and wanted to share some of the experience with SDL key input, in case it might be helpful for you guys...

So, basically old version of SDL was using "IOHIDManager" to poll keyboard status for the modifier keys, and using that API triggered the permission popup in Catalina. The SDL 2.0.10 fixes this by removing dependency on IOHIDManager. In the new version, SDL monitors caps lock state through "flagsChanged:" selector in "Cocoa_WindowListener" class, which gets triggered by Cocoa each time modifier keys are changed, and the application is active.

However, there was major drawback of this feature, that if caps lock state was switched while application was in background, the new state would not get notified at all. So far the quick workaround we did for this, was for now manually polling the caps lock state on SDL idle events, and generating the caps lock state change manually if caps lock state change would be detected. For that, we used this simple snippet of code:

Code: Select all

SDL_Keymod mods = SDL_GetModState();
if ((mods ^ oldMods) & KMOD_CAPS) { ... /* state changed */ oldMods = mods; }
in the idle loop, and would use (mods & KMOD_CAPS) as only source for the caps lock state. I hope this information might help you guys.
Machines: Plus,II,LCII,C650,PM6100,PowerCenterPro210,iMacG3,G4Cube,iMacC2D 17",MacMiniC2D,PB280c,PBG3,MBP15"/2009,MBP13"/2015,MacPro/2010
M.A.C.E. project (new "Classic"): https://mace.software
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

Thanks, this sounds like useful information. Hopefully kanjitalk755 can use it to make BasiliskII and SheepShaver work with SDL2 2.0.10 so these emulators can be launched in Catalina without the disturbing message that is the title of this topic.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

My PM to kanjitalk755 is still in my outbox, so he did not yet read it. I hope this issue can be solved before the end of the year. After this month, Apple will again tighten the requirements for notarization. As SheepShaver and BasiliskII in their current form cannot comply with these requirements, it will not be possible to notarize new builds after December 2019.
See also: https://developer.apple.com/news/?id=09032019a
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: Basilisk II would like to receive keystrokes from any ap

Post by mabam »

Ronald P. Regensburg wrote:... After this month, Apple will again tighten the requirements for notarization. ...
On the page you’ve linked it says: “... until January 2020”. In Dutch understanding that would mean “until January begins”, but in English it means “up to and including January”, as far as I know.

That would give us one month more.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Basilisk II would like to receive keystrokes from any ap

Post by kanjitalk755 »

My latest source (October 26) is compatible with SDL2.0.10.
Have you tried it?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

I did not notice the changed source. I will post new SheepShaver and BasiliskII builds here later.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

I successfully built again new builds of both SheepShaver and BasiliskII with SDL2 2.0.10 from kanjitalk755 source.

The caps lock works fine now and in Catalina the "would like to receive keystrokes from any application" should not appear again.

It is time to go to sleep. I will post the new builds tomorrow.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Basilisk II would like to receive keystrokes from any ap

Post by Ronald P. Regensburg »

Posted 4 December builds of both BasiliskII and SheepShaver with the disturbing message in Catalina "would like to receive keystrokes from any application" solved.
Post Reply