GLBasic forum

Main forum => GLBasic - en => Topic started by: Kuron on 2006-Nov-27

Title: Mouse and Windowed mode 2
Post by: Kuron on 2006-Nov-27
Gernot, much improved but there are still a couple of issues.  Since I am somewhat new to GLBasic, I may be missing something obvious.  Two of the example programs show the problems.  

1.  Pong - When starting the program in windowed mode, the mouse is stuck in the "hourglass" and doesn't change unless you move the mouse off of the window and then back.
 
2.  One More - When starting the program in windowed mode, the mouse is locked to the client area of the window.  You cannot move it off the window and you cannot click on the minimize or close buttons of the window.
Title: Mouse and Windowed mode 2
Post by: Kitty Hello on 2006-Nov-27
What version are you using? What OS are you working on?
Title: Mouse and Windowed mode 2
Post by: Kuron on 2006-Nov-27
Apologies, Latest version 4.015, and XP SP2
Title: Mouse and Windowed mode 2
Post by: BumbleBee on 2006-Nov-27
Hi Kuron
I have the same problem.
But I found the wrongdoer. :)  It's called MOUSESTATE.
Without MOUSESTATE you will always have the problem.
   
  Do this  in the Pong Example.    

       // Pong      
x=320;y=240
MOUSESTATE x,y,b1,b2

This will fix the problem with the hourglass. Don't ask me why.    
Please try it if it works.

If Gernot knows the problem now, he could fix it.

Cheers
Title: Mouse and Windowed mode 2
Post by: Kuron on 2006-Nov-27
Hmm... That will get rid of the hourglass, but it also gets rid of the mouse altogether.  You cannot click on minimize or close, and you cannot click on other programs, etc as the mouse is completely gone :/
Title: Mouse and Windowed mode 2
Post by: BumbleBee on 2006-Nov-27
Sorry, I have forgotten this:

  SYSTEMPOINTER TRUE

The return of the pointer.:)

Hope it works now.

Cheers
Title: Mouse and Windowed mode 2
Post by: Kuron on 2006-Nov-27
Thank you, that worked like a charm.  

At first I thought it was my coding, but then I got confused when I saw the issues in the above example programs.  Still learning the finer points of GLBasic  :noggin:
Title: Mouse and Windowed mode 2
Post by: Kitty Hello on 2006-Nov-27
When using MOUSESTATE or MOUSEAXIS, the program "knows" you need the mouse and makes direct access to it. So, you don't have a systempointer anymore (which you have with SYSTEMPOINTER TRUE).
A bit stupid, but it saves some work I thought...
Title: Mouse and Windowed mode 2
Post by: Kuron on 2006-Nov-28
I guess what I need to do is use the mouse state stuff to get rid of the hourglass icon, and then track the position of the mouse, then when it gets to either side of the window, turn the pointer on, then turn it back off when it isn't on the sides of the Window?