furo-key-filter

furo-key-filter #

@furo/util v2.1.19
import '@furo/util/src/furo-key-filter.js';
exports FuroKeyFilter js
exports <furo-key-filter> custom-element-definition
superclass LitElement
mixes FBP

summary keyboard event filter

furo-key-filter Allows only defined keyboard events to pass through

1
2
3
4
5
6
<!-- note the asterisk on other-component keydown. Because filter needs the keyboard event. -->
<other-component at-keydown="--keydown(*)"></other-component>
<furo-key-filter
    fn-filter="--keydown" at-matched="--escapePressed"
    keys="Escape"
    ></furo-key-filter>

Attributes and Properties #

keys #

keys String

Coma separated list with allowed keys to pass. i.e “Enter, ArrowUp”

shift #

shift Boolean

Modifier key shift must be pressed too to match

alt #

alt Boolean

Modifier key alt must be pressed too to match

command #

command Boolean

Alias for meta.

Modifier key meta must be pressed too to match.

meta #

meta Boolean

Modifier key meta must be pressed too to match

control #

control Boolean

Modifier key control must be pressed too to match

Events #

matched #

at-matchedKeyboardEvent

Fired when key matches the options

Methods #

filter #

filter(keyboardEvent `` ) ⟹ void

`` fn-filter

Check the event and dispatch matched when the conditions are fulfilled.

  • keyboardEvent