GP2X Caanoo Joystick ansteuern

Previous topic - Next topic

TheCoder

Hallo,

hier ein weiteres Problem: Ich möchte bei meiner GP2X Caanoo den joystick ansteuern, doch ich weiß nicht, wie das gehen soll. Auch hier funktionieren die Beispiele nicht  :'(
Deshalb, wie funktionieren die Ansteuerungen für den Joystick und die übrigen Tasten?
Über einen Code währe ich sehr glücklich!!!

TheCoder2000
Viele Grüße, TheCoder

Kinds of regards, TheCoder

erico

there is some code to read the joystick and buttons here:

http://www.glbasic.com/forum/index.php?topic=7197.msg60150#msg60150

Some joy/button values might have changed, but you can figure them by running the code too.
Hope it helps. ;)

TheCoder

Oh, wow! Thank's a lot! Is there also a code for the touchscreen?
Viele Grüße, TheCoder

Kinds of regards, TheCoder

erico

I didn´t do the touch yet.
But that code has the g-sensor reading too :good:

TheCoder

Can you make a program for the Touchscreen, please? Or is it impossible?
Viele Grüße, TheCoder

Kinds of regards, TheCoder

erico

It may take a while as I never did it.
But it is simple I guess, it is the same code to deal mouse on desktops. ;)

Ian Price

The touchscreen just uses the mouse position, using MOUSESTATE

Code (glbasic) Select

LOCAL mx,my,b1,b2

WHILE TRUE

MOUSESTATE mx,my,b1,b2

IF b1 THEN DRAWRECT mx,my,16,16,RGB(255,255,255)

SHOWSCREEN

WEND


I came. I saw. I played.

erico

hehe thanks Ian.

and I thought it was gonna take me a while :-[

erico

#8
Ian´s code works perfectly out of the box! :good:

I added a setscreen 320,240,0 to the start of it but I suspect this is actually not needed when your project is set to caanoo compile (but I´m not sure, so I added anyways).

Great precision on the touch side of things :)

Now I´m surprised by the size of the code and double ashamed for thinking it would take time to do :-[ :-[

[attachment deleted by admin]

Ian Price

No need to over-complicate these things :)
I came. I saw. I played.