RDK Resources

[*ASP Wiki*]

Code Management Facility

Code Releases

RDK Forums

[RDK Conferences]

RDK Support

Archives

Papers & Presentations Archive

In the News!

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 = {
  keyboardHandleKeymap,
  keyboardHandleEnter,
  keyboardHandleLeave,
  keyboardHandleKey,
  keyboardHandleModifiers,
  keyboardHandleRepeatInfo,
};