7 Replies Latest reply on Jul 2, 2013 6:38 AM by timdin

    Keyboard Control



      Keyboard Control


      Hello Board!

      I'm new to FMP9 and am developing a data entry db.


      I am going to use a touch screen LCD for data entry into fields and a barcode scanner.


      I'd like to have a 0-9 keypad onscreen, like a telephone; so that the user doesn't have to use a keyboard seperatly.


      Any idea how i can script this so as to send a (for example) 1 into a field, followed by which ever other numbers also need to go in the field?


      I found an 'Insert Text' thing in the scripts, but it only lets me put one number in.


      Thanks for any help on this!

        • 1. Re: Keyboard Control

          Hi Harry,


          Welcome to the forum.


          Instead of 'Insert Text' use 'Set Field', setting the target field to your number field, and the calculated result calling your number field first and then inserting the number after.


          If you are using a script to set the field, call the script with a Script Parameter set to the number you wish to insert, so for the button of number 1 the parameter will be 1, and then you can have a simple one line script called by all 10 numbers.


          The script would then be:



          Set Field [ Table::YourNumberField ; Table::YourNumberField & Get ( ScriptParameter ) ]


          I hope this makes sense, let me know if you need any extra explanation. 

          • 2. Re: Keyboard Control

            Hello Orlando,


            Many thanks for your swift reply!


            I have entered in the Script, using the 'Specify Calculation' dialog to enter the 'Get' portion.


            But i have Get (1) and an error message tells me 'This parameter is an invalid Get function Parameter'


            Is there more i'm not entering correctly.


            Thanks again!

            • 3. Re: Keyboard Control

              Hi Harry


              The Get ( ScriptParameter ) function will get its value as the script is called, so enter it as "Get ( ScriptParameter )" and then while setting up the button, when you specify the script, put the button number in the Optional Script Parameter box under the list of scripts.


              Try this and let me know how you get on. 

              • 4. Re: Keyboard Control



                Perfect! Thank you very much! I now understand that a bit better. It is difficult to get my head around it all.


                Does this mean i can use this script to call any keyboard stroke i want?


                Like, i'm trying to do printing via the Internet. And was going to build a 'print' button that would call Func-P, then <enter> etc. etc. to automate the process.


                Thanks again, the way you have described it is very simple and accurate, much appreciated.

                • 5. Re: Keyboard Control

                  Not a problem Harry,


                  You can use this particular script to populate that set field with any value you put in the Script Parameter on the button.


                  You can copy the script and reuse it on other fields with other buttons etc.


                  Glad I could help.


                  • 6. Re: Keyboard Control

                    If you want to use your graphic keypad to fill in any field that your cursor happens to be in, modify the script to read:


                    Set Field [Get(ActiveFieldContents) & Get ( ScriptParameter ) ]

                    • 7. Re: Keyboard Control



                           I am trying to do the same thing as you.  I am new to FM Pro 12 and not haveing much luck.  the explanation below is slightly puzzling me.


                           Can you help?