Jump to content
Macro Express Forums

Blocking Keyboard Input


ells

Recommended Posts

Hi all,

 

Is there anyway to block the input of the keyboard using Macro Express while still being able to paste from the clipboard?

 

I have a macro that saves a text file from an application to a specific directory from the typical "File" "Save As" menus.

 

I desperately need to bullet proof this saving method because at present if the user presses a key while my desired filename and directory path are being "text typed" or "clipboard pasted" then it upsets the path that the file should be saved to.

 

I can effectively block the keyboard input for the rest of the time by telling Macro Express to have the Alt and Ctrl keys pressed down but you cannot paste from the clipboard while these keys are pressed.

 

I wish there were "keyboard block" and "keyboard unblock" commands that still allowed text to be pasted!

 

Please help!

 

Ellis

Link to comment
Share on other sites

Welcome to the forum ells -

 

At this point the answer is no. We know that this feature has been requested of Insight Software Solutions, but has not yet been implemented. Same goes for mouse activity. I also know that in our company Joe and Paul were attempting to find a solution and put it in the PGM Functions Library. But again, it has not been implemented. It is apparently not as easy to do as was first thought. I am guessing that there are certain low-level key combinations that are making it very difficult.

 

One thing that we do is to use the Text Box Display command to a display a message on top of all other windows (but not have focus) to "Keep your hands and arms inside the ride until it comes to a complete stop". Then, when the text field is complete, a Text Box Close command is fired.

Link to comment
Share on other sites

It's actually relatively easy to block most of the keyboard (except for ctrl-alt-del and a few esoteric Alt-key combinations).

 

However, this has unfortunate side-effects, in that it stops all text type operations, and maybe some others too. It's therefore not very useful - which is why we've not implemented this.

Link to comment
Share on other sites

Grrr!

 

I've tried the text box trick but can't seem to get it to work. It makes no difference if it's there or not.

 

I'm creating a Floating Box until "Close Box" called Block input and have set it to Always on top but not to Keep focus.

 

Once it's displayed, I activate the window that I want to save the file of (it takes focus when it's displayed), then use a text type "CTRL f a" to get to file - save as.

 

I wait for the window title "Save As" to appear then paste the file path and name from a variable then do Alt s to save it.

 

I wait for Window Lose Focus "Save As" then close the Text box "Block Input"

 

If anyone can tell me what I'm doing wrong I would really appreciate it.

 

Ells

Link to comment
Share on other sites

Hi Floyd,

 

I've used notepad for an example in this. It saves a file called c:\test.txt. Warning! it also deletes file c:\test.txt each time it is run so if u have a file called that it will be deleted! (thought I'd better be sure!)

 

<IFOTH:01:2:c:\test.txt><DOFILE:08:NN:C:\test.txt>><ENDIF><TVAR2:01:01:c:\test.txt><TMVAR2:16:01:00:000:000:><TBOX4:F:6:CenterCenter000278000200:020:Block input><ACTIVATE2:- Notepad><TEXTTYPE:<ALTD>fa<ALTU>><WAITWIN2:000010:000000:Save As><TEXTTYPE:%T1%<ALTD>s<ALTU>><WAITWLF2:000010:000000:Save As>

 

If you open notepad and press 5 on the numeric keypad (with numlock on) it will run the macro.

 

If you then go slightly mad as the macro is running and press lots of keys on the numpad, text is written onto the notepad file and the filename can be changed from C:\test.txt. So it doesn't seem to block any text at all!

 

What am I doing wrong?

 

Again, thanks for your help so far.

Link to comment
Share on other sites

Well, you are not doing anything wrong. As I said, there is currently nothing built in to Macro Express that allows blocking user input. As to the Text Box Display command, I meant that we only use it as a warning to the operator not to touch the keyboard while the macro is running. It cannot block input. Sorry about the confusion.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...