German keyboard vs. BasiliskII for Windows 30-09-2019

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

maf
Inquisitive Elf
Posts: 36
Joined: Sat Aug 30, 2014 1:56 pm

German keyboard vs. BasiliskII for Windows 30-09-2019

Post by maf »

When moving from Windows 7 to Windows 10 (both 64 bit), I replaced BasiliskII for Windows 20-02-2015 by the 30-09-2019 version referenced in BasiliskII for Windows.

My German QWERTZ keyboard had been working fine with the old binary. The new binary gave me a QWERTY keyboard. Im using a German System 8.1.

I tried using the options keycodes und keyboardfile. The keyboard file gave me some problems, initially. Spaces are not allowed in the filename, it seems. And I had to insert 'sdl windows' to avoid a warning about a missing vender 'windows' at startup. After that, all keys seemed to produce completely unexpected characters. So I went back to BasiliskII for Windows 20-02-2015.

Any advice on using the newer binary and the keyboardfile option? Thanks in advance!
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

Yes, this issue is to be expected.

The new BasiliskII build for Windows is built with SDL2. SDL2 scancodes are different from SDL1 scancodes, so different translations from SDL scancodes to Mac keycodes are needed. If you use an USA qwerty keyboard you have no problems. But if you use a different keyboard layout, you will need a keycodes file that contains SDL2 scancodes to Mac keycodes translations.

I did the new translation for macOS. I will try the same for Windows. I cannot test it myself, because I do not use Windows, so I will need your help for testing.

Please try this BasiliskII-keycodes file with the new BasiliskII build: https://ronaldpr.home.xs4all.nl/emacula ... ycodes.zip
Last edited by Ronald P. Regensburg on Sat Feb 01, 2020 11:02 am, edited 1 time in total.
Reason: corrected erroneously mentioning SheepShaver instead of BasiliskII build
maf
Inquisitive Elf
Posts: 36
Joined: Sat Aug 30, 2014 1:56 pm

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by maf »

I'm a little bit confused, I'm afraid :-)

I'll happily test the keycodes file. Do I understand correctly that I should test it with SheepShaver (which I havn't installed yet) instead of BasiliskII?

Is BasiliskII for Windows 30-09-2019 using SDL2 instead of SDL1, too? Then may be I'd have to replace the the old sdl.dll (presumably SDL1) in the Basilisk directory by a newer DLL?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

Oops, my mistake. I meant the new BasiliskII build. It is built with SDL2 and it will need a different keycodes file. I will edit the errors in my post.
Last edited by Ronald P. Regensburg on Sat Feb 01, 2020 11:05 am, edited 3 times in total.
Reason:  
maf
Inquisitive Elf
Posts: 36
Joined: Sat Aug 30, 2014 1:56 pm

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by maf »

I guess I should use a copy of SDL2.dll from https://www.libsdl.org/download-2.0.php with that keycodes files?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

I do not think adding SDL2.dll is needed, anyway not for using the keycodes file. Apparently it is also not needed for running the new BasiliskII build. You could run that build, albeit with the keyboard issue. I suppose adding it will do no harm either. If no process needs it, it will simply not be used. First try without.

In the GUI check to use the keycodes file and point it to the file that I edited for SDL2 scancodes. In BasiliskII choose your German keyboard.in the Keyboard control panel.
maf
Inquisitive Elf
Posts: 36
Joined: Sat Aug 30, 2014 1:56 pm

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by maf »

In deed, SDL2.dll is not required.

Your keyboardfile works great for the regular keys on my keyboard, including z, y, and all umlauts (i.e. the four rows from ^ to ´, q to +, a to #, and < to -). Also the numbers and four signs on the numeric keypad are fine.

Your keyboardfile does not (yet :-)) work for all characters that require me to press the 'Alt Gr' key to the right of the space bar in combination with some other key (x), i.e. ² (2), ³ (3), { (7), [ (8), ] (9), } (0), \ (ß), @ (q), € (e), ~ (+), | (<), µ (m). None of those keystrokes produces any character. Same for the Enter-key on the numeric keypad.

Thanks for your help!
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

Were all those characters available before in the OS you are running BasiliskII? I don't think characters like €, ², ³ were available at the time, anyway not in the System 7.5.5 that I run in BasiliskII.

Using the Keys application (in the Apple menu) you can check which characters appear when which keys are pressed in combination with which Mac modifier keys (shift, option, command) and also which keys on your Windows keyboard correspond with these three modifier keys.

On the Mac German keyboard in BasiliskII:
[ ] | { } are produced with the option key and 5, 6, 7, 8, 9 respectively
/ is produced with option-7
\ is produced with option-command-7
@ is produced with option-shift-1
~ is produced with option-shift-8
ñ is produced by option-n followed by n
etcetera

It is possible that only the modifier keys at the left side of the keyboard work. The Enter key does not work, you can use Return instead.
Last edited by Ronald P. Regensburg on Sun Feb 02, 2020 9:00 pm, edited 1 time in total.
Reason:  
maf
Inquisitive Elf
Posts: 36
Joined: Sat Aug 30, 2014 1:56 pm

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by maf »

No, those characters weren't available before. I was just hoping they would become available and that I could use the same modifier-key combinations I'm now used to from Windows.

On my keyboard, the keys in the bottom row from left to right have the labels Strg, Windows, Alt, Space, Alt Gr, Windows, Menu, Strg. The modifiers are properly recognized by the MacOS Keys application. Shift works as it should. The Alt key works as the Cmd key of the Macintosh keyboard. But the Windows keys do not work as expected. In the Keys applications, pressing the Windows keys will change the labels of the top row of key to the ones you list (e.g. [ ] | { }). But I can't type those characters, e.g. Alt-7 produces no character but starts a Windows application.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

maf wrote:In the Keys applications, pressing the Windows keys will change the labels of the top row of key to the ones you list (e.g. [ ] | { }). But I can't type those characters, e.g. Alt-7 produces no character but starts a Windows application.
So the Windows key works as the Mac option (alt) key in BasiliskII. Does anyone know how to prevent Windows from intercepting those key combos when BasiliskII is in front?
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by adespoton »

maf wrote:No, those characters weren't available before. I was just hoping they would become available and that I could use the same modifier-key combinations I'm now used to from Windows.

On my keyboard, the keys in the bottom row from left to right have the labels Strg, Windows, Alt, Space, Alt Gr, Windows, Menu, Strg. The modifiers are properly recognized by the MacOS Keys application. Shift works as it should. The Alt key works as the Cmd key of the Macintosh keyboard. But the Windows keys do not work as expected. In the Keys applications, pressing the Windows keys will change the labels of the top row of key to the ones you list (e.g. [ ] | { }). But I can't type those characters, e.g. Alt-7 produces no character but starts a Windows application.
There's two things to note here: one is that you can add in fonts with the characters you want, but they didn't exist in place back when the OS version you're running was released. When I was using BII regularly in the early 2000s, I created my own set of font extensions with the missing characters added or replacing characters I never used. Worked fine for print, wouldn't work so well for electronic distribution.

The second thing to note is that BII can't take control from your host OS that it's unwilling to give up. So in your case, you'll need to go into Windows keyboard shortcuts settings and un-assign Alt-7. Once it's no longer launching the Windows application, it should be able to be passed through to BII correctly, and do what you'd expect. This is a Windows issue and not a BII issue. It can't type what it never gets to see.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

You could try mapping the Mac option key to a different key. Is there a key you never use? What does the "menu" key do in Windows while you are using BasiliskII?
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by adespoton »

If he's using Win10, the Windows key will bring up the Start menu or Bing Search. I haven't succeeded in overriding this in Win10.
maf
Inquisitive Elf
Posts: 36
Joined: Sat Aug 30, 2014 1:56 pm

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by maf »

I've been trying to find out whether I could use AutoHotkey to either
  • intercept Windows + (x) and send the equivalent of Option + (x) to Basilisk, or
  • define hotkeys for AltGr + (y) to send the equivalent of Option + (x) to Basilisk.
Unfortunately, I haven't found a solution, yet :-(.

The first solution would allow me to use the Windows key as a replacement for the Macintosh keyboard's Option key. The second solution would allow me to use the AltGr key combinations that I'm used to from Windows with Basilisk.

My current problem with the first approach is that any attempt to pass the Windows key to Basilisk is intercepted by Windows itself if used as a modifier, e.g. Windows+5 will open the fifth application in the task menü.So far, I've only managed to disable the left Windows key alltogether (with LWin::Return).

Therefore, in the second approach, I would like to pass scan codes or virtual key codes to Basilisk. But I'm confused, because the scan codes listed in BasilikII_keycodes are different from the SDL scan codes. And both don't match the scan codes my keyboard produces according to an AutoHotkey script.

Any suggestions and some enlightment on Basilisk's scan codes and keyboard handling would be very welcome.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

The descriptions here may be more informative: https://www.libsdl.org/tmp/SDL/include/SDL_scancode.h

The SDL2 scancodes for keys on your keyboard from left to right should be:

Shift: 225
Control: 224 (Strg = Steuerung = Control = Ctrl)
Windows: 227
Alt: 226

space: 44

Alt Gr: 230
Windows: 231
Menu: 101
Control: 228
Shift: 229


Mac keycodes for the modifier keys are:

Shift: 56
Control: 54
Option: 58
Command: 55

So, if you want to replace the Alt key by the Alt Gr key as option key in BasiliskII, you could try to change the line:

Code: Select all

226	58	# Option
to:

Code: Select all

230	58	# Option
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

I made a new keycodes file. The Alt Gr, Windows, Control (Strg), and Shift keys on the right side of the Windows keyboard can now also be used in SDL2 builds.

The file is named just "keycodes". It can be used with all SheepShaver and BasiliskII applications.

https://ronaldpr.home.xs4all.nl/emacula ... ycodes.zip
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by adespoton »

Is this just for German keyboards?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

Not just for German keyboards. Like the older keycodes files, it is needed with keyboards that do not use an US English QWERTY keyboard layout (although it can be used with those as well). This new one includes scancode to keycode translations for SDL2 based builds of SheepShaver and BasiliskII for Windows and OSX/macOS.

If I can find the "vendor" that is looked for by SDL2 based builds for Linux, I can easily add that as well.

Al previously used scancode to keycode translations are also still there, so this file can also be used with older SheepShaver and BasiliskII builds for Windows, OSX/macOS, and Linux.
maf
Inquisitive Elf
Posts: 36
Joined: Sat Aug 30, 2014 1:56 pm

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by maf »

Ronald P. Regensburg wrote: So, if you want to replace the Alt key by the Alt Gr key as option key in BasiliskII, you could try to change the line:

Code: Select all

226	58	# Option
to:

Code: Select all

230	58	# Option
Thanks for your new keyboard file!

First, I successfully tested whether the keyboard file is used at all by changing the Mac keycode of key 5 to the Mac keycode for 7. I did that because the keyboardfile option in the configuration file is not working for me. Once I specify any other value than BasiliskII_keycodes, a dialogue claiming that BasiliskII_keycodes was not found is show at startup.

I then tried to use Alt Gr as a replacement for the option key, as you suggested. Unfortunately, that does not have any visible effect: In the MacOS key application ("Tastatur"), the keys Ctrl Left, Alt Left, Alt Gr, and Ctrl Right turn black once I press Alt Gr. This is the same as before or without a keyboard file. And pressing Alt Gr plus 5 (or any other of the number keys you listed) does not produce [ or any other character.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

The suggestions for changes were for the previous keyboard file. Have you tried the newest keyboard file without changes? The keys at the right of the space key should now also be useable.
On a Mac, there is no difference between the modifier keys on the left and on the right, so you will always see the keys on both sides being activated. But on the Windows host there are differences between the left and right hand side keys. When a key on the left does not work, the key on the right may work.

The mapping in the latest keyboard file should now be:
Ctrl Left --> Control
Logo Left -> Option
Alt Left -> Command
Space
Alt Right -> Command
Logo Right -> Option
Menu
Ctrl Right --> Control

If you cannot make the Mac Option or Command keys work because Windows interferes, you can look for a key that you never use (can be any key) and configure that one as Option key.
Last edited by Ronald P. Regensburg on Sun Feb 16, 2020 12:30 pm, edited 1 time in total.
Reason:  
maf
Inquisitive Elf
Posts: 36
Joined: Sat Aug 30, 2014 1:56 pm

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by maf »

I applied the changes to your second keyboard file named keycode. I had to rename it though, because the value to keyboardfile seems to be ignored.

I ran another check to verify I'm modifying the proper keyboard file. I changed

Code: Select all

4	0	# A
to

Code: Select all

4	1	# S
and the A key produces an s.

But the change from

Code: Select all

230	55	# Command (<- Windows Alt Right, Alt Gr)
to

Code: Select all

230	58	# Option (<- Windows Alt Right, Alt Gr)
does not have the effect I was hoping for. E.g., Alt Gr + 5 does not produce [ but nothing in the "Tastatur" application and in an text editor window. Same goes for other Alt Gr key kombinations.

May be I misinterpreted your advice?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

Now I am the one to be confused.

Start with my latest keycodes file unchanged. It now also maps the keys to the right of your space bar to respectively command, option, and control in BasiliskII.

The name of the file is irrelevant, as long as it is references to with the actual path and name in the GUI. You can rename the file to "BasiliskII_keycodes", so you do not need to change the setting in the GUI.

See which keys to the left and/or right of the space bar can be used in BasiliskII without Windows interfering with its own actions for that key. Maybe you can use the right Windows key for option.

Depending on your findings we can try further changes.
Last edited by Ronald P. Regensburg on Sun Feb 16, 2020 8:21 pm, edited 1 time in total.
Reason:  
maf
Inquisitive Elf
Posts: 36
Joined: Sat Aug 30, 2014 1:56 pm

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by maf »

So am I :lol:

The procedure you describe is what I have been doing. The only difference is that I'm not using the GUI. I'm using a text editor for the configuration file and the keyboard file.

I can't tell why the value for keyboardfile is ignored, but any other combination than a value BasiliskII_keycodes and an existing file BasiliskII_keycodes produces an error message about BasiliskII_keycodes not being found. It feels like BasiliskII_keycodes is hardwired in the binary. Are the sources for the 30-09-2019 version of BasiliskII available?

But the major problem for me at the moment is the keyboard mapping. So far, I can't get Alt Gr to stand in as a replacement for the Option key. E.g., Alt Gr + 5 does not produce [ but nothing despite

Code: Select all

230   58   # Option (<- Windows Alt Right, Alt Gr)
I'm not going for the Windows keys right now because it seems they are intercepted by Windows (the OS). In my initial attempts with AutoHotkey, I can make AutoHotkey swallow the Windows key presses, but I haven't managed to pass them along to BasiliskII.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by Ronald P. Regensburg »

maf wrote:It feels like BasiliskII_keycodes is hardwired in the binary.
In the macOS version, built from the same source, the keycodes file can have any name, both "keycodes" and "BasiliskII_keycodes" work. Maybe it is different in the Windows version.

It is difficult for me to find out what works or does not work on your setup because I have no Windows machine to try it myself.

1. In the "Keys" application ("Tasten" in German?) in BasiliskII: When you press the Alt Gr key on your physical keyboard, does the middle one of the three modifier keys on both left and right side turn dark grey?

2. If yes, do the characters on the keys change as expected? (5 to [ - e to ™ - a to å - etc)

3. If yes, while still holding the Alt Gr key, when pressing the "5" key, does the "[" key turn dark grey?

If not, then probably Windows intercepts the key combination Alt Gr - 5 for something else. Does that combination have a function in Windows?
Last edited by Ronald P. Regensburg on Wed Feb 19, 2020 11:50 am, edited 1 time in total.
Reason:  
maf
Inquisitive Elf
Posts: 36
Joined: Sat Aug 30, 2014 1:56 pm

Re: German keyboard vs. BasiliskII for Windows 30-09-2019

Post by maf »

Looking closer at the "Keys" application (its German name is "Tastatur") was a good suggestion.
Ronald P. Regensburg wrote:1. In the "Keys" application ("Tasten" in German?) in BasiliskII: When you press the Alt Gr key on your physical keyboard, does the middle one of the three modifier keys on both left and right side turn dark grey?
No. Even with

Code: Select all

#230	55	# Command (<- Windows Alt Right, Alt Gr)
230	58	# Option (<- Windows Alt Right, Alt Gr)
231	58	# Option (<- Windows Logo Right)
the results for Windows and Alt keys are different:

Pressing any of the two Windows key will highlight both of the appropriate keys in the bottom row and the labels of the keys in the top row change as expected (including [ ] | { }).

Pressing the (left) Alt key will highlight both of the appropriate keys in the bottom row, no labels change. (Im using the left Alt key as the command key without problems.)

Pressing the (right) Alt Gr key will highlight both Ctrl keys plus both Alt keys, but the labels of the keys in the top row do not change. The labels of the in between rows change, but to others labels than when pressing the Windows keys. These are the same results as with

Code: Select all

230	55	# Command (<- Windows Alt Right, Alt Gr)
#230	58	# Option (<- Windows Alt Right, Alt Gr)
So the (re)definition of scan code 230 does not seem to have any effect.
Ronald P. Regensburg wrote:If not, then probably Windows intercepts the key combination Alt Gr - 5 for something else. Does that combination have a function in Windows?
I don't know of any special action associated with Alt Gr + 5 in Windows. I have tested in a couple of Windows scenarios without any effect. I don't think it gets interecepted.
Last edited by maf on Wed Feb 19, 2020 5:28 pm, edited 1 time in total.
Post Reply