SWI-Prolog 9.3.26. on Macos, cannot type some characters in SWI-Console

I am using SWI-Prolog 9.3.26. on a Mac M2, running macos 14.6.1 with a keyboard layout “Swiss French”.

In “SWI-Prolog console”, it is not possible to type the characters [ and ] (bound to option 5, and 6 respectively.

How to change/correct the key bindings in SWI?

Thanks for any hints

Pushed a fix for that. The story is quite complicated and probably not resolved forever :frowning: I thought to follow GNU-Emacs, using the option key as Emacs meta-key and supporting the common keys on the MacOS command keys.

My Macbook keyboard it is only the € that is on option-2, so I could play with this. It seems I cannot type the € in Emacs either :(.

As a first step, any key combination that results in an ASCII printable character is now never sent as an option/meta key-down. That at least allows you to write Prolog :slight_smile: In addition, there is a resource

event.macos_option_characters: "€"

that contains additional non-ASCII characters that must be passed as text input rather than as option/meta keys.

Another approach might be to generate a key-down event for all option keys (as we did) and only make that block the text input if the key-down is processed successfully. That requires far more changes though.