Author Topic: Mouse And Cursor Keys Help.  (Read 5342 times)

0 Members and 1 Guest are viewing this topic.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Mouse And Cursor Keys Help.
« on: May 17, 2006 »
Been scratching my head over this one, I need to be able to;

Detect the status of the left mouse button
Detect the X+Y mouse position
Detect the up and down arrows

Whilst using tinyptc, getmouse and multikey don't seem to be working for me here.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Mouse And Cursor Keys Help.
« Reply #1 on: May 17, 2006 »
Bah! Can't get it to work at all :(
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Mouse And Cursor Keys Help.
« Reply #2 on: May 17, 2006 »
Ah well I worked out the cursor keys, just in case anyone else needs to detect the cursor keys whilst using tinyptc, you can do it like this;

Code: [Select]
kk=inkey$
if kk=CHR$(255)+"H" then Y=Y-1    :' Up Arrow
if kk=CHR$(255)+"P" then Y=Y+1   :' Down Arrow

It seems that when you press a special key, two characters are placed into the keyboard buffer, the first one always seems to be chr$(255).

I'm still stuck on the mouse though.
If anyone knows how to read the mouse when using this lib I'd really appreciate it :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Mouse And Cursor Keys Help.
« Reply #3 on: May 17, 2006 »
I think for using the mouse you may need to be using gfxlib matey.

As I found GetMouse() And SetMouse() Press F1 in fbide for bringing up extra help by the start of the commands.

Hope it helps.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Mouse And Cursor Keys Help.
« Reply #4 on: May 17, 2006 »
Thanks Clyde, I know about Getmouse and setmouse, also multikey worked for me in gfxlib but I can't get the mouse co-ords whilst using tinyptc.

There must be a work around.
Cheers for looking though mate.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Mouse And Cursor Keys Help.
« Reply #5 on: May 17, 2006 »
No worries mate, I'll keep an eye out for anything useful dude.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Mouse And Cursor Keys Help.
« Reply #6 on: May 17, 2006 »
Maybe there's a port that can be peeked or something to find it..
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Mouse And Cursor Keys Help.
« Reply #7 on: May 19, 2006 »
Dude, I've been asking about using the mouse with TinyPTC, and it's a no goer.
Gfxlib is what people are telling me is the way forward with the mouse matey.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Mouse And Cursor Keys Help.
« Reply #8 on: May 19, 2006 »
Mmm.. If the mouse is connected to the PC though surely the input from it goes somewhere?

Thanks for looking Clyde. I guess I'm just frustrated at it because I can't work it out either.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Mouse And Cursor Keys Help.
« Reply #9 on: May 19, 2006 »
Yeah, I asked on your behalf at FBNet as Im interested in this too, for some user interaction with effects.
There were suggestions of including gfxlib.bi , but according to the replies it doesnt seem pos. But, just thinking possibly you could use tinyptc wrapped in windows gui stuff.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: Mouse And Cursor Keys Help.
« Reply #10 on: May 22, 2006 »
Since TinyPTC is only a GFX Buffer system so you will need to include some form of input detection, maybe FB has some Directinput commands you can use or access to the default winapi keyboard and mouse stuff. But how you can tie them to the PTC buffer for the mouse position might be a problem due to how tinyptc works. Of course if your just looking to detect if the mouse is moved up/down /left/right then it wont matter so much :)

[EDIT]
Having a look at the FB examples theres one called conmouse.bas, which opens a console window and checks mouse position, now it looks like it's using the command thats meant to be part of the libgfx thing but it's not opened a screen so maybe it's possible to use that in some way to detect mouse movement, it wont display the mouse but you could draw your own pointer if you wanted. Other than that I still think that you might be able to use the winapi approach, there's a couple examples of windows programs with a wndproc for event tracking, now if you used that in the background it might work as well.
« Last Edit: May 22, 2006 by TinDragon »

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Mouse And Cursor Keys Help.
« Reply #11 on: May 22, 2006 »
That's good stuff, thanks Jon.
Shockwave ^ Codigos
Challenge Trophies Won: