You should use the Code function as well.
Return is 13 and Enter (keypad) is 10.
If ( Code ( Get ( TriggerKeyStroke ) ) = 10 OR Code ( Get ( TriggerKeyStroke ) ) = 13 )
If you have FileMaker Pro Advanced you can use the Data Viewer to grab the numeric code for many characters. It doesn't work for Enter (or I should say, I'm not sure how to make it work for Enter) so coherentkris' link is the way to go there.
But if you're trying to find the number for the tilde for example, you could type this into the Data Viewer:
Code ( "~" )
and the result is 126, which you could use with the Char () function like
If ( PatternCount ( TABLE::field ; Char ( 126 ) ) > 0...
Phil: Thanks for pointing out code() function, I just tried it and it works great and solved my problem.
Coherentkris: Thanks for the ascii list, will definitely save into my favourite for future reference.
Daniel: Thanks for the tip regarding using data viewer to test out the ID of the Char, it definitely will save me heaps of time for my future developments