Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add combo key trigger #70

Closed

Conversation

MinchukSergei
Copy link

I'm not sure in varargs description.

Also if we have 2 buttons: 1 with single key trigger and 2 with combo key trigger we have behavior intersection e.g.:

  • First key has single trigger: 'Space'
  • Second key has combo trigger: 'Space' + 'Enter'

If we click 'Space' and alternately 'Enter' press/release we also trigger the first button hover.

'Space' + 'Enter' will work, but 'Enter' + 'Space' won't.

@Insality
Copy link
Owner

Hello! Thanks for suggestion!

I've looked on this. This is nice feature, but on my mind it deserves to be in separate component.
Pros:

  • Ability to use key triggers without node
  • Separate code logic
  • We can add ability to add several key triggers on single callback

Current popular use-case for key_trigger in button is add "Enter" or "Esc" for agree/cancel/play buttons and add gamepad buttons for some actions (it's a part of #40). So more detailed logic with key-trigger setup we can make in separate component. It's hard to describe nice looking API for set_key_trigger in button component.

My suggestions is to make the key_trigger component on druid_assets. If you will do it and describe with documentation API like druid use, I'll create druid-assets API page and add most quality assets to Druid main README in components section to share it across all users. Or it's possible to add it in base Druid components.

This is also can be good example to make custom component by community!

But this pull request I'll close. Thanks!

@Insality Insality closed this May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants