Custom Keyboard

You must Login before you can answer or comment on any questions.

Is it possible to create a custom keyboard with Titanium without having to resort to creating it in a module?

Where I see problems are with the limited control over the standard keyboard and access to its events. The only way it seems possible to control the showing or hiding of the standard keyboard is to call blur() on the textfield that is active. So I am not sure how I could prevent the standard keyboard from appearing in order to replace it with the custom one.

There are a number of questions about this in the past two years, but none of them have been answered.

Any ideas?

Env:

  • iOS
  • SDK 2.x
— asked 1 year ago by Henning Glatter-Gotz
2 Comments
  • What events do you want but not have?

    — commented 1 year ago by Matt Apperson

  • Basically I was wondering if it would be possible to have all the built-in features of the textfield (cut, paste, long press cursor movement, etc.) while at the same time suppressing the iOS keyboard and putting a custom one in its place.

    I think by setting editable to false I would be able to suppress the keyboard, but probably loose the cut and paste. I will try that.

    — commented 1 year ago by Henning Glatter-Gotz

2 Answers

So here is the issue... if you create a custom keyboard it wont have any of the predictive typing abilities that the existing system one has. The system keyboard has a TON of logic behind it that you cant just replicate.

Your correct that the only way to control the keyboard is using things like blur. To do what your looking to do you would need to create a fake text field using labels and views. it's not easy and not something i would recommend.

The better thing for you to do is to post a question about more directly what you are trying to do. overall however the exact specifics of what your looking to do here is not recommended at all on iOS native or Ti

— answered 1 year ago by Matt Apperson
answer permalink
1 Comment
  • Thanks Matt!

    After looking into this for a while I was afraid that this would be the answer. Essentially, what I need to do is develop a very specialized calculator that requires a certain set of keys that are split between two of the iOS standard keyboards.

    Because they are on two separate keyboards it just makes it rather inconvenient to work with, but it is possible - just not "pretty"/user friendly.

    I thought about faking it with a label, but then I loose the nice features like cut and paste and moving the cursor with long press, etc.

    To sum it up, it is not trivial, native or Ti. :-(

    — commented 1 year ago by Henning Glatter-Gotz

It's going to be difficult to get that kind of low-level control without a module. Have you tried setting editable to false for al of your textfields and textareas? This should prevent the keyboard from opening and you can change its content programmatically with your custom keyboard.

— answered 1 year ago by Tony Lukasavage
answer permalink
3 Comments
  • Tony, I think you would agree though, creating your own keyboard on iOS is not at all a good idea... thus making the rest of this moot.

    — commented 1 year ago by Matt Apperson

  • Thanks for the feedback guys!

    — commented 1 year ago by Henning Glatter-Gotz

  • Matt, I wouldn't make that blanket statement. Depends on the complexity of the keyboard. If you are trying to recreate every feature of the full keyboard set, then yeah, either do a module or forget it. If you are trying to make a small subset of keys that will impact a limited number of textual UI components, though, it may in fact be doable

    — commented 1 year ago by Tony Lukasavage

Your Answer

Think you can help? Login to answer this question!