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

  1. 2024.03.12 uinput 으로 touchscreen을 만들기
  2. 2024.03.11 weston evdev libinput
  3. 2024.03.09 ventoy pfsense 실패
  4. 2024.02.26 weston 커서 숨기기
  5. 2024.02.13 libreoffice에서 italic으로 자동 변환 막기
  6. 2024.02.05 nat reflection
  7. 2024.02.02 QUIC
  8. 2024.02.01 bogon network
  9. 2024.01.30 pfsense 비프음 끄기
  10. 2024.01.27 pfsensr multiple wan
프로그램 사용/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' 카테고리의 다른 글

nat reflection  (0) 2024.02.05
QUIC  (0) 2024.02.02
bogon network  (0) 2024.02.01
pfsense 비프음 끄기  (0) 2024.01.30
pfsensr multiple wan  (0) 2024.01.27
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' 카테고리의 다른 글

ventoy pfsense 실패  (0) 2024.03.09
QUIC  (0) 2024.02.02
bogon network  (0) 2024.02.01
pfsense 비프음 끄기  (0) 2024.01.30
pfsensr multiple wan  (0) 2024.01.27
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 구차니
프로그램 사용/pfsense2024. 1. 27. 00:21

load balancer 나 ha 용도로 두개 이상의 wan을 연결하고 싶은데 가능한가 검색중

[링크 : https://docs.netgate.com/pfsense/en/latest/multiwan/index.html]

 

+ 2024.01.29

HA로 설정하면 2대의 pfsense가 있어야 하고

두대 사이를 Sync interface 라고 하나의 NIC이 점유하게 될 것 같다.

아래 예제는 ISP와 방화벽을 2중화 하는 예제 같고

[링크 : https://docs.netgate.com/pfsense/en/latest/recipes/high-availability-multi-wan.html]

 

아래는 하나의 ISP에 WAN 포트와 방화벽만 2중화 하는 예제 같은데..

[링크 : https://docs.netgate.com/pfsense/en/latest/recipes/high-availability.html]

 

방화벽은 1개지만 2개의 WAN을 이중화 하는건 없나...?

 

 

CARP VIP 이런 용어가 나와서 검색...

Common Address Redundancy Protocol (CARP) was created by OpenBSD developers as a free, open redundancy solution for sharing IP addresses among a group of network devices.

[링크 : https://docs.netgate.com/pfsense/en/latest/highavailability/index.html#carp-overview]

 

VIP - Virual IP

[링크 : https://docs.netgate.com/pfsense/en/latest/firewall/virtual-ip-addresses.html]

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

bogon network  (0) 2024.02.01
pfsense 비프음 끄기  (0) 2024.01.30
pfsense lan bridge  (0) 2024.01.26
pfsense 무선랜 추가 실패 -_ㅠ  (0) 2024.01.23
pfsense 포트 포워드  (0) 2024.01.22
Posted by 구차니