Touchscreen input

Started by Jongf7, December 21, 2009, 02:17:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jongf7

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

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

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

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

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

If you have ideas for the contest... hurry up! there's not much time left :)

Jongf7

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

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

#8
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]