Keyboard Layout on Ubuntu 22.04

Using Dyalog under 'nixes

Keyboard Layout on Ubuntu 22.04

Postby mhpcto on Tue Jun 21, 2022 4:27 pm

I just brought up a new laptop with a clean install of Ubuntu 22.04.

Installed Dyalog from the deb file via apt. Slightly off topic: trying to start dyalog after the install resulted in a 'libtinfo5 not found' error. Once that was installed, dyalog starts fine on console or ride.

I have been unable to add the Dyalog APL keyboard layout to enter APL keys.

The APL fonts are installed and working. It also looks like the APL keymap is installed in /usr/share/X11/xkb/symbols.

The APL keyboard option is not listed in Settings->Keyboard->Input Source, so I can't add it via that interface.

Adding the apl/dyalog keyboard directly via setxkbmap also has no effect, the APL keyboard layout doe not show when using the WIN+SPACE shortcut. I added a couple of keyboard maps via Settings->Keyboard->Inpout Sources and they show with WIN+SPACE and can be selected.

Does anyone know what additional step is needed to make Ubuntu 22.04 recognize the APL keymap?
mhpcto
 
Posts: 18
Joined: Tue Sep 18, 2018 5:36 pm

Re: Keyboard Layout on Ubuntu 22.04

Postby Vince|Dyalog on Wed Jun 22, 2022 8:14 am

Hi mhpcto,

There is a page on the aplwiki which explains how to type APL Glyphs on Linux here.
https://aplwiki.com/wiki/Typing_glyphs_on_Linux

This is how to install a APL Keyboard layout on Ubuntu 22.04:

For default GNOME, (not GNOME on Xorg)

0) I think that it uses Wayland. You can confirm that by typing this in a shell.

echo $XDG_SESSION_TYPE

1) sudo apt install gnome-tweaks

2) Start gnome-tweaks
a) Under Keyboard & Mouse
Turn on "Show Extended Input Sources"

b) Press the Additional Layout options

> Switching to another layout
Choose a key for this. I choose Left Alt (while pressed)

3) In Ubuntu settings
Keyboard
Under Input Sources
Press the + button
Press the English US button if that is your native language
Choose APL Symbols (Dyalog APL)

4) Log out and log in again.

5) Start dyalog. As I chose Left Alt, try Left Alt and i to get ⍳, Left Alt and a to get ⍺, etc.

Hope that helps, and let me know if you have any questions.

Regards,

Vince
Vince|Dyalog
 
Posts: 432
Joined: Wed Oct 01, 2008 9:39 am

Re: Keyboard Layout on Ubuntu 22.04

Postby mhpcto on Wed Jun 22, 2022 7:26 pm

Thank you for the info and the instructions.

That's a leap forward in that the APL glyphs are rendered but, once I select the Dyalog layout, I get only APL characters. No ASCII nor do editing keys like BACKSPACE work anymore.

Let me clarify:

If I set Left-ALT and Right-ALT (both while pressed) I do not get APL characters. I had additional keyboard layouts and even after removing all of them and only English(US) and Dyalog the switching while holding one of the ALT keys has no effect.

In prior version, and under Windows, I would normally switch the input layout with WIN-SPACE to the Dyalog APL layout which is a unified keyboard that uses ALT by default. This does not seem to work as selecting the Dyalog layout renders only APL even without a modifier key (ALT).

One additional detail:

I didn't exactly follow your instructions for adding the Dyalog APL layout via the Settings. Because the "English (US)" layout is the default, first entry in "Input Sources" it can't be selected when pressing "+" to add another layout. Instead I selected "English (United States)" and then "APL Symbols (Dyalog APL)" to install APL as a second layout.
mhpcto
 
Posts: 18
Joined: Tue Sep 18, 2018 5:36 pm

Re: Keyboard Layout on Ubuntu 22.04

Postby mhpcto on Wed Jun 22, 2022 11:27 pm

Fixed.

Turns out that I needed to uncheck the two (default?) selections under "Key to choose 3rd level", namely "Left Alt" and "Right Alt never chooses 3rd level" to make it work.
mhpcto
 
Posts: 18
Joined: Tue Sep 18, 2018 5:36 pm

Re: Keyboard Layout on Ubuntu 22.04

Postby mhpcto on Thu Jun 23, 2022 5:51 am

This setup does not work with Ride 4.x

Looking through the Ride documentation is seems that Ride requires a Prefix key and does not allow a modifier key like ALT.
mhpcto
 
Posts: 18
Joined: Tue Sep 18, 2018 5:36 pm

Re: Keyboard Layout on Ubuntu 22.04

Postby Vince|Dyalog on Thu Jun 23, 2022 2:26 pm

Hi mhpcto,

RIDE does not require the usage of the prefix keyboard. It provides that as an alternative way to type APL.

I can reproduce the behaviour where RIDE 4.4 does not generate APL characters when using the alt key as I set up previously in this thread.

This is under Wayland. I have logged an issue for this in the RIDE GitHub area. https://github.com/Dyalog/ride/issues/879

I can use the alt key if I log out and switch to GNOME on Xorg after pressing the round cogwheel settings button on the log in screen.

Would you like to try that, or do you have a requirement to run on Wayland?

Regards,

Vince
Vince|Dyalog
 
Posts: 432
Joined: Wed Oct 01, 2008 9:39 am

Re: Keyboard Layout on Ubuntu 22.04

Postby mhpcto on Tue Jun 28, 2022 8:56 pm

As you say, switching to Xorg enables the ALT modified key in both Ride 4.4 and 4.5.

Unfortunately, I see a weird side effect that, after the laptop goes through a sleep/wake cycle, mouse clicks are "funky":

Mouse moves and hovering over controls shows tool tips (if supported). Clicking the main pad has no effect. Using the physical button right button on the mouse sometimes acts like the right button on the active app (i.e. shows a right click menu), but may sometimes act like the main button once. Switching back to Wayland resolves that issue.

The ALT key modifier works with everything else but Ride.
mhpcto
 
Posts: 18
Joined: Tue Sep 18, 2018 5:36 pm

Re: Keyboard Layout on Ubuntu 22.04

Postby mhpcto on Wed Oct 19, 2022 7:39 pm

I just discovered another odd, modifier key issue that I think is general in nature, but I hope someone here has an idea on how to fix it.

The environment is still Ubuntu 22.04.

I have a number of terminal emulators. After adding Dyalog APL symbols as a second input source and enabling Left ALT as the compose key the default terminal and kitty will properly handle ALT key combinations and render APL characters. If I run vim in them, I get APL characters.

I recently installed cool-retro-term and in that emulation, ALT key combinations ignore the modifier key and thus don't render APL characters. That's a bummer because I wanted to recreate the look of the IBM 5100, the first APL machine I worked on, using cool-retro-term which is a truly superb emulation of old CRT screens.

Would anyone know what specific keyboard layout and ALT processing an application has to do to support alternate font activated by the modifier key? I started digging into this a bit but it's badly documented complexity.
mhpcto
 
Posts: 18
Joined: Tue Sep 18, 2018 5:36 pm

Re: Keyboard Layout on Ubuntu 22.04

Postby RichardP|Dyalog on Mon Oct 24, 2022 8:41 am

Have you tried with modifiers other than Left ALT? Is ALT used to access the menus in cool-retro-term? It sounds like the application is consuming the ALT before the input method can use it. I'm working on an XCompose based solution which might work as an alternative. In any case, we will update here when there is news.
RichardP|Dyalog
 
Posts: 33
Joined: Fri Oct 12, 2018 3:05 pm

Re: Keyboard Layout on Ubuntu 22.04

Postby mhpcto on Wed Oct 26, 2022 1:42 am

I was thinking along those lines and went through the source code to see if cool-retro-term did anything fancy with modifier keys. It all seemed standard X11.

Just as a quick test, I booted Ubuntu 22.04, which I normally run in Wayland, into X11 mode and, voila, it works. It appears that the default terminal as well as kitty are somewhat Wayland aware, while cool-retro-term is not and that seems to be the key issue.
Last edited by mhpcto on Wed Oct 26, 2022 3:19 pm, edited 1 time in total.
mhpcto
 
Posts: 18
Joined: Tue Sep 18, 2018 5:36 pm

Next

Return to UNIX and Linux

Who is online

Users browsing this forum: No registered users and 1 guest