Listening for Keystrokes


keyboard.png

Here is another great Script Trigger technique.

Sometimes you want to use Up and Down arrow keys to navigate a portal or list view. Here is how you can do it, by writing a simple script and attaching a script trigger to the layout.

In this example, I use the Up/Down keys to move through a list, and the Enter or Return key to select one of the list items. The Escape key takes you back to your previous layout.

Don’t use these keys on a layout that you need to edit in, as they can interfere with what the user expects (for example, using the arrow key to move down a lengthy text field.), just use them for quick selection layouts.

Write the script

pastedgraphic-22.png

Basically, each item in the list is a Listen for the keystroke (by number) then do something.

Attach the Script to the Layout

pastedgraphic-23.png

Common Keystrokes to listen for:

Return 13
Tab 9
Right Arrow 30
Left Arrow 28
Up Arrow 29
Down Arrow 31
Escape 27

You can obviously combine these keys with a trap for which layout you are on and what modifier keys are being held.

You can also listen for modifier keys:

Option Key is 8
Control key is 4
Function Key is 0
Shift Key is 1

Related Articles:
Highlighting Rows in FileMaker lists or portals
Paradise by the Dashboard Light – Bouncing around in FileMaker, building Charts
Drag and Drop List or Portal Sorting

Trackbacks/Pingbacks

  1. Highlighting Rows in FileMaker lists or portals | HomeBase Software - July 14, 2012

    […] Related Articles: How do I update information in a whole bunch of records at once in FileMaker? Drag and Drop List or Portal Sorting Listening for Keystrokes […]

%d bloggers like this: