k icon indicating copy to clipboard operation
k copied to clipboard

"*" and "x + *" don't work

Open darsain opened this issue 10 years ago • 7 comments

I assume * is supposed to be an "any character" flag, in which case these shortcuts don't work:

  • *
  • x + *

Why would I want it?

I was recently working on a UI element that needed to be populated with different sets of data for the purposes of testing, so I imagined streamlining it into something like:

k('s + *', function (event){
  // make s+0 to s+9 shortcuts (determined based on `event.which`,
  // which should be a number button) populate the element with different data sets
  // if `event.which` isn't a number key, ignore
});

The way how I made it to work was with s * shortcut, which is just awkward to use, as you have to completely release all keys before trying out different one.

darsain avatar Nov 23 '14 10:11 darsain

wow good catch! can you try latest master (added a fix for cmd + *), what's the use-case for *?

yields avatar Nov 23 '14 12:11 yields

added tests for this, but lmk if that doesn't work (browsers are weird sometimes: #27)

yields avatar Nov 23 '14 13:11 yields

Tested and:

  • [x] *
  • [x] shift + *
  • [x] super + *
  • [x] alt + *
  • [ ] k + *

Alone works, modifiers work, only the key + other key doesn't work now.

And use cases for *, didn't need it yet, but from top of my head:

  • Capturing everything in shortcut settings UI when letting users configure their own.
  • Logging?

I'm sure there's more :)

darsain avatar Nov 23 '14 13:11 darsain

ah got it, * makes sense then.

as for k + *, k isn't a modifier -- i can probably expose that map and let users modify it to add k, but don't think it should be in core for now.

sounds good?

yields avatar Nov 23 '14 13:11 yields

By k I meant any non-modifier key, but just noticed that shortcuts like a + b are also not possible.

Would it be feasible as a feature request, or do you consider it too niche? Basically treating any key as a possible modifier?

darsain avatar Nov 23 '14 14:11 darsain

I think it could be a really cool feature to have, I'll accept a PR, otherwise I'll get to it eventually.

-amir

On 23 בנוב׳ 2014, at 16:13, darsain [email protected] wrote:

By k I meant any non-modifier key, but just noticed that shortcuts like a + b are also not possible.

Would it be feasible as a feature request, or do you consider it too niche? Basically treating any key as a possible modifier?

— Reply to this email directly or view it on GitHub.

yields avatar Nov 23 '14 14:11 yields

I wish I had time now. I'll also submit a PR ... eventually :)

i.e. when I'll need it again. I don't right now.

darsain avatar Nov 23 '14 14:11 darsain