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

Keyboard Proposed Fix #38

Open
maxrabin opened this issue Oct 30, 2012 · 2 comments
Open

Keyboard Proposed Fix #38

maxrabin opened this issue Oct 30, 2012 · 2 comments

Comments

@maxrabin
Copy link
Contributor

Before discovering tuneup_js (which I love) and its typeString (which is slow and there are other keyboards complaining about it), I did the following to get the keyboard to work, and work fast:

var TypeString = function (str) {
    var keyboard = UIATarget.localTarget().frontMostApp().keyboard();
    for (i = 0; i < str.length; i += 1) {
        keyboard.typeString(str[i]);
    }
};

By typing one key at a time I am able to type letters (capitol and lowercase), numbers, characters (!) and it does it fast. I'm curious if other people have tried that and whether or not the tuneup typeString should be replaced with this code. Any thoughts?

@alexvollmer
Copy link
Collaborator

I think the only reason to keep the original typeString() function in tuneup is for pre iOS-5 testing. The function is a beast and I've heard lots of reports that it's slow, though I don't use it myself (my 4.x project are far in the rear-view mirror). This is a clever solution, but it's really just a re-mapping of the existing API which I try to avoid (and don't always succeed at). Since this relies on UIAKeyboard's typeString(), it won't help people testing on iOS 4.x.

Here's what I think: if you're on iOS 5, just use the typeString() function provided by UIAKeyboard. If you're on iOS 4.x use the one provided by tuneup. Eventually I'd like to deprecate and remove this function altogether from tuneup.

Thoughts?

On Oct 30, 2012, at 2:08 AM, Max Rabin [email protected] wrote:

Before discovering tuneup_js (which I love) and its typeString (which is slow and there are other keyboards complaining about it), I did the following to get the keyboard to work, and work fast:

var TypeString = function (str) {
for (i = 0; i < str.length; i += 1) {
UIATarget.localTarget().frontMostApp().keyboard().typeString(str[i]);
}
};
By typing one key at a time I am able to type letters, numbers, characters (!) and it does it fast. I'm curious if other people have tried that and whether or not the tuneup typeString should be replaced with this code. Any thoughts?


Reply to this email directly or view it on GitHub.

@maxrabin
Copy link
Contributor Author

I wasn't aware of the 4.x issue. Our project is 5.x and up. So I'm happy continuing to use my workaround. Thats why I suggested it as an issue not a pull request. Maybe other people might find it useful.

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

No branches or pull requests

2 participants