Open bbqsrc opened 10 years ago
Unfortunately, Apple's way of resizing the keyboard view is a bit hacky, so even though you can resize it on the fly, it might be too slow for practical purposes. I'll look into it, though. I assume you're thinking of having the banner section appear only when pressing the top row keys?
Yeah, if it were possible. At least the banner area can be useful, for dictionary support, etc.
Preliminary experiments have shown that it might be possible to do, but it's not straightforward. I'll consider working on this feature later; right now, more important stuff to do.
I understand your not wishing to tackle creating extended popups right now! However, being able to detect a long press on a key would be very useful for extendability--caps lock and so on. Just getting a keyLongPressed callback, for instance, would at least let others be able to create their own UI.
+1
+1
A lot of +1's here :) I could probably do a pull request if it's easier for you, but I think it'd be a simple addition to just set a timer and flag on touchesBegan, ensure the movement doesn't go out of a predefined bounds on touchesMoved, and fire a keyLongPressed method. Might be able to make this work with a longpressgesture too, not sure which is easier to implement. (Bought your app by the way. Anyone else using this framework should at least do that as well!)
Hey, thanks! Aside from the special character popups, what is a long press used for? I could add a long press recognizer, but if people want to implement their own special character pickers, they'd need to do a lot more work involving special casing the forwarding view to pass on touches to the picker once it's open, as well as dealing with the crazy bezier curve stuff in KeyboardKey. So I don't know if it would really be all that useful.
Yeah, that's probably true. Didn't consider the complications in forwarding touches. I may be biased here in its utility.
Would still be useful for special keys like Caps, that could use a long press to toggle a setting, or to detect keys that could repeat. For instance, you have a custom timer for backspace, but this could be extended easily to any key that opts in to a long press, and devs could choose to repeat or perform another action.
Yes it will be really challenging to deal with brazier curve stuff and so on. but still will be useful if you implement long press so we can open our custom popup view event it will not be similar to iPhones default at the beginning.
i am playing around trying to add longpress at setupKeys() but it does not fire an action. Does it somehow disable all gestures somewhere?
let lp = UILongPressGestureRecognizer(target: self, action: "keyLongPress:")
lp.minimumPressDuration = 1.2
lp.numberOfTapsRequired = 1
keyView.addGestureRecognizer(lp)
so here func KeyLongPress never being called.
Are you adding the gesture recognizer to each key? It's not going to work because everything goes through the forwarding view right now. The keys don't actually receive any touches.
Actually the point is to add for individual key but just for testing i put code to if key.hasOutput { part. Anyway if it does not receive any touches then it wont work even for individual key. What you suggest todo? Now i am trying to figure it out the same way you do for backspace button.
huh did it with timers. works fine :)
Yeah, that should work. You could also try adding the gesture recognizer to the forwarding view and checking if your touch is inside a key's bounds, but that is a more gnarly approach. (Though perhaps ultimately the more elegant one...)
What is the exact reason of using forwarding view? don`t you think it is decreasing the performance?
If I don't use a forwarding view, it's impossible to slide your finger from one button to another. TouchDragEnter doesn't fire unless the touch starts in that control to begin with.
Oh, so you are thinking about future, to make "type by sliding" functionality :+1: :))
No, I mean on the keyboard, when you hold down a key and then slide your finger over to another key, the popup for the first key closes and the popup for the second key opens up. You couldn't do that without a forwarding view, i don't think.
I understood you man :) Just wanted to kindly egg you on to start thinking about slide typing :))
@pirrate did you actually implement a long-press solution? Would you share it?
Hi @SchSimon , i am using the same technique that @bbqsrc did. Check out his fork https://github.com/bbqsrc/tasty-imitation-keyboard/blob/master/Keyboard/KeyboardViewController.swift
Refers to this link, I have make changes in this keyboard. It may help you https://github.com/AmitBhavsarIphone/Custom-keyboard It contains, Different keyboard type changes, Long popup with different alphabet options, Suggestion bar with text in it. Constraint changes for different keyboard type.
@AmitBhavsarIphone thanks for sharing. Does the host app showcase these new additions? Sounds very useful.
Hi @alariccole It showcase new additions, Looking forward to make
I know you've said you'll tackle this later, but I thought I'd open this for consideration.
We just discussed in another bug the requirement for a banner due to the view not being able to have popups extend outside which is unfortunate.
If the popups are on the left and right, that'd have implications for the long press implementation.
Is it possible to resize the view on the fly?