~sircmpwn/public-inbox

wayland-book: Rename references to a few XKB variables v1 PROPOSED

Markus Gustafsson: 1
 Rename references to a few XKB variables

 1 files changed, 3 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/public-inbox/patches/55476/mbox | git am -3
Learn more about email & git

[PATCH wayland-book] Rename references to a few XKB variables Export this patch

---
Change names of a few referenced variables in the XKB chapter.

 src/seat/xkb.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/seat/xkb.md b/src/seat/xkb.md
index b439146..033bbe0 100644
--- a/src/seat/xkb.md
+++ b/src/seat/xkb.md
@@ -70,7 +70,7 @@ struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);

/* Use it to parse a keymap string */
struct xkb_keymap *keymap = xkb_keymap_new_from_string(
    xkb_context, keymap_str, XKB_KEYMAP_FORMAT_TEXT_V1,
    context, keymap_str, XKB_KEYMAP_FORMAT_TEXT_V1,
    XKB_KEYMAP_COMPILE_NO_FLAGS);

/* Create an XKB state machine */
@@ -82,13 +82,13 @@ Then, to process scancodes:
```c
int scancode = /* ... */;

xkb_keysym_t sym = xkb_state_key_get_one_sym(xkb_state, scancode);
xkb_keysym_t sym = xkb_state_key_get_one_sym(state, scancode);
if (sym == XKB_KEY_F1) {
    /* Do the thing you do when the user presses F1 */
}

char buf[128];
xkb_state_key_get_utf8(xkb_state, scancode, buf, sizeof(buf));
xkb_state_key_get_utf8(state, scancode, buf, sizeof(buf));
printf("UTF-8 input: %s\n", buf);
```

-- 
2.45.2