Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I diable mouse in VFP 6

Status
Not open for further replies.

mstec

Programmer
Oct 23, 2000
10
ZA
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.

Robert Bradley

 
mstec

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

Chris
 
Can I disable the mouse in a VFP program

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
 
mstec

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.

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

Robert Bradley

 
Hello.

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

Grigore Dolghin
 
mstec

Robert's first post answered your question.

The following posts attempted workarounds but

.. ensure that there wasn't any code anywhere which would respond to a mouse click.

remains crucial.

Question for you - why is so important that a user cannot use a mouse in your application?

I developed a entirely keyboard driven application for harsh environments some time back, but the user can still use a mouse if it is available.

That was a compromise but was a lot less costly in time and effort than the alternative workaround compromises with which you are faced.

Chris
 
Chris,

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.

Apprciate your help.
 
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.

Jakub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top