mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-14 08:56:26 -05:00
Merge branch 'master' into rootston
This commit is contained in:
commit
f4387b437f
56 changed files with 376 additions and 121 deletions
|
|
@ -121,6 +121,15 @@ static void example_set_focused_surface(struct sample_state *sample,
|
|||
}
|
||||
}
|
||||
|
||||
if (surface) {
|
||||
// TODO: send array of currently pressed keys
|
||||
struct wl_array keys;
|
||||
wl_array_init(&keys);
|
||||
wlr_seat_keyboard_enter(sample->wl_seat, surface->surface, keys);
|
||||
} else {
|
||||
wlr_seat_keyboard_clear_focus(sample->wl_seat);
|
||||
}
|
||||
|
||||
sample->focused_surface = surface;
|
||||
}
|
||||
|
||||
|
|
@ -325,7 +334,8 @@ static void handle_output_frame(struct output_state *output,
|
|||
}
|
||||
|
||||
static void handle_keyboard_key(struct keyboard_state *keyboard,
|
||||
uint32_t keycode, xkb_keysym_t sym, enum wlr_key_state key_state) {
|
||||
uint32_t keycode, xkb_keysym_t sym, enum wlr_key_state key_state,
|
||||
uint64_t time_usec) {
|
||||
struct compositor_state *state = keyboard->compositor;
|
||||
struct sample_state *sample = state->data;
|
||||
if (sym == XKB_KEY_Super_L || sym == XKB_KEY_Super_R) {
|
||||
|
|
|
|||
|
|
@ -157,7 +157,8 @@ static void update_velocities(struct compositor_state *state,
|
|||
}
|
||||
|
||||
static void handle_keyboard_key(struct keyboard_state *kbstate,
|
||||
uint32_t keycode, xkb_keysym_t sym, enum wlr_key_state key_state) {
|
||||
uint32_t keycode, xkb_keysym_t sym, enum wlr_key_state key_state,
|
||||
uint64_t time_usec) {
|
||||
// NOTE: It may be better to simply refer to our key state during each frame
|
||||
// and make this change in pixels/sec^2
|
||||
// Also, key repeat
|
||||
|
|
|
|||
|
|
@ -99,7 +99,8 @@ static void update_velocities(struct compositor_state *state,
|
|||
}
|
||||
|
||||
static void handle_keyboard_key(struct keyboard_state *kbstate,
|
||||
uint32_t keycode, xkb_keysym_t sym, enum wlr_key_state key_state) {
|
||||
uint32_t keycode, xkb_keysym_t sym, enum wlr_key_state key_state,
|
||||
uint64_t time_usec) {
|
||||
// NOTE: It may be better to simply refer to our key state during each frame
|
||||
// and make this change in pixels/sec^2
|
||||
// Also, key repeat
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ static void keyboard_key_notify(struct wl_listener *listener, void *data) {
|
|||
key_state == WLR_KEY_PRESSED ? "pressed" : "released");
|
||||
}
|
||||
if (kbstate->compositor->keyboard_key_cb) {
|
||||
kbstate->compositor->keyboard_key_cb(kbstate, event->keycode, sym, key_state);
|
||||
kbstate->compositor->keyboard_key_cb(kbstate, event->keycode, sym,
|
||||
key_state, event->time_usec);
|
||||
}
|
||||
if (sym == XKB_KEY_Escape) {
|
||||
wl_display_terminate(kbstate->compositor->display);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ struct compositor_state {
|
|||
struct output_state *s);
|
||||
void (*keyboard_remove_cb)(struct keyboard_state *s);
|
||||
void (*keyboard_key_cb)(struct keyboard_state *s, uint32_t keycode,
|
||||
xkb_keysym_t sym, enum wlr_key_state key_state);
|
||||
xkb_keysym_t sym, enum wlr_key_state key_state, uint64_t time_usec);
|
||||
void (*pointer_motion_cb)(struct pointer_state *s,
|
||||
double d_x, double d_y);
|
||||
void (*pointer_motion_absolute_cb)(struct pointer_state *s,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue