Mouse and Windowed mode 2

Previous topic - Next topic

Kuron

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.

Kitty Hello

What version are you using? What OS are you working on?

Kuron

Apologies, Latest version 4.015, and XP SP2

BumbleBee

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
The day will come...

CPU Intel(R) Core(TM) i5-3570k, 3.4GHz, AMD Radeon 7800 , 8 GB RAM, Windows 10 Home 64Bit

Kuron

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 :/

BumbleBee

Sorry, I have forgotten this:

  SYSTEMPOINTER TRUE

The return of the pointer.:)

Hope it works now.

Cheers
The day will come...

CPU Intel(R) Core(TM) i5-3570k, 3.4GHz, AMD Radeon 7800 , 8 GB RAM, Windows 10 Home 64Bit

Kuron

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:

Kitty Hello

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

Kuron

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?