KeyCap icon indicating copy to clipboard operation
KeyCap copied to clipboard

Mod-Tap, implementation

Open onolox opened this issue 2 years ago • 8 comments

https://zmk.dev/docs/behaviors/mod-tap https://github.com/davebrny/long-press.git

This page has an example of the behavior I want to achieve, for example: When i click "a" it outputs "a" I hold for a determined time the key "a", let's say 100ms, it outputs "A"

I don't need the repeating "aaaaaa", I want to use the hold a key instead of the shift key.

I can achieve this behavior with this app?

onolox avatar Jan 26 '23 20:01 onolox

Unfortunately this is not supported in the current version.

That's an interesting use case. I'll leave this open as an item for consideration in future versions.

nhmkdev avatar Jan 27 '23 02:01 nhmkdev

I put together a prototype version of the long press on inputs and will further develop it: https://github.com/nhmkdev/KeyCap/releases/tag/v.2.0.0.5

One major issue is that the timing for the long press is currently 1 second (way more than 100ms as you mentioned). I hope to make the value customizable in a future version.

nhmkdev avatar Jan 28 '23 04:01 nhmkdev

1s is really a long time in this kind of functionality. 200ms is a time i'll use in my custom keyboard. A customizable delay is really inportant, because people are different.

🖖

onolox avatar Jan 28 '23 12:01 onolox

I saw that you implemented! And with independent custom timing! I'm testing it, and really loved the work.

Many thanks!

onolox avatar Jan 28 '23 22:01 onolox

Edit, I found that it interferes with the keyboard shortcuts eg: Ctrl+C. Maybe if Ctrl or Shift is pressed, ignore the custom delay.

onolox avatar Jan 28 '23 23:01 onolox

It should be ignoring shift/alt/control for long press. It definitely could be a bug though. Here's an example of what I tried out: image

Is that the same general setup you are trying? Also, what do you have the Keyboard control panel repeat delay set to?

I am using notepad and was able to use c and v to produce the uppercase characters. Holding ctrl+c and ctrl+v seemed to work as expected (copying/pasting).

I was able to produce an odd case that might be the issue (doesn't always happen):

  • Pressed ctrl and then c (both held)
  • Released ctrl and then c (almost immediately after)
  • The timing appears to be just enough for KeyCap to think that c was pressed (technically it was down for a moment without ctrl)

I'll see if there's something that can be done. It might be a tough one.

nhmkdev avatar Jan 29 '23 00:01 nhmkdev

For me ctrl+c copies the value, but replaces the selection with an c ctrl+a selects all then replaces all with an a

Edit: Now I see that I have a bad habit! I let go ctrl then let go c I think I have to redo the shorcut habit that I have.

If I let go c then ctrl everything is fine. But, if you can achieve the nirvana and ignore the c after release of ctrl it will be so much more reliable and will make you have so much less pain.

onolox avatar Jan 29 '23 00:01 onolox

There's a new version that may make this slightly better:

https://github.com/nhmkdev/KeyCap/releases/tag/v.2.1.0.1

I compared this and the prior version and there's definitely more tolerance after releasing the ctrl key between the two versions. If you keep c held down just a bit too long you'll definitely run into trouble!

nhmkdev avatar Jan 29 '23 00:01 nhmkdev