mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-07 13:29:49 -05:00
Use wl_display_run and refactor example keyboards
This commit is contained in:
parent
8ce9237c92
commit
f5423a51b5
6 changed files with 6 additions and 51 deletions
|
|
@ -76,15 +76,6 @@ static void handle_output_frame(struct output_state *output, struct timespec *ts
|
|||
wlr_renderer_end(sample->renderer);
|
||||
}
|
||||
|
||||
static void handle_keyboard_key(struct keyboard_state *kbstate,
|
||||
xkb_keysym_t sym, enum wlr_key_state key_state) {
|
||||
if (sym == XKB_KEY_Escape) {
|
||||
kbstate->compositor->exit = true;
|
||||
} else if (key_state == WLR_KEY_PRESSED && sym >= XKB_KEY_F1 && sym <= XKB_KEY_F12) {
|
||||
wlr_session_change_vt(kbstate->compositor->session, sym - XKB_KEY_F1 + 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_tool_axis(struct tablet_tool_state *tstate,
|
||||
struct wlr_event_tablet_tool_axis *event) {
|
||||
struct sample_state *sample = tstate->compositor->data;
|
||||
|
|
@ -152,7 +143,6 @@ int main(int argc, char *argv[]) {
|
|||
struct compositor_state compositor = { 0,
|
||||
.data = &state,
|
||||
.output_frame_cb = handle_output_frame,
|
||||
.keyboard_key_cb = handle_keyboard_key,
|
||||
.tool_axis_cb = handle_tool_axis,
|
||||
.tool_proximity_cb = handle_tool_proximity,
|
||||
.tool_button_cb = handle_tool_button,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue