Cursor: implement initial touch support

Still TODO are:
- Touch support for drags
- Mapping input devices to outputs (necessary for good multi-monitor
touch support)

Co-authored-by: Daan Vanoverloop <daan@vanoverloop.xyz>
This commit is contained in:
Isaac Freund
2022-06-22 00:34:05 +02:00
parent bd03484b28
commit 2eb013e214
3 changed files with 134 additions and 38 deletions

View File

@ -471,7 +471,7 @@ fn tryAddDevice(self: *Self, wlr_device: *wlr.InputDevice) !void {
try keyboard.init(self, wlr_device);
},
.pointer => {
.pointer, .touch => {
const device = try util.gpa.create(InputDevice);
errdefer util.gpa.destroy(device);
@ -487,7 +487,7 @@ fn tryAddDevice(self: *Self, wlr_device: *wlr.InputDevice) !void {
},
// TODO Support these types of input devices.
.touch, .tablet_tool, .tablet_pad => return,
.tablet_tool, .tablet_pad => return,
}
}
@ -501,8 +501,9 @@ pub fn updateCapabilities(self: *Self) void {
if (device.seat == self) {
switch (device.wlr_device.type) {
.keyboard => capabilities.keyboard = true,
.touch => capabilities.touch = true,
.pointer, .switch_device => {},
.touch, .tablet_tool, .tablet_pad => unreachable,
.tablet_tool, .tablet_pad => unreachable,
}
}
}