'프로그램 사용'에 해당되는 글 2190건

  1. 2024.03.12 touchscreen 장치 프로토콜 분석
  2. 2024.03.12 uinput 으로 touchscreen을 만들기
  3. 2024.03.11 weston evdev libinput
  4. 2024.03.09 ventoy pfsense 실패
  5. 2024.02.26 weston 커서 숨기기
  6. 2024.02.13 libreoffice에서 italic으로 자동 변환 막기
  7. 2024.02.05 nat reflection
  8. 2024.02.02 QUIC
  9. 2024.02.01 bogon network
  10. 2024.01.30 pfsense 비프음 끄기
프로그램 사용/uinput2024. 3. 12. 18:17

대충 봐선(?)

protocol A에 ABS_X, ABS_Y를 추가한 변종(?) 같긴한데

 

아래는 한번 터치해서 클릭하는 내용

BTN_TOUCH로 눌렸다 떼었다 라는 걸 보내주는데

깔끔(?) 하게 원격으로 좌표 + 떼어라 만 보내도 되는지 테스트 해봐야 할 듯 (눌렀다 없이 떼었다가 될지 모르겠음)

 

그 와중에 ABS_MT_TRACKING_ID는 왜 음수 값이 나오지?

 

세번의 터치가 있었는데(터치 1회, 드래그, 줌 인)

그 때 마다 ABS_MT_TRACKING_ID가 증가하고 매번 -1 로 BTN_TOUCH 0 을 누르기 전에 트래킹이

사용되지 않는다는걸 알려주는건가..?

마지막의 Tracking_id 2,3은 두 손가락으로 줌 인 한 거라, 각각의 손가락에 대해서 처리하는 듯

 

A non-negative tracking id is interpreted as a contact, and the value -1 denotes an unused slot

[링크 : https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt]

Posted by 구차니
프로그램 사용/uinput2024. 3. 12. 11:03

아래와 같이 설정하면 BTN_LEFT, BTN_RIGHT 때문에, udev에서 Mouse Touchscreen으로 인식된다.

    int keys[] = {BTN_LEFT, BTN_RIGHT, BTN_TOUCH};

    fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);

    //Custom key events init
    ioctl(fd, UI_SET_EVBIT, EV_KEY);
    for(int i = 0; i < sizeof(keys) / sizeof(int); i++){
        ioctl(fd, UI_SET_KEYBIT, keys[i]);
    }
[01:49:49.721] event5  - virtual touch driver: is tagged by udev as: Mouse Touchscreen
[01:49:49.722] event5  - virtual touch driver: kernel bug: device has min == max on ABS_MT_POSITION_X
[01:49:49.722] event5  - virtual touch driver: was rejected
[01:49:49.722] event5  - using input device '/dev/input/event5'

 

그래서 BTN_TOUCH만 넣으면 Mouse는 빠지고 Touchscreen만 뜨는데, 도대체 커널 버그 쪽은 어떻게 해결해야 할까?

    int keys[] = {BTN_TOUCH}; // BTN_LEFT, BTN_RIGHT

    fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);

    //Custom key events init
    ioctl(fd, UI_SET_EVBIT, EV_KEY);
    for(int i = 0; i < sizeof(keys) / sizeof(int); i++){
        ioctl(fd, UI_SET_KEYBIT, keys[i]);
    }
[01:50:22.720] event5  - virtual touch driver: is tagged by udev as: Touchscreen
[01:50:22.720] event5  - virtual touch driver: kernel bug: device has min == max on ABS_MT_POSITION_X
[01:50:22.720] event5  - virtual touch driver: was rejected
[01:50:22.720] event5  - not using input device '/dev/input/event5'

 

+

chatGPT 응답해준 것을 조합하면 아래와 같이 하면

일단 터치 장비로 인식은 되는데.. 커서도 안되고 터치 이동, 클릭을 어떻게 구현해야 하나...

void initializeTouchEvent(int fd) {
    struct uinput_setup usetup;
    int keys[] = {BTN_TOUCH}; // BTN_LEFT, BTN_RIGHT, 

    fd = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
    ioctl(fd, UI_SET_EVBIT, EV_KEY);

    // 사용할 키 등록(터치니까 BTN_TOUCH 만, BTN_LEFT 나 BTN_RIGHT가 등록되면 마우스로 인식됨)
    for(int i = 0; i < sizeof(keys) / sizeof(int); i++){
       ioctl(fd, UI_SET_KEYBIT, keys[i]);
    }

    ioctl(fd, UI_SET_EVBIT, EV_ABS);
    ioctl(fd, UI_SET_ABSBIT, ABS_MT_SLOT);
    ioctl(fd, UI_SET_ABSBIT, ABS_MT_POSITION_X);
    ioctl(fd, UI_SET_ABSBIT, ABS_MT_POSITION_Y);
    ioctl(fd, UI_SET_ABSBIT, ABS_MT_TRACKING_ID);  // 요건 없어도 되는 듯
    ioctl(fd, UI_SET_EVBIT, EV_SYN);

    struct uinput_abs_setup abs_setup_x;
    struct uinput_abs_setup abs_setup_y;
    memset(&abs_setup_x, 0, sizeof(abs_setup_x));
    memset(&abs_setup_y, 0, sizeof(abs_setup_y));
    abs_setup_x.code = ABS_MT_POSITION_X;
    abs_setup_x.absinfo.minimum = 0; // 최솟값
    abs_setup_x.absinfo.maximum = 1024; // 최댓값
    abs_setup_y.code = ABS_MT_POSITION_Y;
    abs_setup_y.absinfo.minimum = 0; // 최솟값
    abs_setup_y.absinfo.maximum = 1024; // 최댓값

    ioctl(fd, UI_SET_ABSBIT, ABS_MT_POSITION_X);
    ioctl(fd, UI_SET_ABSBIT, ABS_MT_POSITION_Y);
    ioctl(fd, UI_ABS_SETUP, &abs_setup_x);
    ioctl(fd, UI_ABS_SETUP, &abs_setup_y);

    // 가상 디바이스를 생성
    memset(&usetup, 0, sizeof(usetup));
    usetup.id.bustype = BUS_USB;
    usetup.id.vendor = 0x1;
    usetup.id.product = 0x1;
    strcpy(usetup.name, "Virtual Touch Device");

    ioctl(fd, UI_DEV_SETUP, &usetup);
    ioctl(fd, UI_DEV_CREATE);
}
Posted by 구차니
프로그램 사용/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 구차니

2.6.0 까지 테스트 되었다고

[링크 : https://www.ventoy.net/en/distro_iso/pfsense.html]

 

현재 최신 버전은 2.7.2

[링크 : https://www.pfsense.org/download/]

 

마운트하다 에러발생

[링크 : https://forums.ventoy.net/showthread.php?tid=2308]

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

pfsense mac에 ip 할당하기  (0) 2024.03.22
pfsense on proxmox  (0) 2024.03.21
nat reflection  (0) 2024.02.05
QUIC  (0) 2024.02.02
bogon network  (0) 2024.02.01
Posted by 구차니
프로그램 사용/wayland2024. 2. 26. 16:48

weston.ini 에 추가해서 아예 커서를 그리지 않게 하는 방법

static void
pointer_set_cursor(struct wl_client *client, struct wl_resource *resource,
   uint32_t serial, struct wl_resource *surface_resource,
   int32_t x, int32_t y)
{
struct weston_pointer *pointer = wl_resource_get_user_data(resource);
struct weston_surface *surface = NULL;

if (!pointer)
return;

if (surface_resource)
surface = wl_resource_get_user_data(surface_resource);

if (pointer->focus == NULL)
return;
/* pointer->focus->surface->resource can be NULL. Surfaces like the
black_surface used in shell.c for fullscreen don't have
a resource, but can still have focus */
if (pointer->focus->surface->resource == NULL)
return;
if (wl_resource_get_client(pointer->focus->surface->resource) != client)
return;
if (pointer->focus_serial - serial > UINT32_MAX / 2)
return;

if (!surface) {
if (pointer->sprite)
pointer_unmap_sprite(pointer);
return;
}

if (pointer->sprite && pointer->sprite->surface == surface &&
    pointer->hotspot_x == x && pointer->hotspot_y == y)
return;

if (!pointer->sprite || pointer->sprite->surface != surface) {
if (pointer->seat->compositor->hide_cursor)
return;

if (weston_surface_set_role(surface, "wl_pointer-cursor",
    resource,
    WL_POINTER_ERROR_ROLE) < 0)
return;

if (pointer->sprite)
pointer_unmap_sprite(pointer);

wl_signal_add(&surface->destroy_signal,
      &pointer->sprite_destroy_listener);

surface->committed = pointer_cursor_surface_committed;
surface->committed_private = pointer;
weston_surface_set_label_func(surface,
    pointer_cursor_surface_get_label);
pointer->sprite = weston_view_create(surface);
}

pointer->hotspot_x = x;
pointer->hotspot_y = y;

if (surface->buffer_ref.buffer) {
pointer_cursor_surface_committed(surface, 0, 0);
weston_view_schedule_repaint(pointer->sprite);
}
}

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/345/diffs]

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/blob/f964b59c8af8505422cac79de2466e0a31702a0d/libweston/input.c]

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

weston evdev libinput  (0) 2024.03.11
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 구차니

calc에서 url 치는데 자꾸 italic 으로 기울여 쓰기 해서

검색해보니 자동고침에서  /문자열/ 의 경우 자동으로 바꾼다고..

리눅스 개발자도 좀 배려해달라!

[링크 : https://ask.libreoffice.org/t/lo-changing-text-to-italics/61544]

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

libreoffice hwp 확장  (0) 2023.10.11
libreoffice calc 중복제거  (0) 2023.08.05
libreoffice OpenCL 적용하기  (0) 2023.08.04
리브레 오피스 Calc 중복제거  (0) 2020.11.05
리브레 오피스 내보내기 - PDF  (0) 2020.09.22
Posted by 구차니

nat 내부에서 외부 아이피를 통해 내부 서비스를 접속하게 하는 기능

pfsense나 opnsense cisco 쪽 검색이.걸려나오네

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

pfsense on proxmox  (0) 2024.03.21
ventoy pfsense 실패  (0) 2024.03.09
QUIC  (0) 2024.02.02
bogon network  (0) 2024.02.01
pfsense 비프음 끄기  (0) 2024.01.30
Posted by 구차니

QUIC는 퀵이라고 읽고 Quick UDP Internet Connections 라고 제안은 되었지만

약자가 아닌 단순히 프로토콜의 이름이다. 라는 개뼉다구 같은(?) 설명이라니!

 

Although its name was initially proposed as the acronym for "Quick UDP Internet Connections",[3][8] IETF's use of the word QUIC is not an acronym; it is simply the name of the protocol.[1]

[링크 : https://ko.wikipedia.org/wiki/QUIC]

 

아무튼 요즘 공유기가 자꾸 터지는데, suricata로 차단해두니 먼가 걸려나와서 이건가.. 고민중

1초에 3번이면 머지.. 그 와중에 Dst 쪽인디...

 

아무튼 QUIC 프로토콜을 통해 DDNS로도 가능한 듯. (QUIC 폭주 / QUIC 반사 공격)

[링크 : https://www.cloudflare.com/ko-kr/learning/ddos/what-is-a-quic-flood/]

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

ventoy pfsense 실패  (0) 2024.03.09
nat reflection  (0) 2024.02.05
bogon network  (0) 2024.02.01
pfsense 비프음 끄기  (0) 2024.01.30
pfsensr multiple wan  (0) 2024.01.27
Posted by 구차니

pfsense 보다 보니 bogon network라는 말이 나와서 검색해보니

존재해서는 안될 네트워크 주소를 그렇게 표현하는 듯

은하수를 여행하는 히치하이커.. 에서 나온 그 보곤족인줄 알았는데 그건도 아닌가 보네

 

Bogon networks are those which should never be seen on the Internet, including reserved and unassigned IP address space.

[링크 : https://docs.netgate.com/pfsense/en/latest/firewall/rule-methodology.html#block-bogon-networks]

 

 

 

 

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

nat reflection  (0) 2024.02.05
QUIC  (0) 2024.02.02
pfsense 비프음 끄기  (0) 2024.01.30
pfsensr multiple wan  (0) 2024.01.27
pfsense lan bridge  (0) 2024.01.26
Posted by 구차니
프로그램 사용/pfsense2024. 1. 30. 16:22

웹에서 로그인 할때 삑 소리가 사라진다. (대신 로그가 남으려나?)

 

요건 전체 시스템(부팅 음 이라던가?) 라는데 적용이 안되는 듯..

[링크 : https://docs.netgate.com/pfsense/en/latest/hardware/disable-sounds.html]

 

걍.. 스피커 뽑아?

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

QUIC  (0) 2024.02.02
bogon network  (0) 2024.02.01
pfsensr multiple wan  (0) 2024.01.27
pfsense lan bridge  (0) 2024.01.26
pfsense 무선랜 추가 실패 -_ㅠ  (0) 2024.01.23
Posted by 구차니