Can I disable the mouse in a VFP program so that the users only use keystrokes? I also need to maintatin the focus on the main window and eliminate the task bar if possible. Thanks.
Back in the FPDOS days there was a command SET MOUSE OFF, but I just tried it in VFP6 and, while it does not error, it seems to do nothing.
I don't think MS is going to give you a way in Windows to turn off the mouse. But what you can do is be clever and restrict the mouse in various ways. If you could tell us more about what you are trying to do, we might be able to provide more info.
One way would be to set the .MousePointer property of all objects to 13 and ensure that there wasn't any code anywhere which would respond to a mouse click.
Although the mousepointer is hidden, it still works.
In theory any Windows application should be navigable without a mouse!LOL
As FoxDev said, unfortunately you cant. There is always .MOUSEPOINTER = 13, but that is specific to the object and does not apply to menus,title bars,etc...
[color]eliminate the task bar if possible[/color]
If you are speaking of the VFP status bar, use SET STATUS BAR OFF. Jon Hawkins
jonscott8@yahoo.com
The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
If you are going to play with the .MousePointer property You might also look into the .MouseIcon property.
Setting .MousePointer to 99 and mouseIcon to a Transparent Ico file might do the trick David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
Jon was right - what wasn't made very clear was that the menu would need to be disabled, the forms .ControlBox property would need to be .F., etc, etc, all of which respond to a mouse click.
I'm thinking maybe you could have some sort of global handler and check for INKEY("M"=151 (mouse click) or LASTKEY()=151, and disallow the choice if that is true. It might turn out pretty awkward, but if you really wanted to do this, it might be worth exploring.
In FoxPro for Windows 2.x and Visual FoxPro, up from 3.0, SET MOUSE OFF is ignored.
All the posters are right - you can hide the mouse cursor using a custom mouse arrow, but definitively not always.
For example, there is no way to turn the mouse arrow off when the mouse is over the title bar...
My app is a custom Point-Of-Sale system with a user group of about 20 people(average age 65). I developed the app 5 years ago in Dbase and migrated to VFP last month. There is no good reason to incorporate a mouse in the app. This would alos enatil retraining this user group. The system works very well with it's DOS-like interface.
And if you hide mouse with .MousePointer property, then users can stil click the buttons even if they don't see the pointer.
You can move the pointer to some not important area by command MOUSE AT 1, 1 PIXELS and if you execute this command each 100 miliseconds or during each .MouseMove event, then you can be sure that user is not able to do anything with mouse.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.