Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set ralt_switch as level 3 chooser for xkb? #5

Open
Kabouik opened this issue Dec 23, 2019 · 6 comments
Open

How to set ralt_switch as level 3 chooser for xkb? #5

Kabouik opened this issue Dec 23, 2019 · 6 comments

Comments

@Kabouik
Copy link

Kabouik commented Dec 23, 2019

On the F(x)tec Pro¹ running SFOS and current layouts, the level 3 characters in xkb can be selected using the yellow arrow modifier keys, which are set as ralt_switch in kernel. This works great in SFOS, but Ubu chroot interprets that as a regular Alt. Pressing Alt + E for instance will unfold the Edit menu of any menu bar in windows, instead or printing the level 3 character of E on an us-intl layout, é.

On a computer, however, this would be what lalt would do, but ralt would not conflict with global shortcuts and it would therefore select the level characters. Can we do that in XFCE4 and Ubu chroot?

Applications > Settings > Keyboard does not allow selecting a level 3 chooser. I also tried to edit /etc/default/keyboard to add XKBOPTIONS="lv3:ralt_switch", but no success. I tried also to change the key with xmodmap -e "keycode 108 = ISO_Level3_Switch", didn't see any difference.

For reference, here is the left and right yellow arrow keys read in xev:

KeyPress event, serial 37, synthetic NO, window 0x1400001,
    root 0x29c, subw 0x0, time 11953973, (81,106), root:(1072,566),
    state 0x0, keycode 108 (keysym 0xff20, Multi_key), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: True

KeyRelease event, serial 37, synthetic NO, window 0x1400001,
    root 0x29c, subw 0x0, time 11954162, (81,106), root:(1072,566),
    state 0x8, keycode 108 (keysym 0xff20, Multi_key), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
KeyPress event, serial 37, synthetic NO, window 0x1400001,
    root 0x29c, subw 0x0, time 11953973, (81,106), root:(1072,566),
    state 0x0, keycode 108 (keysym 0xff20, Multi_key), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: True

KeyRelease event, serial 37, synthetic NO, window 0x1400001,
    root 0x29c, subw 0x0, time 11954162, (81,106), root:(1072,566),
    state 0x8, keycode 108 (keysym 0xff20, Multi_key), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
@elros34
Copy link
Owner

elros34 commented Dec 23, 2019 via email

@Kabouik
Copy link
Author

Kabouik commented Dec 23, 2019

I resynchronized the layout following your instructions, thanks. I can confirm the level 3 is assigned to ralt_switch in the xkb file, but I still have the same issue. Perhaps xfce4 just does the same for lalt and ralt. I could try other DEs now if one allows selecting the level 3 chooser, but I assume this should be possible in xfce4 too, maybe in a config file?

@elros34
Copy link
Owner

elros34 commented Dec 23, 2019

I really don't know as I don't even use xfce in desktop. I choose it here because it allows to change scaling easly.
This is my xkb layout:
https://github.com/elros34/sfos-moto_msm8960_jbbl-adaptation/blob/master/sparse/usr/share/X11/xkb/symbols/pl#L72
With this settings "left alt" switch to level 3 in sfos and xfce, "right alt" + key works as F1-F12 in sfos but not in xfce.

I suggest you to try kwin + libhybris acceleration. It doesn't renders correctly since few releases in my ancient device but I guess it may works correctly in fxtec pro1. Beware it will work in portrait mode unless you use it together with qxcompositor similar to how it's done for xfce.

@Kabouik
Copy link
Author

Kabouik commented Dec 25, 2019

xfce4 is a nice choice I think, it's both lightweight and configurable. I tried installing kwin and libhybris using ubu-install.sh but afterwards Ubu chroot failed to open any XWayland window, and I could not start Ubu with Kwin either, so I deleted my Ubu chroot folder and restarted from scratch.

I am trying to understand how your left_alt is recognized as level 3 chooser and not global hotkey for application menu bars. So far I have not found what makes the difference with the modifier key on the xkb layout I use on my device.

@Kabouik
Copy link
Author

Kabouik commented Jan 9, 2020

Short follow-up on this: I've tried adding -option lv3:ralt_switch through dconf in SFOS, restarted Lipstick, resynchronized Ubu chroot (and checked setxkbmap.desktop, confirmed), and the Right Alt key still acts as AltGr (level 3 chooser) in SFOS but no change in Chroot, it still behaves as regular Alt, and hence calls windows' menu bars.

I don't think it is an issue with chroot iself since it works on your end, probably just something missing in our xkb files on the Pro¹, but haven't managed to pinpoint exactly what part of your layout we need to add to ours to make it work.

@Kabouik Kabouik closed this as completed Jan 9, 2020
@Kabouik Kabouik reopened this Jan 9, 2020
@enigma9o7
Copy link

I'd also like to see the level three characters, particularly because that's where I have slash and question mark, which are fairly important :) For me the Fn key seems to behave as left alt, not right alt, even when I choose a keyboard layout in xfce that should support it within xfce, but not sure how that relates back to sfos...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants