All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

non-focus-maybe-capture-gesture Function

Summary

Maybe capture a gesture by a non-focus-list-interface.

Package

capi

Signature

non-focus-maybe-capture-gesture non-focus-list-interface gesture => result

Arguments
non-focus-list-interface
gesture
A gesture specifier.
Values
result
A generalized boolean.
Description

The function non-focus-maybe-capture-gesture is used to pass input gestures to a non-focus-list-interface that was created by prompt-with-list-non-focus.

A non-focus-list-interface, by its nature, does not receive keyboard input, but in most of cases it is still useful if it responds to some gestures. For that to happen, non-focus-maybe-capture-gesture must be called.

gesture must be a gesture specifier, which is an object that can be coerced to a gesture-spec by sys:coerce-to-gesture-spec.

Currently non-focus-maybe-capture-gesture does the following:

  1. If gesture is Escape, it calls non-focus-terminate on non-focus-list-interface.
  2. It checks whether the gesture matches any of the gestures in the gesture callbacks of non-focus-list-interface. The gesture callbacks are either explicitly defined using the keyword arguments :gesture-callbacks or :add-gesture-callbacks in prompt-with-list-non-focus, or implicitly. By default, all the gestures that are used in in-place completion (see 10.6 In-place completion) are defined implicitly. These include Up, Down, PageUp, PageDown (change selection in the list panel), Return (invoke the :action-callback), Control+Return and Control+Shift+Return (control of the filter in the list panel). The implicitly defined gestures are affected by the keywords :gesture-callbacks, :filtering-gesture and :filtering-toggle in prompt-with-list-non-focus.

    If a match is found, it is invoked as described for gesture-callbacks in prompt-with-list-non-focus.

  3. If filtering is enabled, it checks if the gesture is captured by the filter. A gesture is captured by the filter if it is:
    A plain graphic character.
    It is inserted to the filter.
    Backspace
    The last character in the filter is deleted.
    One of the gestures that update the state of the filter (by default Control+Shift+R, Control+Shift+E, Control+Shift+C)
    The state of the filter is updated.

In any case, where a gesture is captured by the filter the list panel is updated.

If the gesture is captured by one of the possibilities above, non-focus-maybe-capture-gesture returns t, otherwise it returns nil.

See also

non-focus-terminate
prompt-with-list-non-focus


CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:33:57