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

Mod-Tap, implementation #6

Open
onolox opened this issue Jan 26, 2023 · 8 comments
Open

Mod-Tap, implementation #6

onolox opened this issue Jan 26, 2023 · 8 comments
Assignees

Comments

@onolox
Copy link

onolox commented Jan 26, 2023

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 nhmkdev self-assigned this Jan 27, 2023
@nhmkdev
Copy link
Owner

nhmkdev commented Jan 27, 2023

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
Copy link
Owner

nhmkdev commented Jan 28, 2023

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
Copy link
Author

onolox commented Jan 28, 2023

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
Copy link
Author

onolox commented Jan 28, 2023

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

Many thanks!

@onolox
Copy link
Author

onolox commented Jan 28, 2023

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
Copy link
Owner

nhmkdev commented Jan 29, 2023

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.

@onolox
Copy link
Author

onolox commented Jan 29, 2023

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
Copy link
Owner

nhmkdev commented Jan 29, 2023

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!

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

No branches or pull requests

2 participants