Skip to content

Instantly share code, notes, and snippets.

@haselwarter
Created February 11, 2022 22:41
Show Gist options
  • Select an option

  • Save haselwarter/12680e428ea1c8a35670085591f3a618 to your computer and use it in GitHub Desktop.

Select an option

Save haselwarter/12680e428ea1c8a35670085591f3a618 to your computer and use it in GitHub Desktop.

Revisions

  1. haselwarter created this gist Feb 11, 2022.
    20 changes: 20 additions & 0 deletions wayland.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    commit 4167767b45324c70a0f30abbb95f7ac616558b7a
    Author: Philipp G. Haselwarter <philipp@haselwarter.org>
    Date: Fri Feb 11 23:38:00 2022 +0100

    Bind ctrl-m (^M) to act like Return, i.e. accept the current entry

    diff --git a/wayland.c b/wayland.c
    index 4bf93be..3dda551 100644
    --- a/wayland.c
    +++ b/wayland.c
    @@ -630,7 +630,8 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial,
    }
    }

    - else if (sym == XKB_KEY_Return && effective_mods == 0)
    + else if ((sym == XKB_KEY_Return && effective_mods == 0) ||
    + (sym == XKB_KEY_m && effective_mods == ctrl))
    execute_selected(wayl);

    else if (effective_mods == 0) {