In android, how can I define a key combination in app to perform some action?
For example, if user press e
and x
letters on a keyboard at the same time, how can I assign a special task to do when this event is fired?
In android, how can I define a key combination in app to perform some action?
For example, if user press e
and x
letters on a keyboard at the same time, how can I assign a special task to do when this event is fired?
You should know that any app you make will only capture 1 touch event at a time unless you utilize multi-touch. So first do this , here , this may help ,this was asked here before too.
public boolean onTouchEvent(MotionEvent event) {
int x = (int)event.getX();
int y = (int)event.getY();
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_UP:}
return false;}
From this you would get the postion of yout touch.Now do some logic on setOnClickListner of other button or "x" here.
Hope it helps.