diff --git a/g910-gkeys-setup.org b/g910-gkeys-setup.org index a5601d6..ee3c1ce 100644 --- a/g910-gkeys-setup.org +++ b/g910-gkeys-setup.org @@ -7,6 +7,70 @@ This document will explain how to setup g910-gkeys by limiting as much as possib ** g910-gkeys 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. -We will choose to map them to Function keys `F13` to `F21`. See -, function keys, -`typeout` and `shortcut` look similar (and mayby could be merged) +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. + +The ~g910-gkeys~ will be (skipping ~F20~ on my system): + +#+begin_src json +{ + "__comment": "I was unable to use F20, even xev does not show the keycode. It just mutes/unmutes sound, same as the G910's button", + "keyboard_mapping": "en", + "g1": { + "hotkey_type": "shortcut", + "do": "F13" + }, + "g2": { + "hotkey_type": "shortcut", + "do": "F14" + }, + "g3": { + "hotkey_type": "shortcut", + "do": "F15" + }, + "g4": { + "hotkey_type": "shortcut", + "do": "F16" + }, + "g5": { + "hotkey_type": "shortcut", + "do": "F17" + }, + "g6": { + "hotkey_type": "shortcut", + "do": "F18" + }, + "g7": { + "hotkey_type": "shortcut", + "do": "F19" + }, + "g8": { + "hotkey_type": "shortcut", + "do": "F21" + }, + "g9": { + "hotkey_type": "shortcut", + "do": "F22" + } +} +#end_src + +** User configuration +*Note*: Configuration below will make the ~G-keys~ active only when user is logged-on, as any other key. + +We will assign the F-keys we defined in `config.json` to any program (this includes graphical programs), or to send a string to active window (using *xvkbd*[fn:1]). + +*xvkbd* not only allows to send strings ("hello, World!"), but also modifiers (as ~Control-A~, ~Alt-B~, ~Control-Left~), mouse events (motion, buttons), etc... This is a subset of the *typeout* option of config.json. See ~xbkbd man page~ for more details. + +Below are some examples (screenshots from ~Xubuntu 22.10~). We will define the following actions : +- ~G1~ will make the *Emacs* main window (whose title is always "*GNU Emacs*") active. +- ~G2~ will launch a *Gnome Terminal*. +- ~G3~ will send the string "Hello, World !" to active window. +- ~G4~ will send the current date to active window. +- ~G5~ will be assigned to a ~Hyper~ modifier: `G5 + a` will be `Hyper-a`, as `Control + a` is `Control-a`. + +All settings below (except for ~G5~) are configurable in `Settings/keyboard`, `Application Shortcuts` tab : +#+CAPTION: This is the caption for the next figure link (or table) +#+NAME: fig:SED-HR4049 +./img/g910-keyboard-settings.png + +[fn:1] *xvkbd* is in package of same name on ~debian~ and derivatives. If your distribution does not have this package, you can download it at : [[http://t-sato.in.coocan.jp/xvkbd/]]. diff --git a/img/g910-keyboard-settings.png b/img/g910-keyboard-settings.png new file mode 100644 index 0000000..eb0407c Binary files /dev/null and b/img/g910-keyboard-settings.png differ