Skip to end of metadata
Go to start of metadata

All keyboard and remote control (for supported systems) for a native app is handled through the standard wayland seat mechanism. Remote control keys will come in as a standard wayland keyboard seat. The app manager compositor will route input to the focused app.

The following is a general way of getting keys

// Connect to display and registry callback with wayland registry
display= wl_display_connect(display_name);
registry= wl_display_get_registry(display);
wl_registry_add_listener(registry, &registryListener, &ctx);

// In registry callback add a seat listener
seat= (struct wl_seat*)wl_registry_bind(registry, id, &wl_seat_interface, 4);
wl_seat_add_listener(seat, &seatListener, ctx);

// In seat listener add listener for keyboard
keyboard= wl_seat_get_keyboard( seat );
wl_keyboard_add_listener( keyboard, &keyboardListener, ctx );

// Use the keyboard listener callbacks to get key information:
static const struct wl_keyboard_listener keyboardListener = {
  • No labels

1 Comment

  1. Do you have code implementation for a JS/HTML5 app?