2 Replies Latest reply on Jun 14, 2012 10:37 AM by pedantic

    Capturing common keystroke combinations in Windows (Filemaker 11)


      Hello everyone.


      In the project runtime I have reduced the number of options in menus or removed them altogether. For example we don't want the user deleting data so the Cut command has been removed from the Edit menu. On the Mac, if the cursor is in a field and the user presses Command+X, nothing happens which is well and good. On the Windows box, however, if the user presses Ctrl+X, depending upon the computer, a special character (like this:├) is inserted.


      The solution is easy, it seems to me. I just intercept the keystroke and discard it, but I can't find any way to do that in the references I have on hand.


      First of all, is there an easy solution to the special character problem on Windows? If not, how can I intercept keystrokes and discard them?





        • 1. Re: Capturing common keystroke combinations in Windows (Filemaker 11)

          Rather than removing the Cut command from the menu, have you tried substituting a script that either does nothing or tells the user they can't cut or does a copy instead? Perhaps the OS is substituting some command in the absence of the Control-X menu item; if so, your own substitute might prevent that. The keystroke script triggers in FileMaker don't get to see a keystroke until after the OS and FileMaker menus are done with it, so trying to intercept it in FileMaker may not help.


          If you want to try intercepting keystrokes anyway, you could set-up an OnLayoutKeystroke script trigger that exits with a result of False or 0 (zero) if the user keyed Control-X, and True or 1 otherwise. This will tell FileMaker to discard the event.

          1 of 1 people found this helpful
          • 2. Re: Capturing common keystroke combinations in Windows (Filemaker 11)



               What I just tried is something quite similar and it works, but I do not know if the project manager will buy the solution.  I created a menu called "Unused" and then placed several commands under Unused that did exactly that; they intercepted the CTRL-Whatever keystroke and when they did, called NullKeystroke, a script that does nothing.  Your suggestion is actually simpler and thus a bit morer elegant than mine.  If they won't accept my solution then I will suggest yours.  Perhaps that will satisfy them.


            According to the documentation, there are some keystroke combinations that will not be captured by some script triggers, among them the cut and paste keystroke combos, which is why your suggestion seems to be the better route.