How to change keyboard layout by swipe left or right space key in custom keyboard
问题 I made an android custom keyboard . I want to use swiping on Space key on the keyboard for changing keyboard layout to show next language layout. How can i do that? I used bellow class: public class KeyboardIMS extends InputMethodService implements KeyboardView.OnKeyboardActionListener { ...} 回答1: You can do this by override touchEvent like this : @Override public boolean onTouchEvent(MotionEvent e) { float x = e.getX(); float y = e.getY(); switch (e.getAction()) { case MotionEvent.ACTION