medley icon indicating copy to clipboard operation
medley copied to clipboard

Problems with Swiss German keyboard (W11 WSL Ubuntu 24.04)

Open marcoxa opened this issue 1 year ago • 54 comments

Describe the bug It appears that the latest version (on W11 WSL Ubuntu 24.04) does not like a Swiss German keyboard. I cannot type in the top left key (§ and ° when shifted) below the Escape key and, above all, the bottom left key next to the left SHIFT key (> when shifted and Alt Gr \ work correctly, but not the plain <; which is a problem).

Other keys do not quite work. Some of them produce accented characters (ü. à. ö etc) but in general it is a bit annoying).

To Reproduce Steps to reproduce the behavior:

  1. W11
  2. Swiss German keyboard

Expected behavior I press < I get a <.

Context (please complete the following information):

  • OS: W11 WSL Ubuntu 24.04
  • Host arch: I7
  • IL:MAKESYSDATE: 26-Jun-2024 02:24:10

marcoxa avatar Jul 05 '24 13:07 marcoxa

Did earlier Medley versions work better with the Swiss German keyboard? There are longstanding known issues with and incomplete support of non English keyboards, for example #334.

pamoroso avatar Jul 05 '24 14:07 pamoroso

Not sure @pamoroso ... I had an earlier version installed, but it did not start anymore. So I just deleted it. Sorry.

marcoxa avatar Jul 05 '24 15:07 marcoxa

... plus this is on Windows 11 with VNC; not MacOS. It must be something with (Swiss) German Keyboards :)

marcoxa avatar Jul 05 '24 15:07 marcoxa

see also problems with Italian keyboard at https://github.com/orgs/Interlisp/discussions/1828

masinter avatar Sep 23 '24 18:09 masinter

Some of them produce accented characters (ü. à. ö etc)

@ marcoxa: did you really manage to make Medley display an "Umlaut" character? Do you remember what key strokes you had to type for this?

rochus-keller avatar Oct 09 '24 12:10 rochus-keller

HI.

no. I actually had more basic problems, like, ahem, open parentheses :)

MA

On Wed, Oct 9, 2024 at 2:47 PM Rochus Keller @.***> wrote:

Some of them produce accented characters (ü. à. ö etc)

@ marcoxa: did you really manage to make Medley display an "Umlaut" character? Do you remember what key strokes you had to type for this?

— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/1780#issuecomment-2402227741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD5SWQGKHR44LGY475OAH3Z2UQXDAVCNFSM6AAAAABKNIGB56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBSGIZDONZUGE . You are receiving this because you authored the thread.Message ID: @.***>

-- Marco Antoniotti Somewhere over the Rainbow

marcoxa avatar Oct 09 '24 13:10 marcoxa

The Italian keyboard has similar issues. But a good workaround is to run Medley under VNC (via medley -v +), which lets me at least type all (except <) the ASCII characters on the Italian keyboard including (, ), ;, and ;.

pamoroso avatar Oct 09 '24 13:10 pamoroso

But a good workaround is to run Medley under VNC

Because VNC makes a keyboard/key sequence translation to an ASCII keyboard? After looking at the sdl.c code I think we can have this cheaper, without VNC.

rochus-keller avatar Oct 09 '24 13:10 rochus-keller

I actually don't know why VNC does the right thing.

pamoroso avatar Oct 09 '24 13:10 pamoroso

On what client machine are you working? PC Linux, PC Windows, Mac?

rochus-keller avatar Oct 09 '24 13:10 rochus-keller

I'm working on a Linux Mint Cinnamon PC.

pamoroso avatar Oct 09 '24 14:10 pamoroso

the issues listed in interlisp keyboard 'project' have more details scattered in the discussions of the issues.

masinter avatar Oct 09 '24 16:10 masinter

@pamoroso : meanwhile I implemented a solution in https://github.com/rochus-keller/Gingko which should work with any keyboard; just download the repository to your machine and then run gcc *.c -std=c99 -lSDL2 -lm -o gingko. Then set the MEDLEYDIR environment variable (export MEDLEYDIR=<path-to-medley-directory>) where the medley directory is the one in the standard deployment (i.e. on the same level as the maiko and notecards directories) and run ./run-medley. Just ask if you need help. I did some tests, but I'm neither an Interlisp nor Medley user, so I would appreciate if you could check whether everything works as expected.

@marcoxa : maybe you also want to give it a try.

rochus-keller avatar Oct 09 '24 21:10 rochus-keller

Thanks. I don’t have much time now but I will keep you posted. Note that I am on Windows though.

MA

Marco Antoniotti Somewhere over the Rainbow

On Wed, 9 Oct 2024 at 23:24, Rochus Keller @.***> wrote:

@pamoroso https://github.com/pamoroso : meanwhile I implemented a solution in https://github.com/rochus-keller/Gingko which should work with any keyboard; just download the repository to your machine and then run gcc *.c -std=c99 -lSDL2 -lm -o gingko. Then set the MEDLEYDIR environment variable (export MEDLEYDIR=) where the medley directory is the one in the standard deployment (i.e. on the same level as the maiko and notecards directories) and run ./run-medley. Just ask if you need help. I did some tests, but I'm neither an Interlisp nor Medley user, so I would appreciate if you could check whether everything works as expected.

@marcoxa https://github.com/marcoxa : maybe you also want to give it a try.

— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/1780#issuecomment-2403451007, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD5SWSE54RIEOHOOBISRNTZ2WNKLAVCNFSM6AAAAABKNIGB56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBTGQ2TCMBQG4 . You are receiving this because you were mentioned.Message ID: @.***>

marcoxa avatar Oct 10 '24 06:10 marcoxa

@rochus-keller Thanks, I'll test your code by the end of the week.

pamoroso avatar Oct 10 '24 12:10 pamoroso

The library/virtualkeyboards/VIRTUALKEYBOARDS package, with XKEYBOARDS, has definitions for Italian and German (amongst other) keyboards - can someone with those physical keyboards try this out (under X, of course). It will (should) fix the cases where the keycap on the non-US keyboard differs from the US keycap for the same physical position code (which is what Lisp works in, and Maiko attempts to support). p.s., It also appears to support a Dvorak layout - I don't know if we have any intersection between Dvorak users and Medley users, but apparently there was once at least one.

nbriggs avatar Oct 12 '24 02:10 nbriggs

@pamoroso : the most recent version can even be used without setting any environment variables or shell scripts; just build it (gcc *.c -std=c99 -lSDL2 -lm -o gingko) and give it the path to the required sysout file in the medley directory (./gingko -sysout <path-to-sysout>, or even simpler ./gingko <path-to-sysout>); and it can still be used as a drop-in replacement of ldesdl in the original installation.

rochus-keller avatar Oct 12 '24 10:10 rochus-keller

I built the latest sources of Gingko on my Linux Mint 22 Cinnamon amd64 PC with this Italian keyboard (see the photo).

Typing all the ASCII characters works fine with the keys by the same symbols, including those on the numeric keypad except for ENTER which does nothing. The Ctrl-U and Ctrl-X keychords don't work either and pressing them does nothing.

Great job!

pamoroso avatar Oct 12 '24 11:10 pamoroso

Ctrl-B, Ctrl-D, and Ctrl-E don't work either with none of the two Ctrl keys. Pressing the left Ctrl alone does nothing, pressing the right one flashes Medley.

pamoroso avatar Oct 12 '24 11:10 pamoroso

The Tab, Shift, Caps Lock, and Meta keys work as expected.

pamoroso avatar Oct 12 '24 11:10 pamoroso

Thanks for your tests and feedback! Are you using the stand-alone gingko or as a drop-in replacement of ldesdl? What are the CTRL+key combinations supposed to do? In the Medley Language Reference I found CTRL + mouse buttons or CTRL+SHIFT stand-alone but wasn't able to test it.

rochus-keller avatar Oct 12 '24 11:10 rochus-keller

I'm using Ginko standalone built it under ~/medley/Gingko. To use it I set MEDLEYDIR, cd to ~/medley/Gingko, and execute ./run-medley -e -n. Without MEDLEYDIR I get this error:

paolo@lispmachine:~/medley/Gingko$ ./run-medley 
MEDLEYDIR has no loadups: /home/paolo/medley/Gingko
I tried to infer it based on your working directory, but that didn't work.
Try cd there or setting the MEDLEYDIR environment variable to its location.

Here's what the keychords do on Medley:

  • Ctrl-U: same as in a Unix shell, i.e. deletes the current line in an Exec
  • Ctrl-X: moves the caret to the end of a s-exp in an Exec and evaluates it (if it's complete)
  • Ctrl-B: invokes the debugger
  • Ctrl-D, Ctrl-E, different ways of interrupting the current program

pamoroso avatar Oct 12 '24 12:10 pamoroso

I tried to infer it based on your working directory, but that didn't work.

If you run gingko just with the path to a sysout, it looks whether the path includes "/loadups/" and then (and only then) sets MEDLEYDIR to the path segment left of "/loadups/", LDESOURCESYSOUT to the full path passed to gingko, INMEDLEY to 1, LDEDESTSYSOUT to "${HOME}/lisp.virtualmem", and LDEINIT to "/greetfiles/MEDLEYDIR-INIT" in MEDLEYDIR. So it actually should be able to run from any directory, without the shell script.

Thanks for the shortcut descriptions. I will try to make it work.

rochus-keller avatar Oct 12 '24 12:10 rochus-keller

Passing a sysout doesn't seem to work either, here's with MEDLEYDIR not set:

paolo@lispmachine:~/medley/Gingko$ ./run-medley ~/medley/medley/loadups/full.sysout 
MEDLEYDIR has no loadups: /home/paolo/medley/Gingko
I tried to infer it based on your working directory, but that didn't work.
Try cd there or setting the MEDLEYDIR environment variable to its location.

pamoroso avatar Oct 12 '24 12:10 pamoroso

Can you try "./gingko <absolute-path-to>/full.sysout", i.e. without the run-medley shell script and with the absolute path?

Note that if you start with the shell-script (run-medley) instead, you have to manually set MEDLEYDIR, as described here: https://github.com/rochus-keller/gingko/#status-on-2024-10-09

rochus-keller avatar Oct 12 '24 12:10 rochus-keller

Yes, calling gingko with the absolute path of a sysout does work:

paolo@lispmachine:~/medley/Gingko$ ./gingko ~/medley/medley/loadups/full.sysout 
Failed to find UNIXCOMM file handles; no processes
requested width: 1024, height: 768
initialised
Window created
Creating renderer...
Creating texture...
SDL initialised

pamoroso avatar Oct 12 '24 13:10 pamoroso

Ok, great. ./gingko -h shows the available options, of which I have tested -sc and -sysout so far. Note that you can either set the sysout path using the -sysout option or directly without option; both variants do the same; in the latter case, the options must follow the sysout path.

rochus-keller avatar Oct 12 '24 13:10 rochus-keller

Here's what the keychords do on Medley:

Ctrl-U: same as in a Unix shell, i.e. deletes the current line in an Exec Ctrl-X: moves the caret to the end of a s-exp in an Exec and evaluates it (if it's complete) Ctrl-B: invokes the debugger Ctrl-D, Ctrl-E, different ways of interrupting the current program

Hold on a moment there - that is NOT "what the keychords do on Medley" -- that's how the default TTYIN reader handles some control characters, unless the user has changed them -- the interpretation is NOT in the virtual machine. The physical key down/up transitions are passed to Medley, which then runs them through the user/application settable key action tables in order to determine how they are interpreted. The emulator is NOT involved.

nbriggs avatar Oct 12 '24 15:10 nbriggs

@pamoroso : I just commited a new version of Gingko which supports CTRL+letter combinations, als well as the Enter key; the reason it didn't work is that SDL apparently doesn't send a SDL_TEXTINPUT message to the application if the CTRL key is pressed, so I had to extend the behaviour of SDL_EVENT_KEY_DOWN. I also added terminal messages if gingko sets the MEDLEYDIR environment variable, so you know what you're up to. Hope everything works now.

@nbriggs : Thanks for the clarification; I assumed so and pass the shortcuts to Lisp to handle.

rochus-keller avatar Oct 12 '24 16:10 rochus-keller

What happens if the user swaps the shift and control key actions in Lisp? e.g.,

(DEFINEQ (SWAP-SHIFT ()
    (LET ((OSHIFT (KEYACTION 'LSHIFT))
         ((OCTRL (KEYACTION 'CTRL)))
      (KEYACTION 'LSHIFT OCTRL)
      (KEYACTION 'CTRL OSHIFT)))

(or, more likely, swaps the shift-lock key and control key)

nbriggs avatar Oct 12 '24 16:10 nbriggs