On windows systems, there are two enter buttons, one that is part of the "QWERTY" section of the keyboard and is called the Return key on Mac systems. The other is part of the number key pad and is labeled "enter" in both systems.
Code ( Get ( TriggerKeystroke ) ) = 10 detects the Return (QWERTY Enter) key
Code ( Get ( TriggerKeystroke ) ) = 13 detects the Enter (Number pad Enter) key
thanx 4 reply ....bt ..in this main dont allow enter to user.. or if enter is pressed then remove it....so how to perform this..?
how to remove enter from textfield..?
If [ Code ( Get ( TriggerKeystroke ) ) = 10 ]
Exit Script [False]
Look up Setting Up Script Triggers in FileMaker Help to learn why this works.
Thanks for reply .....what i did ......
Show Custom Dialog["You Pressed Enter"]
In this When i press Tab or anyother Modifier Key everytime it shows dailogbox "You Pressed Enter"
....how to solve this..?
Can we check that in textfield is there any enter ...kaey pressed or not..?
You did not use the correct get function. Look at my example script again and please use the one that I have recommended.
And if you just want to keep a return from being entered into the text field, this can be done without using a script at all. Select the field while in layout mode and use the Inspector's behavior settings to set the field so that pressing enter/return moves the cursor to the next object in your layout tab order instead of entering a character.
Hi i also try If [ Code ( Get ( TriggerKeystroke ) ) = 10 ]
Show Custom Dialog ["you pres enter"]
Exit Script [False]
and i set this on "OnObjectKeystroke" so when i press any key its show dialogbox
Please post the exact and complete script that you are using.
To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.