Skip to content

keydown event handlers for specific keys #219

@rx

Description

@rx

You should be able to bind an event handler to a keydown event for a specific set of keys.
Examples - using enter key for submit, providing a keyboard friendly set of options.
Single key:

event :keypress, :enter do
    # event handler code goes here
end

An array of keys:

event :keypress, :enter, :g do
    # event handler code goes here
end

Having a modifier

event :keypress, :enter, {key: :g, modifiers: :ctrl} do
    # event handler code goes here
end

Having multiple modifiers

event :keypress, :enter, {key: :g, modifiers: [:shift,:ctrl]} do
    # event handler code goes here
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions