프로그램 사용/wayland2024. 3. 11. 18:01

디바이스 마다 인식 방법이 차이가 있을줄을 알았지만.. 어우..

struct evdev_device *
evdev_device_create(struct libinput_device *libinput_device,
    struct weston_seat *seat)
{
struct evdev_device *device;

device = zalloc(sizeof *device);
if (device == NULL)
return NULL;
weston_log("%s:%d\n",__func__,__LINE__);
device->seat = seat;
wl_list_init(&device->link);
device->device = libinput_device;

if (libinput_device_has_capability(libinput_device,
   LIBINPUT_DEVICE_CAP_KEYBOARD)) {
weston_seat_init_keyboard(seat, NULL);
device->seat_caps |= EVDEV_SEAT_KEYBOARD;
weston_log("%s:%d\n",__func__,__LINE__);
}
if (libinput_device_has_capability(libinput_device,
   LIBINPUT_DEVICE_CAP_POINTER)) {
weston_seat_init_pointer(seat);
device->seat_caps |= EVDEV_SEAT_POINTER;
weston_log("%s:%d\n",__func__,__LINE__);
}
if (libinput_device_has_capability(libinput_device,
   LIBINPUT_DEVICE_CAP_TOUCH)) {
weston_seat_init_touch(seat);
device->seat_caps |= EVDEV_SEAT_TOUCH;
device->touch_device = create_touch_device(device);
weston_log("%s:%d\n",__func__,__LINE__);
}

libinput_device_set_user_data(libinput_device, device);
libinput_device_ref(libinput_device);

return device;
}

 

LIBINPUT_EXPORT int
libinput_device_has_capability(struct libinput_device *device,
       enum libinput_device_capability capability)
{
return evdev_device_has_capability((struct evdev_device *) device,
   capability);
}

[링크 : https://github.com/jadahl/libinput/blob/master/src/libinput.c#L938]

 

int
evdev_device_has_capability(struct evdev_device *device,
    enum libinput_device_capability capability)
{
switch (capability) {
case LIBINPUT_DEVICE_CAP_POINTER:
return !!(device->seat_caps & EVDEV_DEVICE_POINTER);
case LIBINPUT_DEVICE_CAP_KEYBOARD:
return !!(device->seat_caps & EVDEV_DEVICE_KEYBOARD);
case LIBINPUT_DEVICE_CAP_TOUCH:
return !!(device->seat_caps & EVDEV_DEVICE_TOUCH);
default:
return 0;
}
}

[링크 : https://github.com/jadahl/libinput/blob/master/src/evdev.c#L699]

 

장치별로 인식되는 차이 확인! 커서가 안뜨던 녀석은 touch로 인식

[08:25:22.166] event2  - eGalax Inc. eGalaxTouch P80H84 0900 v12 k4.18.200: is tagged by udev as: Touchscreen
[08:25:22.166] event2  - eGalax Inc. eGalaxTouch P80H84 0900 v12 k4.18.200: device is a touch device
[08:25:22.176] event3  - FHD WebCam: FHD WebCam: is tagged by udev as: Keyboard
[08:25:22.176] event3  - FHD WebCam: FHD WebCam: device is a keyboard
[08:25:22.181] event1  - audio-hdmi HDMI Jack: is tagged by udev as: Switch
[08:25:22.181] event1  - not using input device '/dev/input/event1'
[08:25:22.181] evdev_device_create:856
[08:25:22.208] evdev_device_create:865 // LIBINPUT_DEVICE_CAP_KEYBOARD
[08:25:22.208] libinput: configuring device "30370000.snvs:snvs-powerkey".
[08:25:22.208] evdev_device_create:856
[08:25:22.208] Touchscreen - eGalax Inc. eGalaxTouch P80H84 0900 v12 k4.18.200 - /sys/devices/platform/soc@0/32f10108.usb/38200000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.3/1-1.3.2/1-1
[08:25:22.208] evdev_device_create:878 // LIBINPUT_DEVICE_CAP_TOUCH
[08:25:22.208] libinput: configuring device "eGalax Inc. eGalaxTouch P80H84 0900 v12 k4.18.200".
[08:25:22.208] input device event2 has no enabled output associated (none named), skipping calibration for now.
[08:25:22.208] evdev_device_create:856
[08:25:22.208] evdev_device_create:865 // LIBINPUT_DEVICE_CAP_KEYBOARD
[08:25:22.208] libinput: configuring device "FHD WebCam: FHD WebCam".
[08:25:22.209] DRM: head 'LVDS-1' found, connector 39 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'
[08:25:22.210] DRM: head 'HDMI-A-1' found, connector 40 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'

 

얘는 특이하게도 MT protocol B를 쓰더니, 그래서 그런가 pointer와 touch 두 가지로 인식

[08:30:59.219] event5  - eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19" UNKNOWN: is tagged by udev as: Mouse
[08:30:59.220] event5  - eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19" UNKNOWN: device is a pointer
[08:30:59.221] evdev_device_create:856
[08:30:59.221] evdev_device_create:871 // LIBINPUT_DEVICE_CAP_POINTER
[08:30:59.221] libinput: configuring device "eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19" UNKNOWN".
[08:30:59.221] input device event5 has no enabled output associated (none named), skipping calibration for now.
[08:30:59.221] associating input device event5 with output LVDS-1 (none by udev)
[08:30:59.312] event4  - eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19": is tagged by udev as: Touchscreen
[08:30:59.312] event4  - eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19": device is a touch device
[08:30:59.313] evdev_device_create:856
[08:30:59.313] Touchscreen - eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19" - /sys/devices/platform/soc@0/32f10108.usb/38200000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.3/1-1.3.1/1-1.3.1:1.0/0003:0EEF:C000.0002/input/input5/event4
[08:30:59.313] evdev_device_create:878 // LIBINPUT_DEVICE_CAP_TOUCH
[08:30:59.313] libinput: configuring device "eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19"".
[08:30:59.313] input device event4 has no enabled output associated (none named), skipping calibration for now.
[08:30:59.313] associating input device event4 with output LVDS-1 (none by udev)

 

내가 만든건.. 일단 ABS로 하긴 했지만 pointer 디바이스로 인식..

이제 어떻게 하면 touch로 하냐가 문제네

[08:40:03.449] event4  - vnc virtual keyboard driver: is tagged by udev as: Keyboard
[08:40:03.450] event4  - vnc virtual keyboard driver: device is a keyboard
[08:40:03.450] evdev_device_create:856
[08:40:03.450] evdev_device_create:865 // LIBINPUT_DEVICE_CAP_KEYBOARD
[08:40:03.450] libinput: configuring device "vnc virtual keyboard driver".
[08:40:03.450] associating input device event4 with output LVDS-1 (none by udev)
[08:40:03.453] event5  - TouchPad: is tagged by udev as: Mouse
[08:40:03.453] event5  - TouchPad: device is a pointer
[08:40:03.454] evdev_device_create:856
[08:40:03.454] evdev_device_create:871 // LIBINPUT_DEVICE_CAP_POINTER
[08:40:03.454] libinput: configuring device "TouchPad".
[08:40:03.454] input device event5 has no enabled output associated (none named), skipping calibration for now.
[08:40:03.454] associating input device event5 with output LVDS-1 (none by udev)

 

'프로그램 사용 > wayland' 카테고리의 다른 글

weston 커서 숨기기  (0) 2024.02.26
wayland hdmi - touch 연결  (0) 2023.09.08
wayland atomic commit 패치?  (0) 2022.08.22
weston screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
Posted by 구차니