Results 1 to 7 of 7

Thread: QT embedded and HID mouse, can i?

  1. #1
    Join Date
    May 2008
    Location
    Spain
    Posts
    92
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QT embedded and HID mouse, can i?

    Hello,

    I have some doubts about QT and this kind of mouse.

    1.- Can I use a HID mouse (touch screen TSC-10/USB) with QT embedded?
    2.- If I can use it, QT embedded can use it without special driver or is it necessary to install a driver for touch screen?? TSLIB can not handle this kind of touch screen, only touch screen detected as input / event .
    3.- If I can use it without driver, how can I configurate QT embedded to work with this device??

    best regards
    John Martin

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QT embedded and HID mouse, can i?

    I think you need to have a tslib enabled device... Qt doesn't handle such low-level things.

  3. #3
    Join Date
    May 2008
    Location
    Spain
    Posts
    92
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT embedded and HID mouse, can i?

    Quote Originally Posted by wysota View Post
    I think you need to have a tslib enabled device... Qt doesn't handle such low-level things.
    Hello wysota,

    The problem is TSLIB can not handle this kind of devices, it is necessary to add support for this touch screen.

    Well, I try to look for more information about how to obtain support for it.

    Thank you

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QT embedded and HID mouse, can i?

    Maybe you can do that through evdev?

  5. #5
    Join Date
    May 2008
    Location
    Spain
    Posts
    92
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT embedded and HID mouse, can i?

    Hello wysota,

    Well, I have made some test with evdev, and it works with my touch screen.
    I have found a test program and it works fine.


    Qt Code:
    1. #include <stdlib.h>
    2. #include <stdio.h>
    3. #include <sys/ioctl.h>
    4. #include <sys/types.h>
    5. #include <sys/stat.h>
    6. #include <asm/types.h>
    7. #include <fcntl.h>
    8. #include <unistd.h>
    9. #include <stdint.h>
    10.  
    11. #include <linux/input.h>
    12.  
    13.  
    14. int main (int argc, char **argv) {
    15.  
    16. int fd = -1; /* the file descriptor for the device */
    17. int yalv; /* loop counter */
    18. size_t read_bytes; /* how many bytes were read */
    19. struct input_event ev[64]; /* the events (up to 64 at once) */
    20.  
    21. /* read() requires a file descriptor, so we check for one, and then open it */
    22. if (argc != 2) {
    23. fprintf(stderr, "usage: %s event-device - probably /dev/input/evdev0\n", argv[0]);
    24. exit(1);
    25. }
    26. if ((fd = open(argv[1], O_RDONLY)) < 0) {
    27. perror("evdev open");
    28. exit(1);
    29. }
    30.  
    31. while (1)
    32. {
    33. read_bytes = read(fd, ev, sizeof(struct input_event) * 64);
    34.  
    35. if (read_bytes < (int) sizeof(struct input_event)) {
    36. perror("evtest: short read");
    37. exit (1);
    38. }
    39.  
    40. for (yalv = 0; yalv < (int) (read_bytes / sizeof(struct input_event)); yalv++)
    41. {
    42. printf("Event: time %ld.%06ld, type %d, code %d, value %d\n",
    43. ev[yalv].time.tv_sec, ev[yalv].time.tv_usec, ev[yalv].type,
    44. ev[yalv].code, ev[yalv].value);
    45.  
    46. }
    47. }
    48.  
    49. close(fd);
    50.  
    51. exit(0);
    52. }
    To copy to clipboard, switch view to plain text mode 

    But I have a doubt, how can I use it with QT???

    best regards
    John Martin
    Last edited by wysota; 3rd September 2008 at 12:41. Reason: Changed [quote] into [code]

  6. #6
    Join Date
    May 2008
    Location
    Spain
    Posts
    92
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT embedded and HID mouse, can i?

    Hello wysota,

    Now it works fine. Finally , i use TSLIB with my touchscreen, TSC-10 DM.
    The main problem was that TSLIB can not handle my touch screen, but now I known the reason.
    TSLIB, check the device and look for some events, EV_ABS , ABS_X, ABS_Y and ABS_PRESSURE.
    Well, my touch has not ABS_PRESSURE event.
    Now I have made some changes in input-raw plugin and now it works fine.

    I supposed that my touch screen works fine with TSLIB, QT can use my touch screen with TSLIB without any problem.

    Best regards.

  7. #7
    Join Date
    Sep 2008
    Posts
    22
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QT embedded and HID mouse, can i?

    I have a problem with my touchscreen if you can help me.
    I can use ts_calibrate successfully but i can't use the touch screen in a QT application.
    It isn't detected?
    If you can see this thread http://www.qtcentre.org/forum/f-qtop...qte-15805.html

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.