I have made an Android custom keyboard app with InputMethodService.
Now I want to make swipe on space key, so when user swipes space key, language of keyboard changes to next (swipe to right) or previous (swipe to left).
public class CustomKeyboard extends Keyboard{...}
public class CustomKeyboardView extends KeyboardView{...}
public class CustomKeyboardIME extends InputMethodService implements KeyboardView.OnKeyboardActionListener{...}
Can someone please help me with this problem?
Thank you.
You can't with keyboard view. Or rather, it would be extremely difficult. You'd pretty much need to subclass KeyboardView and overwrite the touch handler, implementing gesture detection and hit detection yourself. That's why no real keyboard actually uses KeyboardView (not even Google's default keyboard), they all make custom views. KeyboardView is really only suitable for quick tests of simple things like new key layouts or new prediction engines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With