The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]



"Выпуск OpenBSD 7.1"
Версия для распечатки Пред. тема | След. тема
Форум Разговоры, обсуждение новостей
Исходное сообщение [ Отслеживать ]
Подсказка: Ссылки "<<" и ">>" открывают первые и последние 10 сообщений.
. "Выпуск OpenBSD 7.1" +/
Сообщение от n00by (ok), 25-Апр-22, 09:32 
Мне не весело ходить по ссылке, по которой нет каких-либо исходников со смыслом, но есть другая ссылка, из которой я должен догадаться о назначении демона. Вот фрагмент драйвера, похоже, сообщающий системе о касаниях:


static void fermi_input_event(struct usb_fermi *dev, struct fermi_touch_report_t *touch_report)
{
#ifdef MULTITOUCH
    int i;
    int count = min(touch_report->count, (unsigned char)2);
    // multitouch
    for (i = 0; i < count; i++)
    {
        input_report_abs(dev->input_dev, ABS_MT_TRACKING_ID, touch_report->touch[i].id);
        input_report_abs(dev->input_dev, ABS_MT_POSITION_X, touch_report->touch[i].x);
        input_report_abs(dev->input_dev, ABS_MT_POSITION_Y, touch_report->touch[i].y);
        // we just set width and height to 1 now for android 2.x as it seems to need it
        input_report_abs(dev->input_dev, ABS_MT_TOUCH_MAJOR, NW1950_DEFAULT_W);
        input_report_abs(dev->input_dev, ABS_MT_TOUCH_MINOR, NW1950_DEFAULT_H);
        input_mt_sync(dev->input_dev);
    }
#endif
    // mouse
    if (touch_report->touch[0].state == FERMI_TOUCH_DOWN ||
        touch_report->touch[0].state == FERMI_TOUCH ||
        touch_report->touch[0].state == FERMI_TOUCH_UP ||
        touch_report->touch[0].state == FERMI_TOUCH_HOVER)
    {
        input_report_key(dev->input_dev, BTN_LEFT, touch_report->touch[0].state == FERMI_TOUCH_UP ? 0 : 1);
        input_report_abs(dev->input_dev, ABS_X, touch_report->touch[0].x);
        input_report_abs(dev->input_dev, ABS_Y, touch_report->touch[0].y);
    }
    // sync
    input_sync(dev->input_dev);
    //printk("fermi_write BTN_LEFT: %d, BTN_RIGHT: %d, ABS_X: %d, ABS_Y: %d\n", button & 1, button & 2, x , y);
}

Ответить | Правка | Наверх | Cообщить модератору

Оглавление
Выпуск OpenBSD 7.1, opennews, 22-Апр-22, 09:30  [смотреть все]
Форумы | Темы | Пред. тема | След. тема



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру