final version V1

This commit is contained in:
2022-11-13 13:32:55 +01:00
parent 001146c53f
commit 9f565b25e9

View File

@@ -1,4 +1,5 @@
* Alternative settings for g910-gkeys
*Important : This document is for Xorg only (not Wayland).**
This document will explain how to setup g910-gkeys by limiting as much as possible the usage of a global config, the idea being to setup global mapping in a static manner, and let the user set the actions in his/her own environment.
@@ -7,12 +8,13 @@ This document will explain how to setup g910-gkeys by limiting as much as possib
- All of these actions will be performed on the process environment, that is ~root~.
- These actions are *global*.
- It is impossible to use the G-keys as /normal/ keys (for example different actions with different modifiers, for example ~Shift-G1~ or ~Control-Meta-G1~).
** g910-gkeys configuration file (/etc/g910-gkeys/config.json)
The configuration chosen will ba basic: assign each ~G-key~ to a key which does not exist on physical keyboard. Any key could be used, like specific localized keys which do not exist on your keyboard (example: Japanese keys for an English keyboard), or function keys above F12.
The configuration chosen will be basic: assign each ~G-key~ to a key which does not exist on physical keyboard. Any key could be used, like specific localized keys which do not exist on your keyboard (example: Japanese keys for an English keyboard), or function keys above F12.
We will choose to map them to Function keys ~F13~ to ~F21~. It is possible that some of these F-keys are already used on your system (example: some media keys may be assigned to ~F20~). In this case, simply use another F-key.
We will choose to map them to Function keys ~F13~ to ~F21~.
The ~g910-gkeys~ will be :
My ~g910-gkeys~ is :
#+BEGIN_SRC json
{
@@ -58,11 +60,28 @@ The ~g910-gkeys~ will be :
#+END_SRC
** X11 keyboard mapping
By default, our F13-F22 keys may be mapped to some defaults (see /usr/share/X11/xkb/symbols/inet). For example, ~F13~ could return ~XF86Tools~. This is not what we want. Instead we want F13-F22 to return themselves. It could be possible to keep the default mappings, but it makes less sense, and it would probably clash with the keyboard Media keys.
/*Note*: Below, I configure ~F22~ (which looks un-necessary), because I had trouble with ~F20~ at some point, and used ~F22~ as fallback.//
You can check if this mapping is done on your system with:
By default, the F13-F22 keys may be mapped to some defaults. For example, ~F13~ could return ~XF86Tools~.
This is not what we want: Instead we want F13-F22 to return themselves.
It could be possible to keep the default mappings, but it makes less sense, and it would probably clash with the keyboard Media keys.
You can check if this mapping is done on your system with the command ~xmodmap -pke | grep -E 'keycode (19[1-9]|200)'~ :
#+CAPTION: Correct F-keys mapping
#+BEGIN_SRC
$ xmodmap -pke | grep -E 'keycode (19[1-9]|200)'~
$ xmodmap -pke | grep -E 'keycode (19[1-9]|200)'
keycode 191 = F13 F13 F13 F13 F13 F13 F13
keycode 192 = F14 F14 F14 F14 F14 F14 F14
keycode 193 = F15 F15 F15 F15 F15 F15 F15
keycode 194 = F16 F16 F16 F16 F16 F16 F16
...
keycode 200 = F22 F22 F22 F22 F22 F22 F22
#+END_SRC
#+CAPTION: Incorrect F-keys mapping
#+BEGIN_SRC
$ xmodmap -pke | grep -E 'keycode (19[1-9]|200)'
keycode 191 = XF86Tools NoSymbol XF86Tools
keycode 192 = XF86Launch5 NoSymbol XF86Launch5
keycode 193 = XF86Launch6 NoSymbol XF86Launch6
@@ -70,11 +89,11 @@ keycode 193 = XF86Launch6 NoSymbol XF86Launch6
keycode 200 = XF86TouchpadOn NoSymbol XF86TouchpadOn
#+END_SRC
If the output looks like the above, you will need to use one of the two above methods :
If your configuration is incorrect, you can choose one of the two solutions below (I prefer the first one) :
*** Fix F-keys mapping globally
You will need to find out where the mapping F-key -> Different key is done. On My system, it was in ~/usr/share/X11/xkb/symbols/inet~.
You will need to find out where the mapping *F-key -> Different key* is done. On my system, it was in ~/usr/share/X11/xkb/symbols/inet~.
Tou find where the mapping is done on your system, you may run : ~setxkbmap -print -verbose 10~) :
To find where the mapping is done on your system, you may run : ~setxkbmap -print -verbose 10~) :
#+BEGIN_SRC
$ setxkbmap -print -verbose 10
Setting verbose level to 10
@@ -102,7 +121,8 @@ xkb_keymap {
xkb_geometry { include "pc(pc105)" };
};
#+END_SRC
In my case, the faulty configuration was the ~inet(evdev)~ part, meaning in the ~xkb_symbols "evdev"~ section of ~/usr/share/X11/xkb/symbols/inet~ file. I had to remove the ~FK13-FK22~ lines and add my own. For example, replacing the line :
In my case, the faulty configuration was the ~inet(evdev)~ part, meaning in the ~xkb_symbols "evdev" {~ section of ~/usr/share/X11/xkb/symbols/inet~ file. I had to remove the ~FK13-FK22~ lines and add my own. For example, replacing the line :
#+BEGIN_SRC
key <FK13> { [ XF86Tools ] };
#+END_SRC
@@ -160,7 +180,7 @@ Add in your ~/.xmodmaprc~ :
! F21 = keycode 199 = XF86TouchpadToggle NoSymbol XF86TouchpadToggle
! F22 = keycode 200 = XF86TouchpadOn NoSymbol XF86TouchpadOn
! we map the Gkeys (G1-G9), to F13-F22,
! we map the Gkeys (G1-G9), to F13-F21,
! G1
keycode 191 = F13 F13 F13 F13 F13 F13
@@ -170,8 +190,8 @@ keycode 192 = F14 F14 F14 F14 F14 F14
keycode 193 = F15 F15 F15 F15 F15 F15
! G4
keycode 194 = F16 F16 F16 F16 F16 F16
! G5 becomes Hyper_L
keycode 194 = F16 F16 F16 F16 F16 F16
! G5
keycode 194 = F17 F17 F17 F17 F17 F17
! G6
keycode 196 = F18 F18 F18 F18 F18 F18
! G7