nhmkdev / KeyCap

A Windows application for remapping keyboard input.
MIT License
48 stars 7 forks source link

Mod-Tap, implementation #6

Open onolox opened 1 year ago

onolox commented 1 year ago

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?

nhmkdev commented 1 year ago

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 commented 1 year ago

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.

onolox commented 1 year ago

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 commented 1 year ago

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

Many thanks!

onolox commented 1 year ago

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

nhmkdev commented 1 year ago

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):

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

onolox commented 1 year ago

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.

nhmkdev commented 1 year ago

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!