Autor Tema: Touchscreen input  (Leído 9744 veces)

Jongf7

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 1
Touchscreen input
« en: Diciembre 21, 2009, 02:17:10 pm »
There is a full hd touch screen that I can use, and I would like to make a simple game to make people familiar with using it.
The 'game' so far works perfectly with a normal mouse, but when using the touch screen the mouse pointer doesn't follow my finger.
It seems to 'stick' to the edges of the screen and even there doesn't follow my finger.
In windows the screen works fine.

Any one that has a clue as to how a touch screen differs from a mouse and if there is a workaround for this?

Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Touchscreen input
« Respuesta #1 en: Diciembre 21, 2009, 08:03:04 pm »
I think it is not possible to change the position of the mouse on the way it is done on a touch screen... I can't help you, but maybe Splinter... :(
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Drumpi

  • Hero Member
  • *****
  • Mensajes: 6340
  • Karma: 162
  • Odio el periodo "entre proyectos"
    • La web de Drumpi
Re: Touchscreen input
« Respuesta #2 en: Diciembre 22, 2009, 02:26:51 am »
Thats is because touchscreen is not a mouse. It act like a mouse, but uses different drivers and can do something different.
I have a wacom tablet (a touch tablet with a pencil) an i tried to use it as a mouse, but if I put the pen in, the cursor don't point, it act like a analog joystick: if i put the pen in the center, muse dont move, if i touch a little bit up, the mouse moves slowly up, if i touch far up, cursor moves up faster... until i stop touch.

Maybe it works similar, maybe it works good, or maybe it don't works, so you need to write your own module in this case. Just ask to SDL.
Hala, como con 1001 procesos sólo va a 9 FPS, vamos a meterle 32 veces más, a ver si revienta.
(Drumpi epic moment)

SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12905
  • Karma: 378
Re: Touchscreen input
« Respuesta #3 en: Diciembre 22, 2009, 02:02:11 pm »
BennuGD (SDL) only support touchscreen mouse's compatible.

maybe you need create a new bennugd handler (module) for manage it.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

Jongf7

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 1
Re: Touchscreen input
« Respuesta #4 en: Diciembre 23, 2009, 08:18:14 am »
I'm going to try what happens when I control the screen as a joystick, if that doesn't work I will have to put this project on hold as I cannot program DLL files :)
I only know DIV/Fenix/Bennu.

But I'm glad I tried to create something for the screen as it led me to this community, you guys are all very helpful, so I'm really eager to start programming again now :) I even have some ideas for the contest already. Not to win, but just for the fun :)

josebita

  • Administrator
  • *****
  • Mensajes: 4039
  • Karma: 257
    • BennuGD Mobile Worklog
Re: Touchscreen input
« Respuesta #5 en: Diciembre 24, 2009, 01:32:34 am »
If you have ideas for the contest... hurry up! there's not much time left :)

Jongf7

  • Newbie
  • *
  • Mensajes: 19
  • Karma: 1
Re: Touchscreen input
« Respuesta #6 en: Diciembre 25, 2009, 07:08:07 am »
I already started working :)
I will email SplinterGU to get a place to post a worklog and some screenshots soon.

I try to make a race game with a rare graphical style.

quasist

  • Newbie
  • *
  • Mensajes: 30
  • Karma: 0
  • let_me_alone();
Re: Touchscreen input
« Respuesta #7 en: Diciembre 31, 2009, 08:48:31 pm »
Is bennu on GP2X WIZ is also is unable to read touchscreen? If it can then please post some code :)
Function Int Write_Signature()
Private
Begin
End;

josebita

  • Administrator
  • *****
  • Mensajes: 4039
  • Karma: 257
    • BennuGD Mobile Worklog
Re: Touchscreen input
« Respuesta #8 en: Enero 01, 2010, 04:21:19 pm »
Bennu in the Wiz can also read the touchscreen, yes.

For what I know, to detect the touchscreen input, you just have to wait for mouse.left and then get the mouse.x & mouse.y vars to read the place where the user clicked.
This would be something like:
[code language="bennu"]
Process touchscreen_test()
Private
    int was_clicked=0;

Begin
    LOOP
        // It's usual to detect clicks when the user releases the mouse button, not when they click it
        if( (was_clicked==1) && (! mouse.left))
            say("Touchscreen event @ x:"+mouse.x+" y:"+mouse.y);
        end;

        was_clicked = mouse.left;
        FRAME
    End;
End;
[/code]
« última modificación: Enero 01, 2010, 04:31:45 pm por josebita »