-
Notifications
You must be signed in to change notification settings - Fork 722
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
Keyboard repeat support #32
Comments
Hi Pascal-bach! Hmm, I don't think this is possible to speed up the key repeat rate using javascript. The inherent key repeat rate is set by the operating system. I know in Windows 7, the keyboard properties "Repeat delay" and "Repeat rate" can be set, but as I said javascript isn't this powerful. I did a quick search and found this post on StackOverflow which basically tells me you'll need a desktop application that can change the OS registrry. What is possible with javascript is to slow down the repeat rate, again a reference to an answer from StackOverflow. But I don't know how useful this might be... If I did include this option with the keyboard, I might just make it into an extension. |
That was not what I meant. The rate from the physical keyboard should not be changed. I meant it should be possible to press a soft key and as long as you don't release the key it should repeat the key according to the options I mentioned. I hope I explain it clearer this time. If not please let me know ;) |
Hmm, so I have a question. When you hold down a key on a touchscreen, does the key repeat? So, basically you want to disable the build-in keyboard key repeat and just make something independent of it? That should be possible, but I won't have time to look into this option until later... busy day today! |
What do you mean by the "build-in keyboard key repeat" ? I dont' think it should be related to the OS settings or the physical keyboard, this would really be most useful on a touchscreen where the onscreen keyboard would behave more like a normal keyboard. It's not an urgent thing but I think it would be something nice to have. |
Sorry, I was thinking about using the keyboard (keyup/keydown) when I should have been thinking in terms of touchstart/touchend. I don't have an iPad, so I would appreciate it if you could test this demo for me and if it works as you need it to. If you need a full screen version to test on, try this link. |
Yes thats mor what I had in mind. Normal keys are working as expected. However the most useful key to use in this way would be backspace. But backspace and tab are the two that are not working. Any ideas why this could be? |
Ewww, bad bug in that last vesion! Click and release any key quickly and after the initial delay, it just starts typing! LOL. Ok, try this updated version. I've included the tab, enter, space and backspace keys. But now I see a bug with the enter key (at least in Firefox, ugh). These demos were more for a proof-of-concept. I think I include this ability in the plugin... I've stopped worrying about the code getting too big from enhancements LOL. |
This is exactly what I thought the keyboard should behave. And I think a plugin for this would be fine. But there is another bug I recognized. When you press a key and then move the mouse out of the keyboard. The repetition never stops until you close the keyboard. |
LOL, yeah lots of issues still. Try this version... the main problem with this one will be on the touch device, I think. I've made it now so that if you move your finger at all, it cancels the repeat. I had to do this after I read that if you touch a key, then move your finger off of it, the "touchend" event never fires. Are you able to test this demo on a touch device? |
Ok, this feature was added to version 1.9! It "should" work on touch devices too! :) |
Nice work. I was able to test it on a touch device and it mostly seems to work. However there are some issues I found. I will try to come up with an example how to reproduce the issues. |
Hi Pascal-Bach! Were you able to reproduce the issue? |
Hi, sorry for the delay. I was finally able to reproduce the bug:
|
Ok try version 1.9.2... I've fixed the problem and added |
Hi, I tried 1.9.2 and the problem with the key seems to be gone. Nice work. |
So, I think the I could add a callback function to override the default behavior of the base.nextInput function, but it would be called after the content was accepted/ignore and the keyboard has closed. Maybe, I could add an "afterClose" callback? Maybe a flag that lets you know it's going to attempt to navigate to the next input? |
I think a callback to override the base.nextInput function is what would do the trick. This would allow me to do the necessary actions when a user presses enter. The only other possibility would be to create a more generic callback mechanism that allows to override and possibly prevent any keys default action. Using this I could catch the enter key before any action is taken. |
Ok, this issue should be fixed in v1.9.3. I've also added a callback override as you requested, named |
Hi Mottie,
I thought about a feature that would be nice to have in the keyboard. On physical keyboards the when you hold down a key the keyboard starts repeating this key. It would be nice to have this behavior too. It would be especially useful on touchscreens.
The behavior I thought about would be as follows:
When you start pressing a key the keyboard enters the character once. Then after a certain
delay
the keyboard starts repeating the character at a certainrate
. I thinkdelay
andrate
should be configurable to the desired time interval/frequency.Do you already have an Idea how to implement this? Or should I try to come up with something?
Cheers
Pascal
The text was updated successfully, but these errors were encountered: