mirror of
https://github.com/labwc/labwc.git
synced 2025-11-01 22:58:47 -04:00
seat: initialize tablet tool or pad
Co-authored-by: Consolatis <35009135+Consolatis@users.noreply.github.com>
This commit is contained in:
parent
2b96799a05
commit
605f9e9181
1 changed files with 15 additions and 0 deletions
15
src/seat.c
15
src/seat.c
|
|
@ -9,6 +9,7 @@
|
||||||
#include <wlr/types/wlr_touch.h>
|
#include <wlr/types/wlr_touch.h>
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
#include "common/mem.h"
|
#include "common/mem.h"
|
||||||
|
#include "input/drawing_tablet.h"
|
||||||
#include "input/input.h"
|
#include "input/input.h"
|
||||||
#include "input/keyboard.h"
|
#include "input/keyboard.h"
|
||||||
#include "input/key-state.h"
|
#include "input/key-state.h"
|
||||||
|
|
@ -254,6 +255,16 @@ new_touch(struct seat *seat, struct wlr_input_device *dev)
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct input *
|
||||||
|
new_tablet(struct seat *seat, struct wlr_input_device *dev)
|
||||||
|
{
|
||||||
|
struct input *input = znew(*input);
|
||||||
|
input->wlr_input_device = dev;
|
||||||
|
drawing_tablet_setup_handlers(seat, dev);
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
seat_update_capabilities(struct seat *seat)
|
seat_update_capabilities(struct seat *seat)
|
||||||
{
|
{
|
||||||
|
|
@ -306,6 +317,10 @@ new_input_notify(struct wl_listener *listener, void *data)
|
||||||
case WLR_INPUT_DEVICE_TOUCH:
|
case WLR_INPUT_DEVICE_TOUCH:
|
||||||
input = new_touch(seat, device);
|
input = new_touch(seat, device);
|
||||||
break;
|
break;
|
||||||
|
case WLR_INPUT_DEVICE_TABLET_PAD:
|
||||||
|
case WLR_INPUT_DEVICE_TABLET_TOOL:
|
||||||
|
input = new_tablet(seat, device);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
wlr_log(WLR_INFO, "unsupported input device");
|
wlr_log(WLR_INFO, "unsupported input device");
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue