Chromebook support #611

Closed
opened 2022-05-09 01:51:25 +02:00 by leezu · 8 comments

Chromebooks ersetzen die Feststelltaste durch eine Suchtaste, welche als LWIN (Super_L) fungiert. Um trotzdem Neo2 einsetzen zu könne, konnte ich mit folgender Konfiguration die LWIN Taste als Modifier aktivieren. Sicherlich gibt es einen besseren Weg dies zu Implementieren, ggfs auch direkt hier Upstream.

Darüber hinaus muss die ralt_switch Option aktiviert sein, damit die rechte Alt Taste als Modifier fungieren kann.

chromebook: add xkb options for neo2 layout on chromebooks

    To support neo2 layout on chromebooks, activate the standard ralt_switch
    option ("Key to choose 5th Level" -> "Right Alt chooses 5th level") as
    well as the lwin_switch option included in this commit ("Chromebook
    options" -> "Left Win chooses 3rd level").

    For Gnome, they can be activated in the Gnome Tweak tool ("Keyboard &
    Mouse" -> "Additional Layout Options").

diff --git a/chromebook/.config/xkb/rules/evdev b/chromebook/.config/xkb/rules/evdev
new file mode 100644
index 0000000..c596913
--- /dev/null
+++ b/chromebook/.config/xkb/rules/evdev
@@ -0,0 +1,4 @@
+! option = symbols
+  chromebook:swap_lwin_caps    = +chromebook(swap_lwin_caps)
+  chromebook:lwin_switch       = +chromebook(lwin_switch)
+! include %S/evdev
diff --git a/chromebook/.config/xkb/rules/evdev.xml b/chromebook/.config/xkb/rules/evdev.xml
new file mode 100644
index 0000000..2e4a4ee
--- /dev/null
+++ b/chromebook/.config/xkb/rules/evdev.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE xkbConfigRegistry SYSTEM "xkb.dtd">
+<xkbConfigRegistry version="1.1">
+  <optionList>
+    <group allowMultipleSelection="true">
+      <configItem>
+        <name>chromebook</name>
+        <description>Chromebook options</description>
+      </configItem>
+      <option>
+      <configItem>
+        <name>chromebook:swap_lwin_caps</name>
+        <description>Swap Search Key and CAPS</description>
+      </configItem>
+      </option>
+      <option>
+      <configItem>
+        <name>chromebook:lwin_switch</name>
+        <description>Left Win chooses 3rd level</description>
+      </configItem>
+      </option>
+    </group>
+  </optionList>
+</xkbConfigRegistry>
diff --git a/chromebook/.config/xkb/symbols/chromebook b/chromebook/.config/xkb/symbols/chromebook
new file mode 100644
index 0000000..cba68df
--- /dev/null
+++ b/chromebook/.config/xkb/symbols/chromebook
@@ -0,0 +1,18 @@
+// Swap the functions of the left Win key (Search) and the CAPS key.
+partial modifier_keys
+xkb_symbols "swap_lwin_caps" {
+  replace key <LWIN> { [ Caps_Lock ] };
+  replace key <CAPS> { [ Super_L ] };
+  // modifier_map Mod3  { <LWIN> };
+};
+
+// Use LWIN as modifier key
+partial modifier_keys
+xkb_symbols "lwin_switch" {
+  key <LWIN> {
+    type[Group1]="ONE_LEVEL",
+    symbols[Group1] = [ ISO_Level3_Shift ]
+  };
+  include "level3(modifier_mapping)"
+};

63e6bc1ce8

Chromebooks ersetzen die Feststelltaste durch eine Suchtaste, welche als LWIN (Super_L) fungiert. Um trotzdem Neo2 einsetzen zu könne, konnte ich mit folgender Konfiguration die LWIN Taste als Modifier aktivieren. Sicherlich gibt es einen besseren Weg dies zu Implementieren, ggfs auch direkt hier Upstream. Darüber hinaus muss die ralt_switch Option aktiviert sein, damit die rechte Alt Taste als Modifier fungieren kann. ``` chromebook: add xkb options for neo2 layout on chromebooks To support neo2 layout on chromebooks, activate the standard ralt_switch option ("Key to choose 5th Level" -> "Right Alt chooses 5th level") as well as the lwin_switch option included in this commit ("Chromebook options" -> "Left Win chooses 3rd level"). For Gnome, they can be activated in the Gnome Tweak tool ("Keyboard & Mouse" -> "Additional Layout Options"). diff --git a/chromebook/.config/xkb/rules/evdev b/chromebook/.config/xkb/rules/evdev new file mode 100644 index 0000000..c596913 --- /dev/null +++ b/chromebook/.config/xkb/rules/evdev @@ -0,0 +1,4 @@ +! option = symbols + chromebook:swap_lwin_caps = +chromebook(swap_lwin_caps) + chromebook:lwin_switch = +chromebook(lwin_switch) +! include %S/evdev diff --git a/chromebook/.config/xkb/rules/evdev.xml b/chromebook/.config/xkb/rules/evdev.xml new file mode 100644 index 0000000..2e4a4ee --- /dev/null +++ b/chromebook/.config/xkb/rules/evdev.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE xkbConfigRegistry SYSTEM "xkb.dtd"> +<xkbConfigRegistry version="1.1"> + <optionList> + <group allowMultipleSelection="true"> + <configItem> + <name>chromebook</name> + <description>Chromebook options</description> + </configItem> + <option> + <configItem> + <name>chromebook:swap_lwin_caps</name> + <description>Swap Search Key and CAPS</description> + </configItem> + </option> + <option> + <configItem> + <name>chromebook:lwin_switch</name> + <description>Left Win chooses 3rd level</description> + </configItem> + </option> + </group> + </optionList> +</xkbConfigRegistry> diff --git a/chromebook/.config/xkb/symbols/chromebook b/chromebook/.config/xkb/symbols/chromebook new file mode 100644 index 0000000..cba68df --- /dev/null +++ b/chromebook/.config/xkb/symbols/chromebook @@ -0,0 +1,18 @@ +// Swap the functions of the left Win key (Search) and the CAPS key. +partial modifier_keys +xkb_symbols "swap_lwin_caps" { + replace key <LWIN> { [ Caps_Lock ] }; + replace key <CAPS> { [ Super_L ] }; + // modifier_map Mod3 { <LWIN> }; +}; + +// Use LWIN as modifier key +partial modifier_keys +xkb_symbols "lwin_switch" { + key <LWIN> { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + include "level3(modifier_mapping)" +}; ``` https://github.com/leezu/dotfiles/commit/63e6bc1ce8b661a5044eb4a4f077954d19a63a5c
Owner

Vielen Dank!

Funktioniert damit Neo auch auf ChromeOS oder ist das nur für ein (halbwegs modernes;der kaputte Legacy-Display-Server kann ja keine Benutzer-xkb-overlays) Standard-Loonix auf der Hardware?

Prinzipiell könnten wir wohl eine ChromeOS-Installationsanleitung auf der Webseite ganz gut gebrauchen.

Vielen Dank! Funktioniert damit Neo auch auf ChromeOS oder ist das nur für ein (halbwegs modernes;der kaputte Legacy-Display-Server kann ja keine Benutzer-xkb-overlays) Standard-Loonix auf der Hardware? Prinzipiell könnten wir wohl eine ChromeOS-Installationsanleitung auf der Webseite ganz gut gebrauchen.
Author

ChromeOS habe ich nicht getestet. Die Konfiguration ist mit Debian Bookworm auf einem Acer Spin 513 - 13.3" Chromebook Qualcomm 7c 2.1GHz 4GB RAM 64GB Flash installiert via https://github.com/hexdump0815/imagebuilder/tree/31462ce/systems/chromebook_trogdor.

Wäre es sinnvoll in Neo direkt eine Option für lwin_switch zu integrieren?

ChromeOS habe ich nicht getestet. Die Konfiguration ist mit Debian Bookworm auf einem [Acer Spin 513 - 13.3" Chromebook Qualcomm 7c 2.1GHz 4GB RAM 64GB Flash](https://smile.amazon.com/dp/B09BHPF5VB) installiert via https://github.com/hexdump0815/imagebuilder/tree/31462ce/systems/chromebook_trogdor. Wäre es sinnvoll in Neo direkt eine Option für `lwin_switch` zu integrieren?
Owner

Diese Option existiert bereits (und kann bei Gnome mit
gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:lwin_switch']" aktiviert werden).

Diese Option existiert bereits (und kann bei Gnome mit `gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:lwin_switch']"` aktiviert werden).
Author

Super! Damit ist obige manuelle Konfiguration nicht notwendig. Zusammenfassend muss für Neo2 auf Chromebook nur die lv3:lwin_switch und ralt_switch Option aktiviert werden.

Super! Damit ist obige manuelle Konfiguration nicht notwendig. Zusammenfassend muss für Neo2 auf Chromebook nur die lv3:lwin_switch und ralt_switch Option aktiviert werden.
leezu closed this issue 2022-05-10 16:46:41 +02:00
Owner

Zusammenfassend muss für Neo2 auf Chromebook […] ralt_switch Option aktiviert werden.

Das sollte eigentlich™ auch nicht nötig sein, da Neo selbst schon level5(ralt_switch_lock) inkludiert.

Es gibt jedoch ein paar Optionen, die das wieder überschreiben (z.B. compose:ralt).

> Zusammenfassend muss für Neo2 auf Chromebook […] ralt_switch Option aktiviert werden. Das sollte eigentlich™ auch nicht nötig sein, [da Neo selbst schon level5(ralt_switch_lock) inkludiert](https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/blob/master/symbols/de#L556). Es gibt jedoch ein paar Optionen, die das wieder überschreiben (z.B. compose:ralt).
leezu changed title from Chromebook support ("Left Win chooses 3rd level") to Chromebook support 2022-05-10 17:45:15 +02:00
Author

Das sollte eigentlich™ auch nicht nötig sein, da Neo selbst schon level5(ralt_switch_lock) inkludiert.

Interessant. Ohne ralt_switch zeigt xev:

KeyPress event, serial 34, synthetic NO, window 0xa00001,
    root 0x2f6, subw 0x0, time 81606677, (115,-78), root:(265,141),
    state 0x2000, keycode 108 (keysym 0xfe11, ISO_Level5_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 203
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0xa00001,
    root 0x2f6, subw 0x0, time 81606896, (115,-78), root:(265,141),
    state 0x2000, keycode 108 (keysym 0xfe11, ISO_Level5_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 203
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Mit ralt_switch aber

KeyPress event, serial 34, synthetic NO, window 0xa00001,
    root 0x2f6, subw 0x0, time 81570048, (159,-24), root:(259,145),
    state 0x2000, keycode 108 (keysym 0xfe11, ISO_Level5_Shift), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0xa00001,
    root 0x2f6, subw 0x0, time 81570132, (159,-24), root:(259,145),
    state 0x2020, keycode 108 (keysym 0xfe13, ISO_Level5_Lock), same_screen YES,
    XKeysymToKeycode returns keycode: 23
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

wobei letzteres der Ausgabe auf einem "Standard" Laptop gleicht.

> Das sollte eigentlich™ auch nicht nötig sein, da Neo selbst schon level5(ralt_switch_lock) inkludiert. Interessant. Ohne `ralt_switch` zeigt `xev`: ``` KeyPress event, serial 34, synthetic NO, window 0xa00001, root 0x2f6, subw 0x0, time 81606677, (115,-78), root:(265,141), state 0x2000, keycode 108 (keysym 0xfe11, ISO_Level5_Shift), same_screen YES, XKeysymToKeycode returns keycode: 203 XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 37, synthetic NO, window 0xa00001, root 0x2f6, subw 0x0, time 81606896, (115,-78), root:(265,141), state 0x2000, keycode 108 (keysym 0xfe11, ISO_Level5_Shift), same_screen YES, XKeysymToKeycode returns keycode: 203 XLookupString gives 0 bytes: XFilterEvent returns: False ``` Mit `ralt_switch` aber ``` KeyPress event, serial 34, synthetic NO, window 0xa00001, root 0x2f6, subw 0x0, time 81570048, (159,-24), root:(259,145), state 0x2000, keycode 108 (keysym 0xfe11, ISO_Level5_Shift), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 37, synthetic NO, window 0xa00001, root 0x2f6, subw 0x0, time 81570132, (159,-24), root:(259,145), state 0x2020, keycode 108 (keysym 0xfe13, ISO_Level5_Lock), same_screen YES, XKeysymToKeycode returns keycode: 23 XLookupString gives 0 bytes: XFilterEvent returns: False ``` wobei letzteres der Ausgabe auf einem "Standard" Laptop gleicht.
leezu reopened this issue 2022-05-10 17:48:00 +02:00
Owner

Mh, ich erwarte (und bekomme bei mir auch) das exakt gegenseitige Verhalten: Mit lv5:ralt_switch die erste Ausgabe und mit lv5:ralt_switch_lock (oder gar keiner Option, das ist ja default) die erste Ausgabe.

In beiden Fällen funktioniert die vierte Ebene (aber mit lv5:ralt_switch funktioniert der Lock nur, wenn man zuerst die rechte Mod4-Taste drückt und danach die linke; mit lv5:ralt_switch_lock oder ohne zusätzliche Optionen funktionieren beide Reihenfolgen).

Ich kann mir nicht vorstellen, dass das ein Hardware-Problem ist. Ist bei deiner Konfiguration sonst irgendwas speziell? (mehrere Layouts, irgendwelche andere Optionen, irgendwelche xkeyboard-config Patches?).

Was passiert, wenn du explizit lv5:ralt_switch_lock setzt (also
gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:lwin_switch','lv5:ralt_switch_lock']"?

Mh, ich erwarte (und bekomme bei mir auch) das exakt gegenseitige Verhalten: Mit lv5:ralt_switch die erste Ausgabe und mit lv5:ralt_switch_lock (oder gar keiner Option, das ist ja default) die erste Ausgabe. In beiden Fällen funktioniert die vierte Ebene (aber mit lv5:ralt_switch funktioniert der Lock nur, wenn man zuerst die rechte Mod4-Taste drückt und danach die linke; mit lv5:ralt_switch_lock oder ohne zusätzliche Optionen funktionieren beide Reihenfolgen). Ich kann mir nicht vorstellen, dass das ein Hardware-Problem ist. Ist bei deiner Konfiguration sonst irgendwas speziell? (mehrere Layouts, irgendwelche andere Optionen, irgendwelche xkeyboard-config Patches?). Was passiert, wenn du explizit lv5:ralt_switch_lock setzt (also `gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:lwin_switch','lv5:ralt_switch_lock']"`?
Author

Auf einem zweiten Chromebook (gleiches Modell) zeigt xev ohne ralt_switch korrekt:

KeyPress event, serial 37, synthetic NO, window 0xc00001,
    root 0x2f6, subw 0x0, time 758679, (950,-7), root:(1000,112),
    state 0x0, keycode 108 (keysym 0xfe11, ISO_Level5_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 94
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0xc00001,
    root 0x2f6, subw 0x0, time 758928, (950,-7), root:(1000,112),
    state 0x20, keycode 108 (keysym 0xfe13, ISO_Level5_Lock), same_screen YES,
    XKeysymToKeycode returns keycode: 23
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Irgendetwas ist beim ersten mal also schief gelaufen.

% gsettings get org.gnome.desktop.input-sources xkb-options
['chromebook:media_keys', 'lv3:lwin_switch']
Auf einem zweiten Chromebook (gleiches Modell) zeigt `xev` ohne `ralt_switch` korrekt: ``` KeyPress event, serial 37, synthetic NO, window 0xc00001, root 0x2f6, subw 0x0, time 758679, (950,-7), root:(1000,112), state 0x0, keycode 108 (keysym 0xfe11, ISO_Level5_Shift), same_screen YES, XKeysymToKeycode returns keycode: 94 XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyRelease event, serial 37, synthetic NO, window 0xc00001, root 0x2f6, subw 0x0, time 758928, (950,-7), root:(1000,112), state 0x20, keycode 108 (keysym 0xfe13, ISO_Level5_Lock), same_screen YES, XKeysymToKeycode returns keycode: 23 XLookupString gives 0 bytes: XFilterEvent returns: False ``` Irgendetwas ist beim ersten mal also schief gelaufen. ``` % gsettings get org.gnome.desktop.input-sources xkb-options ['chromebook:media_keys', 'lv3:lwin_switch'] ```
leezu closed this issue 2022-06-13 02:26:03 +02:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: neo/neo-layout#611
No description provided.