locked
Is it possible to create a custom input method? RRS feed

  • Question

  • I wanna know if there is the possibility to create your own input method (e.g. like swype) that is much different from the standard keyboard. My aim is to replace the shipped keyboard input with something completely new.

    I read about SoftInputMethods, but cannot estimate its scope of functionality.

    Wednesday, February 6, 2013 10:12 AM

Answers

  • I don't think it will be implemented in the API. As you said, the custom keyboard can pose a huge security risk and act as a trojan to steal passwords or other important stuff. This may be an impediment for your keyboard too. If you ask a password for a bank account, for instance, and you use your special keyboard to fill in the PW, your app may fail marketplace registration.

    There have been many cases in Android keyboards when the publisher got their hand of sensible user information.

    • Marked as answer by -mk- Wednesday, February 6, 2013 1:49 PM
    Wednesday, February 6, 2013 12:48 PM

All replies

  • Yes, you can hack something but it will only work in your application.

    You can create a user control with buttons and manipulate the standard input events for its members to get your task done.

    For instance, if you wanna have a special keyboard for your textbox, you create your keyboard, and in the tap event of the textbox, you show an instance of your special keyboard on the screen. In tap events of your keyboard buttons, you change the text of the textbox.

    This is just a crude example. The overall work needed to get this to work smoothly will be no easy feat.

    There is also the problem of overriding the normal keyboard popup behaviour when your textbox gets focus, but that can be manipulated through focus events, you need to drop focus from your textbox.

    In your user control special keyboard you can do whatever you want with the input style. You can create support for gestures etc etc using the normal input events.

    You may also want to create special user controls that define your custom textboxes and do the focus drop only once, and then instantiate your special textbox when you need it.

    And then there is the problem of binding the keyboard to a specific controler you want to manipulate with your keyboard, that should be a property in the keyboard itself.

    • Edited by mcosmin Wednesday, February 6, 2013 11:17 AM
    Wednesday, February 6, 2013 11:08 AM
  • Thanks for that detailed reply.

    So you wrote in the beginning that a system-wide replacement of the standard input method is not possible. Is this due to a lack of functionality in the current api that will be be filled soon? Or is it due to security reasons when I imagine my input app interacting with each other app and crossing its own "security borders"? Or finally, is it due to preserving the right to no one but Microsoft to change such kind of characteristic system element?

    I know it from Android, where a friend of mine implemented such kind of app. So I was wondering whether this is possible for WP as well.

    Wednesday, February 6, 2013 12:36 PM
  • I don't think it will be implemented in the API. As you said, the custom keyboard can pose a huge security risk and act as a trojan to steal passwords or other important stuff. This may be an impediment for your keyboard too. If you ask a password for a bank account, for instance, and you use your special keyboard to fill in the PW, your app may fail marketplace registration.

    There have been many cases in Android keyboards when the publisher got their hand of sensible user information.

    • Marked as answer by -mk- Wednesday, February 6, 2013 1:49 PM
    Wednesday, February 6, 2013 12:48 PM
  • Oh I see. I think this is plus one for WP again considering security aspects. That absolutely longs for an answer.

    Some off-topic:

    And what's about implementing an app like a text-editor, that you can think of in a "open-with ..." scenario that's known from browsers? Would in-between-app communication in case of text be possible?

    Wednesday, February 6, 2013 1:49 PM
  • It is possible if you use isolated storage to store the files. I heard some news about in-app communications being possible for WP8, but i haven't programmed any kind of thing. There are, however, limitations. For instance, the app you use for "open with" must be programmed to accept the communication from another app.
    Wednesday, February 6, 2013 2:03 PM
  • > It is possible if you use isolated storage to store the files

    what files exactly do you mean?

    Can you please send me a link to that in-app communication stuff for further reading?

    Thursday, February 7, 2013 1:12 PM
  • There was a video in channel 9 about in-app comunication. I cant find the link anymore.

    As for the iso store question: You can crate a network of files in your isostore and use your app to open them. You can use files and extensions that are typically not supported by the system, but you can do it with your app. As i said, I didn't dive too much into these things, maybe someone else can answer you.

    Thursday, February 7, 2013 1:36 PM
  • Okay, that suffices for me now. Thank you!
    Thursday, February 7, 2013 1:46 PM