diamondburned / gotktrix

Matrix client in Go and GTK4
GNU Affero General Public License v3.0
312 stars 6 forks source link

Jsonnet for keybinding configuration #3

Open diamondburned opened 2 years ago

diamondburned commented 2 years ago

Translate this from Nix to Jsonnet:

let keyutils = import <keyutils>;

# Inherit GDK_KEY_* and such.
with keyutils.keybinds;
# Inherit mask1, etc.
with keyutils;

in {
    edit-last-message = key Up;
    quick-switcher    = mask1 CtrlMask K;
}

keyutils will provide functions such as:

as well as predefined constants for GDK keycodes with the cases transformed accordingly, e.g. GDK_SHIFT_MASK to ShiftMask.

Resources