Skip to content

keydown event handlers for specific keys #219

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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