Jump to content
Sign in to follow this  
ZiggyStardust

Need to move away from hotkeyset and blockinputex if possible

Recommended Posts

ZiggyStardust

I have been working on a program for several months and think it is about time to start over. I have a commercial package that runs in the forground and this program I am writing runs in the background. My program is designed to severy limit the keystrokes the user can make in the commercial package and disables the use of the mouse. It also uses HotKeySet for the F1 and F2 keys and they act as macros.I am generally not please with the way things are working.

The HotKeySet is neat but has some issues. It stops execution of the script no matter where it is and jumps to the HotKeySet. That can cause problems. Then if the user just holds down the HotKey you get a wicked "recursion" thing going.

I use BlockInputEx to block all but 6 keys and disable the mouse. The problem I have found with it is that when you block the mouse you also block the MouseClick() and unforutnately this commercial package does not respond to ControlClicks very well. On occasion I am forced to use MouseClick. Lo and behold the users have found that in the brief moment that I enable the mouse, do the mouse click and disable the mouse that they have a working mouse.

I need better and more complete control of both the keyboard and mouse. Something like:

While 1

CheckForKeypress

If KepPressed and Key = F1 then ....

CheckForMouseclick and ignore

Wend

I know that is pretty generic but more or less what I need. I only want to check for a keypress once per loop and need to completely disable the mouse yet still have the MouseClick and ControlClick work. Any ideas?

Share this post


Link to post
Share on other sites
somdcomputerguy

See if this function works out for you. _IsPressed


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
water

So the user is allowed to interact with the commercial package but at the same time you want to limit the allowed keys plus do MouseClicks and ControlClicks?

Why do you want to do that? Why shouldn't the user be in full control what he enters?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
ZiggyStardust

The user shouldn't be in full control when he enters because he can navigate (via a sequence of keystrokes and mouse clicks) to a place where he can launch every nuclear weapon in the U.S. arsnel. I don't want him to be able to do that ;)

Share this post


Link to post
Share on other sites
water

But if it's a commercial package (ERP like SAP or whatever) it should be possible to revoke permission to "launch every nuclear weapon".

What do you do if a user is smart enougth to kill your background script?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
ZiggyStardust

Killing the background script is yet another step in making the script "bulletproof"

I played a little with _IsPressed() and it does tell you if the key you were looking for was pressed but it does not block the input. It allows anything pressed to pass through to whatever is running. Not good.......

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×