Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: Fujitsu T1010 touchscreen and Kubuntu experience

  1. #11
    Join Date
    Mar 2009
    Beans
    1

    Exclamation Re: Fujitsu T1010 touchscreen and Kubuntu experience

    Hi there!
    Maybe we could use our Touchscreen without writing a driver: I just booted Open Solaris as i've heard that the Touchscreen works there and indeed - The T1010 can be touched
    But im not eager to learn solaris, maybe there is a way to port the driver? Somebody more experienced than me?
    Im gonna try some other Live Systems... just checking.

  2. #12
    Join Date
    Dec 2007
    Beans
    88

    Re: Fujitsu T1010 touchscreen and Kubuntu experience

    using XWarpPointer and fopen I was able to cobble together an app to move the curser using the touch screen.

    I am going to work on implementing clicks next, I will probably track a system timer if I can find the code for it. EDIT: Got the timing ready for clicks, I need to find the function to call the mouse down, and mouse up events Edit: Clicks are now implemented and work properly

    I am somewhat of a linux newb so I don't know how to open the device without root access, if it segment faults it is because it doesn't have privileges to open the /dev/hidraw0

    Here is the source:
    //g++ -pthread -lX11 -lXtst -L/usr/X11R6/include t1010touch.cpp -otdriver.o
    #include <X11/Xlib.h>
    #include <X11/extensions/XTest.h>
    #include <stdio.h>
    #include <string.h>
    #include <iostream>
    #include <pthread.h>

    #define minX 55
    #define maxX 3848 //3903 - 55
    #define minY 234
    #define maxY 3793 //4027 - 234
    #define width 1280 //screen width
    #define height 800 //screen height

    int state = 0;
    int mouse = 0;
    //XEvent event;
    Display *display;

    void *timerThread(void *threadid)
    {
    int lastState = state;
    timespec * rqtp;
    timespec * rmtp;
    while(true)
    {
    usleep(100000);
    if((state==0)&&(lastState==1))
    {
    mouse = 0;
    std::cout << "\n";
    XTestFakeButtonEvent(display, 1, 0, CurrentTime);
    XFlush(display);
    }
    lastState = state;
    state=0;
    }
    }

    int main()
    {
    //X11 init
    Window root;
    Window child;
    XWindowAttributes root_attributes;
    display=XOpenDisplay(0);
    root = XRootWindow(display,0);
    XSelectInput(display,root,KeyReleaseMask);
    child = root;
    std::cout << "X11 ready!\n";

    //file input init
    char infile[] = "/dev/hidraw0";
    FILE *input;
    input = fopen(infile, "rb");
    std::cout << "file open!\n";

    //timer thread init
    pthread_t thread;
    pthread_attr_t attr;
    pthread_attr_init(&attr);
    pthread_create (&thread,&attr,timerThread,NULL);

    //state machine init
    int temp;
    unsigned int mask;
    int xr = 0, yr = 0;
    int xp = 0, yp = 0;
    int x = 0, y = 0;
    int count = 0;

    while(1)
    {
    temp = (int)getc(input);
    switch(count)
    {
    case 0:
    if((temp!=0x21)&&(temp!=0x20))
    count--;
    break;
    case 1:
    x |= temp;
    break;
    case 2:
    x |= temp << 8;
    break;
    case 3:
    y |= temp;
    break;
    case 4:
    y |= temp << 8;
    std::cout << "\r(" << x << "," << y << ")\t";
    x = (int)((double)(x-minX)/maxX*width);
    y = (int)((double)(y-minY)/maxY*height);
    XQueryPointer(display, root, &root, &child, &xr, &yr, &xp, &yp, &mask);
    XGetWindowAttributes(display, root, &root_attributes);
    XWarpPointer(display, NULL, NULL, 0, 0, 0, 0, x-xp-root_attributes.x, y-yp-root_attributes.y);
    std::cout << " (" << x << "," << y << ") ";
    if(mouse==0)
    {

    mouse=1;
    XTestFakeButtonEvent(display, 1, 1, CurrentTime);
    XFlush(display);
    }
    x = 0;
    y = 0;
    state = 1;
    break;
    default:
    count=0;
    break;
    }
    count ++;
    }
    return 0;
    }
    Last edited by vertago1; March 17th, 2009 at 10:53 PM.

  3. #13
    Join Date
    Jul 2006
    Beans
    6

    Re: Fujitsu T1010 touchscreen and Kubuntu experience

    vertago1, could you please explain how to use that code?

    I saved it as t1010touch.cpp, then installed libx11-dev and libxtst-dev, and run:

    g++ -pthread -lX11 -lXtst -L/usr/X11R6/include t1010touch.cpp -otdriver.o

    No error messages. Got a file called tdriver.o, what do I do with it? What else should I do?

    Thanks
    Last edited by gcai; April 9th, 2009 at 03:08 AM.

  4. #14
    Join Date
    Dec 2007
    Beans
    88

    Re: Fujitsu T1010 touchscreen and Kubuntu experience

    well when I execute it I go to the directory of the tdriver.o file and use the command:

    sudo ./tdriver.o

    I want to put a disclaimer here though. Anytime you run someones code as a root user you ought to have a good idea about what it does. I don't recommend running this on any computer except the fujitsu lifebook T1010, but it may work for other computers if they send the same data over usb.

    if you notice the code has the line: char infile[] = "/dev/hidraw0";
    this is the device the code opens. Your kernel must have already created this device for my code to work. If you are using one of the newer ubuntu distributions on a T1010 it should be there. If you don't run the program with sudo or root it gives a seg-fault because of the privileges on /dev/

    If there is a way to run it without sudo or su root, please let me know.

    Also, Note that at the top of the code there are some constants you can set to calibrate the program. You may want to comment out the lines which trigger the click events so that you can read the output on the screen for testing the min and max of your screen. I recommend using the top, and bottom center to measure the min and max Y, while using the left and right center to measure the min and max X. The first set of numbers is the output of the device, and the second set of numbers is the location the program will move the mouse to.

    Edit: I plan on doing an update to it eventually to have an input for each corner of the touch pad and do a better mapping so that the calibration is better, but that will have to wait for when I have more free time.
    Last edited by vertago1; April 9th, 2009 at 06:09 AM.

  5. #15
    Join Date
    Jul 2006
    Beans
    6

    Re: Fujitsu T1010 touchscreen and Kubuntu experience

    Thanks a lot. It's working. I only had to change the 1280 and 800 to my resolution: 1024 and 768.
    You rock!

  6. #16
    Join Date
    Jul 2009
    Location
    Toulouse, France
    Beans
    20
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: Fujitsu T1010 touchscreen and Kubuntu experience

    Just to inform that an other driver is avaible here : http://spareinfo.blogspot.com/2009/0...screen-iv.html
    A calibration script is also avaible, and screen rotation is also supported.

  7. #17
    Join Date
    Dec 2007
    Beans
    88

    Re: Fujitsu T1010 touchscreen and Kubuntu experience

    Thanks a ton, downloaded that other driver and got it installed, I am going to run the calibration script, but thanks for posting that link.

  8. #18
    Join Date
    Jul 2009
    Location
    Toulouse, France
    Beans
    20
    Distro
    Xubuntu 10.04 Lucid Lynx

    Exclamation Re: Fujitsu T1010 touchscreen and Kubuntu experience

    As said in the last news on the spareinfo blog, you must use the version 3.5 of the source package to get the calibration working properly.
    On my system, MaxX and MaxY displays always -1 in the calibration script with the previous version (3.4).

    We don't know why I've got this behaviour on my Xubuntu 9.04, but the latest version is OK now.

  9. #19
    Join Date
    Jul 2009
    Beans
    1

    Re: Fujitsu T1010 touchscreen and Kubuntu experience

    Hello,
    I'd like to buy a Fujitsu T1010, so I searched some infos about this laptop on linux, but I didn't found anything except this site. Does somebody can tell me how it works on linux? It's a good notebook or should I search another?
    Is the touchscreen really good working, no problems with the drivers?

    Thank you!

  10. #20
    Join Date
    Dec 2007
    Beans
    88

    Re: Fujitsu T1010 touchscreen and Kubuntu experience

    I am running Kubuntu 9.04 x86_64 on mine, the function keys, acpi, and wireless work from install. If you want to get the touch screen to work you need to install the driver at the link here:
    Quote Originally Posted by draco31.fr
    Re: Fujitsu T1010 touchscreen and Kubuntu experience
    Just to inform that an other driver is avaible here : http://spareinfo.blogspot.com/2009/0...screen-iv.html
    A calibration script is also avaible, and screen rotation is also supported.
    I was able to resize the vista partition and dual boot. I even moved both oses to a ssd later, but the recovery partition didn't migrate well. I haven't tried any other tablets with linux, but if you want to use the touch-screen there are softwares like Xournal and Gournal for taking notes, I might look into writing one for QT4 but I would have a learning curve to get over.
    Last edited by vertago1; July 29th, 2009 at 09:12 PM.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

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
  •