BasiliskII Windows and Keycodes for Alt/Ctrl

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
jonathandueck
Space Cadet
Posts: 1
Joined: Wed Jul 30, 2014 2:09 am

BasiliskII Windows and Keycodes for Alt/Ctrl

Post by jonathandueck »

Hi, Basilisk folks,

I'm trying to remap the Alt and Ctrl keys on my Surface Pro Type Cover keyboard as follows: Alt (keyboard)-->Option (in emulated Mac), and Ctrl(keyboard)--> Command (in Emulated Mac).

What I've tried:
- I'm running BasiliskII for Windows 06-05-2013 as posted here: http://www.emaculation.com/forum/viewtopic.php?t=5282
(Also tested below using the 15_01_2010 version linked on the above page as "Always start with this download"--same problem)
... on a Surface Pro running Windows 8.1.
- I turn on "Use Raw Keycodes" and point to the BasiliskII_keycodes file
- Modify the BasiliskII_keycodes file as below:

Code: Select all

29	55	# Ctrl Left (was Ctrl 54)
# 125	58	# Logo Left (was -> Option 58)
56	58	# Alt Left (was -> Command 55)
57	49	# Space
100	58	# Alt Right (was -> Command 55)
# 126	58	# Logo Right (was -> Option 58)
97	55	# Ctrl Right (was Ctrl 54)
- Run BasiliskII
Result: Alt is still mapped to command (55) and Ctrl is still mapped to Ctrl (54).

However, if I map another key (example F1) to 58 (Mac option) it _does_ work in the emulated Mac. It looks like it's just a problem to do this with Ctrl and Alt.

Has anyone else encountered this, and if so, have you found a workaround?

Best,
Jon
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: BasiliskII Windows and Keycodes for Alt/Ctrl

Post by adespoton »

I've encountered this on some keyboards, but can't recall the workaround that'll work for you.

Modifier keys are often on different interrupts than regular keys; you may need to look at the wiring diagram for your keyboard to see how it's connected -- the reason for this is that for most keys, you want them to be synchronous and serial, but modifier keys need to be asynchronous, so you can't send them down the same line. USB effectively did away with this restriction (now each key can have its own signal and they're multiplexed), but some keyboard designs (and some driver designs) still do things the old way. So one thing to check is what the actual generated signal is that you're getting off those keys, and how the driver handles them. You may have to drop the driver into a debugger to figure this out. On windows, you might be able to do this by using WinDbg attached to the driver DLL for your keyboard -- you might even be able to pull the symbols off the MS symbol server, which will make looking at things much easier.

Of course, it could just be as simple as BII can't gain control of the modifier keys, as they're bound to OS functions; I can't recall right now how BII handles that in the standard Windows build.

Is there any difference if you use a Windows SDL build?
Post Reply