blitzbasic

Author Topic: GP2X Caanoo Joystick ansteuern  (Read 567 times)

Offline TheCoder

  • Mc. Print
  • *
  • Posts: 7
  • Immer zuversichtlich bleiben!
    • View Profile
GP2X Caanoo Joystick ansteuern
« 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
Viele Grüße, TheCoder

Kinds of regards, TheCoder

Offline erico

  • Prof. Inline
  • *****
  • Posts: 1990
    • View Profile
    • Portfolio
Re: GP2X Caanoo Joystick ansteuern
« Reply #1 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. ;)

Offline TheCoder

  • Mc. Print
  • *
  • Posts: 7
  • Immer zuversichtlich bleiben!
    • View Profile
Re: GP2X Caanoo Joystick ansteuern
« Reply #2 on: 2012-Jun-11 »
Oh, wow! Thank's a lot! Is there also a code for the touchscreen?
Viele Grüße, TheCoder

Kinds of regards, TheCoder

Offline erico

  • Prof. Inline
  • *****
  • Posts: 1990
    • View Profile
    • Portfolio
Re: GP2X Caanoo Joystick ansteuern
« Reply #3 on: 2012-Jun-11 »
I didn´t do the touch yet.
But that code has the g-sensor reading too :good:

Offline TheCoder

  • Mc. Print
  • *
  • Posts: 7
  • Immer zuversichtlich bleiben!
    • View Profile
Re: GP2X Caanoo Joystick ansteuern
« Reply #4 on: 2012-Jun-11 »
Can you make a program for the Touchscreen, please? Or is it impossible?
Viele Grüße, TheCoder

Kinds of regards, TheCoder

Offline erico

  • Prof. Inline
  • *****
  • Posts: 1990
    • View Profile
    • Portfolio
Re: GP2X Caanoo Joystick ansteuern
« Reply #5 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. ;)

Offline Ian Price

  • Global Moderator
  • Prof. Inline
  • ****
  • Posts: 3122
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: GP2X Caanoo Joystick ansteuern
« Reply #6 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
 

I came. I saw. I played.

Offline erico

  • Prof. Inline
  • *****
  • Posts: 1990
    • View Profile
    • Portfolio
Re: GP2X Caanoo Joystick ansteuern
« Reply #7 on: 2012-Jun-12 »
hehe thanks Ian.

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

Offline erico

  • Prof. Inline
  • *****
  • Posts: 1990
    • View Profile
    • Portfolio
Re: GP2X Caanoo Joystick ansteuern
« Reply #8 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 :-[ :-[
« Last Edit: 2012-Jun-12 by erico »

Offline Ian Price

  • Global Moderator
  • Prof. Inline
  • ****
  • Posts: 3122
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: GP2X Caanoo Joystick ansteuern
« Reply #9 on: 2012-Jun-12 »
No need to over-complicate these things :)
I came. I saw. I played.