• Welcome to Dark Bit Factory & Gravity.
 

Mouse And Cursor Keys Help.

Started by Shockwave, May 17, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Shockwave

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:

Shockwave

Bah! Can't get it to work at all :(
Shockwave ^ Codigos
Challenge Trophies Won:

Shockwave

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;


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:

Clyde

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:

Shockwave

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:

Clyde

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:

Shockwave

Maybe there's a port that can be peeked or something to find it..
Shockwave ^ Codigos
Challenge Trophies Won:

Clyde

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:

Shockwave

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:

Clyde

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:

TinDragon

#10
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.

Shockwave

That's good stuff, thanks Jon.
Shockwave ^ Codigos
Challenge Trophies Won: