Go to index / Go to protocols

river_xkb_config_v1 ↗

configure xkbcommon keyboards

This protocol allow a client to set the xkbcommon keymap of individual keyboard input devices. It also allows switching between the layouts of a keymap and toggling capslock/numlock/scrolllock state.

The key words "must", "must not", "required", "shall", "shall not", "should", "should not", "recommended", "may", and "optional" in this document are to be interpreted as described in IETF RFC 2119.

river_xkb_config_v1
river_xkb_config_v1

Version 3

xkb config global interface

Global interface for configuring xkb devices.

This global should only be advertised if river_input_manager_v1 is advertised as well.

river_xkb_config_v1
enum error {
    invalid_destroy = 0,
    invalid_format = 1,
}
    river_xkb_config_v1
    request stop()

      stop sending events

      This request indicates that the client no longer wishes to receive events on this object.

      The Wayland protocol is asynchronous, which means the server may send further events until the stop request is processed. The client must wait for a river_xkb_config_v1.finished event before destroying this object.

      river_xkb_config_v1
      event finished()

        the server has finished with the object

        This event indicates that the server will send no further events on this object. The client should destroy the object. See river_xkb_config_v1.destroy for more information.

        river_xkb_config_v1
        request destroy()
        Destructor

          destroy the river_xkb_config_v1 object

          This request should be called after the finished event has been received to complete destruction of the object.

          It is a protocol error to make this request before the finished event has been received.

          If a client wishes to destroy this object it should send a river_xkb_config_v1.stop request and wait for a river_xkb_config_v1.finished event. Once the finished event is received it is safe to destroy this object and any other objects created through this interface.

          river_xkb_config_v1
          enum keymap_format {
              text_v1 = 1,
              text_v2 = 2,
          }
          • text_v1 — XKB_KEYMAP_FORMAT_TEXT_V1
          • text_v2 — XKB_KEYMAP_FORMAT_TEXT_V2
          river_xkb_config_v1
          request create_keymap(
              id: new_id<river_xkb_keymap_v1>,
              fd: fd,
              format: uint<keymap_format>,
          )

            create a keymap object

            The server must be able to mmap the fd with MAP_PRIVATE. The server will fstat the fd to obtain the size of the keymap. The client must not modify the contents of the fd after making this request. The client should seal the fd with fcntl.

            river_xkb_config_v1
            event xkb_keyboard(
                id: new_id<river_xkb_keyboard_v1>,
            )

              new xkb keyboard

              A new xkbcommon keyboard has been created. Not every river_input_device_v1 is necessarily an xkbcommon keyboard as well.

              river_xkb_config_v1
              river_xkb_keymap_v1

              Version 3

              xkbcommon keymap

              This object is the result of attempting to create an xkbcommon keymap.

              river_xkb_keymap_v1
              request destroy()
              Destructor

                destroy the keymap object

                This request indicates that the client will no longer use the keymap object and that it may be safely destroyed.

                river_xkb_keymap_v1
                event success()

                  keymap creation succeeded

                  The keymap object was successfully created and may be used with the river_xkb_keyboard_v1.set_keymap request.

                  river_xkb_keymap_v1
                  event failure(
                      error_msg: string,
                  )

                    keymap creation failed

                    The compositor failed to create a keymap from the given parameters.

                    It is a protocol error to use this keymap object with river_xkb_keyboard_v1.set_keymap.

                    river_xkb_config_v1
                    river_xkb_keyboard_v1

                    Version 3

                    xkbcommon keyboard device

                    This object represent a physical keyboard which has its configuration and state managed by xkbcommon.

                    river_xkb_keyboard_v1
                    enum error {
                        invalid_keymap = 0,
                    }
                      river_xkb_keyboard_v1
                      request destroy()
                      Destructor

                        destroy the xkb keyboard object

                        This request indicates that the client will no longer use the keyboard object and that it may be safely destroyed.

                        river_xkb_keyboard_v1
                        event removed()

                          the xkb keyboard is removed

                          This event indicates that the xkb keyboard has been removed.

                          The server will send no further events on this object and ignore any request (other than river_xkb_keyboard_v1.destroy) made after this event is sent. The client should destroy this object with the river_xkb_keyboard_v1.destroy request to free up resources.

                          river_xkb_keyboard_v1
                          event input_device(
                              device: object<river_input_device_v1>,
                          )

                            corresponding river input device

                            The river_input_device_v1 corresponding to this xkb keyboard. This event will always be the first event sent on the river_xkb_keyboard_v1 object, and it will be sent exactly once.

                            river_xkb_keyboard_v1
                            request set_keymap(
                                keymap: object<river_xkb_keymap_v1>,
                            )

                              set the keymap

                              Set the keymap for the keyboard.

                              Setting a keymap will reset all layout/modifier state.

                              It is a protocol error to pass a keymap object for which the river_xkb_keymap_v1.success event was not received.

                              river_xkb_keyboard_v1
                              request set_layout_by_index(
                                  index: int,
                              )

                                set the active layout by index

                                Set the active layout for the keyboard's keymap. Has no effect if the layout index is out of bounds for the current keymap.

                                river_xkb_keyboard_v1
                                request set_layout_by_name(
                                    name: string,
                                )

                                  set the active layout by name

                                  Set the active layout for the keyboard's keymap. Has no effect if there is no layout with the give name for the keyboard's keymap.

                                  river_xkb_keyboard_v1
                                  event layout(
                                      index: uint,
                                      name: nullable string,
                                  )

                                    currently active layout

                                    The currently active layout index and name. The name arg may be null if the active layout does not have a name.

                                    This event is sent once when the river_xkb_keyboard_v1 is created and again whenever the layout changes.

                                    river_xkb_keyboard_v1
                                    request capslock_enable()

                                      enable capslock

                                      Enable capslock for the keyboard.

                                      river_xkb_keyboard_v1
                                      request capslock_disable()

                                        disable capslock

                                        Disable capslock for the keyboard.

                                        river_xkb_keyboard_v1
                                        event capslock_enabled()

                                          capslock is currently enabled

                                          Capslock is currently enabled for the keyboard.

                                          This event is sent once when the river_xkb_keyboard_v1 is created and again whenever the capslock state changes.

                                          river_xkb_keyboard_v1
                                          event capslock_disabled()

                                            capslock is currently disabled

                                            Capslock is currently disabled for the keyboard.

                                            This event is sent once when the river_xkb_keyboard_v1 is created and again whenever the capslock state changes.

                                            river_xkb_keyboard_v1
                                            request numlock_enable()

                                              enable numlock

                                              Enable numlock for the keyboard.

                                              river_xkb_keyboard_v1
                                              request numlock_disable()

                                                disable numlock

                                                Disable numlock for the keyboard.

                                                river_xkb_keyboard_v1
                                                event numlock_enabled()

                                                  numlock is currently enabled

                                                  Numlock is currently enabled for the keyboard.

                                                  This event is sent once when the river_xkb_keyboard_v1 is created and again whenever the numlock state changes.

                                                  river_xkb_keyboard_v1
                                                  event numlock_disabled()

                                                    numlock is currently disabled

                                                    Numlock is currently disabled for the keyboard.

                                                    This event is sent once when the river_xkb_keyboard_v1 is created and again whenever the numlock state changes.

                                                    river_xkb_keyboard_v1
                                                    event done()
                                                    Available since version 2

                                                      all information has been sent

                                                      This event is sent after all information about the keyboard has been sent.

                                                      This allows changes to one or more river_xkb_keyboard_v1 properties to be seen as atomic, even if they happen via multiple events.

                                                      river_xkb_keyboard_v1
                                                      request scrolllock_enable()
                                                      Available since version 3

                                                        enable scrolllock

                                                        Enable scrolllock for the keyboard.

                                                        river_xkb_keyboard_v1
                                                        request scrolllock_disable()
                                                        Available since version 3

                                                          disable scrolllock

                                                          Disable scrolllock for the keyboard.

                                                          river_xkb_keyboard_v1
                                                          event scrolllock_enabled()
                                                          Available since version 3

                                                            scrolllock is currently enabled

                                                            Scrolllock is currently enabled for the keyboard.

                                                            This event is sent once when the river_xkb_keyboard_v1 is created and again whenever the scrolllock state changes.

                                                            river_xkb_keyboard_v1
                                                            event scrolllock_disabled()
                                                            Available since version 3

                                                              scrolllock is currently disabled

                                                              Scrolllock is currently disabled for the keyboard.

                                                              This event is sent once when the river_xkb_keyboard_v1 is created and again whenever the scrolllock state changes.