GLBasic forum

Other languages => GLBasic - de => Topic started by: TheCoder on 2012-Jun-11

Title: GP2X Caanoo Joystick ansteuern
Post by: TheCoder on 2012-Jun-11
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
Title: Re: GP2X Caanoo Joystick ansteuern
Post by: erico on 2012-Jun-11
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. ;)
Title: Re: GP2X Caanoo Joystick ansteuern
Post by: TheCoder on 2012-Jun-11
Oh, wow! Thank's a lot! Is there also a code for the touchscreen?
Title: Re: GP2X Caanoo Joystick ansteuern
Post by: erico on 2012-Jun-11
I didn´t do the touch yet.
But that code has the g-sensor reading too :good:
Title: Re: GP2X Caanoo Joystick ansteuern
Post by: TheCoder on 2012-Jun-11
Can you make a program for the Touchscreen, please? Or is it impossible?
Title: Re: GP2X Caanoo Joystick ansteuern
Post by: erico on 2012-Jun-11
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. ;)
Title: Re: GP2X Caanoo Joystick ansteuern
Post by: Ian Price on 2012-Jun-12
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


Title: Re: GP2X Caanoo Joystick ansteuern
Post by: erico on 2012-Jun-12
hehe thanks Ian.

and I thought it was gonna take me a while :-[
Title: Re: GP2X Caanoo Joystick ansteuern
Post by: erico on 2012-Jun-12
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]
Title: Re: GP2X Caanoo Joystick ansteuern
Post by: Ian Price on 2012-Jun-12
No need to over-complicate these things :)